Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1334)

Unified Diff: webrtc/base/messagehandler.h

Issue 2877023002: Move webrtc/{base => rtc_base} (Closed)
Patch Set: update presubmit.py and DEPS include rules Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/base/messagedigest_unittest.cc ('k') | webrtc/base/messagehandler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/messagehandler.h
diff --git a/webrtc/base/messagehandler.h b/webrtc/base/messagehandler.h
index 72c0dc6907950a8e0645f1172f7db9a503b16874..943d0d7d9b0d9f6e2d60e9becd9d8fd3bbe3768f 100644
--- a/webrtc/base/messagehandler.h
+++ b/webrtc/base/messagehandler.h
@@ -11,65 +11,9 @@
#ifndef WEBRTC_BASE_MESSAGEHANDLER_H_
#define WEBRTC_BASE_MESSAGEHANDLER_H_
-#include <memory>
-#include <utility>
-#include "webrtc/base/constructormagic.h"
-
-namespace rtc {
-
-struct Message;
-
-// Messages get dispatched to a MessageHandler
-
-class MessageHandler {
- public:
- virtual ~MessageHandler();
- virtual void OnMessage(Message* msg) = 0;
-
- protected:
- MessageHandler() {}
-
- private:
- RTC_DISALLOW_COPY_AND_ASSIGN(MessageHandler);
-};
-
-// Helper class to facilitate executing a functor on a thread.
-template <class ReturnT, class FunctorT>
-class FunctorMessageHandler : public MessageHandler {
- public:
- explicit FunctorMessageHandler(const FunctorT& functor)
- : functor_(functor) {}
- virtual void OnMessage(Message* msg) {
- result_ = functor_();
- }
- const ReturnT& result() const { return result_; }
-
- // Returns moved result. Should not call result() or MoveResult() again
- // after this.
- ReturnT MoveResult() { return std::move(result_); }
-
- private:
- FunctorT functor_;
- ReturnT result_;
-};
-
-// Specialization for ReturnT of void.
-template <class FunctorT>
-class FunctorMessageHandler<void, FunctorT> : public MessageHandler {
- public:
- explicit FunctorMessageHandler(const FunctorT& functor)
- : functor_(functor) {}
- virtual void OnMessage(Message* msg) {
- functor_();
- }
- void result() const {}
- void MoveResult() {}
-
- private:
- FunctorT functor_;
-};
-
-} // namespace rtc
+// This header is deprecated and is just left here temporarily during
+// refactoring. See https://bugs.webrtc.org/7634 for more details.
+#include "webrtc/rtc_base/messagehandler.h"
#endif // WEBRTC_BASE_MESSAGEHANDLER_H_
« no previous file with comments | « webrtc/base/messagedigest_unittest.cc ('k') | webrtc/base/messagehandler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698