summaryrefslogtreecommitdiffstats
path: root/base/message_loop/message_pump.h
diff options
context:
space:
mode:
authoralexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-22 22:24:13 +0000
committeralexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-22 22:24:13 +0000
commit54aa4f1ad7293be94fc044ee2f8adcffe729986d (patch)
tree1b5438b9bb1fc7866a2da980a0f4ff0fed7f2f2d /base/message_loop/message_pump.h
parent866fa2ccbffcbc41af001d772440f4baf5609848 (diff)
downloadchromium_src-54aa4f1ad7293be94fc044ee2f8adcffe729986d.zip
chromium_src-54aa4f1ad7293be94fc044ee2f8adcffe729986d.tar.gz
chromium_src-54aa4f1ad7293be94fc044ee2f8adcffe729986d.tar.bz2
Made MessagePump a non-thread safe class.
This CL makes MessagePump a non-thread safe class to make sure thread-bound resources (such as the UI window used for pumping messages on Windows) are freed on the correct thread. Handling of incoming tasks and synchronization between different threads was moved out to a separate class - IncomingTaskQueue reducing the number of locks to be taken while posting a task to one. Posting tasks via both MessageLoop and MessageLoopProxyImpl is now routed via IncomingTaskQueue. TBR all reviewers from https://chromiumcodereview.appspot.com/17567007/ because this is a re-land of it with a mechanical fix (adding a missing header). TBR=rsesek@chromium.org,darin@chromium.org,thakis@chromium.org,rvargas@chromium.org,dalecurtis@chromium.org BUG=241939 Review URL: https://codereview.chromium.org/19661004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@212987 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/message_loop/message_pump.h')
-rw-r--r--base/message_loop/message_pump.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/base/message_loop/message_pump.h b/base/message_loop/message_pump.h
index 5b72232..0ebba3a 100644
--- a/base/message_loop/message_pump.h
+++ b/base/message_loop/message_pump.h
@@ -6,13 +6,13 @@
#define BASE_MESSAGE_LOOP_MESSAGE_PUMP_H_
#include "base/base_export.h"
-#include "base/memory/ref_counted.h"
+#include "base/threading/non_thread_safe.h"
namespace base {
class TimeTicks;
-class BASE_EXPORT MessagePump : public RefCountedThreadSafe<MessagePump> {
+class BASE_EXPORT MessagePump : public NonThreadSafe {
public:
// Please see the comments above the Run method for an illustration of how
// these delegate methods are used.
@@ -42,6 +42,7 @@ class BASE_EXPORT MessagePump : public RefCountedThreadSafe<MessagePump> {
};
MessagePump();
+ virtual ~MessagePump();
// The Run method is called to enter the message pump's run loop.
//
@@ -118,10 +119,6 @@ class BASE_EXPORT MessagePump : public RefCountedThreadSafe<MessagePump> {
// cancelling any pending DoDelayedWork callback. This method may only be
// used on the thread that called Run.
virtual void ScheduleDelayedWork(const TimeTicks& delayed_work_time) = 0;
-
- protected:
- virtual ~MessagePump();
- friend class RefCountedThreadSafe<MessagePump>;
};
} // namespace base