summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-18 20:27:52 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-18 20:27:52 +0000
commit59e69e745ba3fa290ff3c50e65c3db03ee9dde6b (patch)
tree64b82fd1e2375845b59f278f2a1e892dcf54377b /base
parentbd41e70e44d19eb809eb8565b1d8479daef5d8f5 (diff)
downloadchromium_src-59e69e745ba3fa290ff3c50e65c3db03ee9dde6b.zip
chromium_src-59e69e745ba3fa290ff3c50e65c3db03ee9dde6b.tar.gz
chromium_src-59e69e745ba3fa290ff3c50e65c3db03ee9dde6b.tar.bz2
Move message_pump to base/message_loop.
This also fixes some namespace usage inside the message pump files and updates all users of these files to use the new location. Reland of 206507. Original review https://codereview.chromium.org/17078005/ TBR=sky Review URL: https://codereview.chromium.org/16897006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@207075 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/android/base_jni_registrar.cc2
-rw-r--r--base/base.gyp44
-rw-r--r--base/base.gypi36
-rw-r--r--base/mac/scoped_sending_event.h2
-rw-r--r--base/message_loop/message_loop.cc8
-rw-r--r--base/message_loop/message_loop.h164
-rw-r--r--base/message_loop/message_loop_unittest.cc12
-rw-r--r--base/message_loop/message_pump.cc (renamed from base/message_pump.cc)2
-rw-r--r--base/message_loop/message_pump.h (renamed from base/message_pump.h)6
-rw-r--r--base/message_loop/message_pump_android.cc (renamed from base/message_pump_android.cc)6
-rw-r--r--base/message_loop/message_pump_android.h (renamed from base/message_pump_android.h)10
-rw-r--r--base/message_loop/message_pump_aurax11.cc (renamed from base/message_pump_aurax11.cc)22
-rw-r--r--base/message_loop/message_pump_aurax11.h (renamed from base/message_pump_aurax11.h)19
-rw-r--r--base/message_loop/message_pump_default.cc (renamed from base/message_pump_default.cc)4
-rw-r--r--base/message_loop/message_pump_default.h (renamed from base/message_pump_default.h)10
-rw-r--r--base/message_loop/message_pump_dispatcher.h (renamed from base/message_pump_dispatcher.h)6
-rw-r--r--base/message_loop/message_pump_glib.cc (renamed from base/message_pump_glib.cc)17
-rw-r--r--base/message_loop/message_pump_glib.h (renamed from base/message_pump_glib.h)8
-rw-r--r--base/message_loop/message_pump_glib_unittest.cc (renamed from base/message_pump_glib_unittest.cc)132
-rw-r--r--base/message_loop/message_pump_gtk.cc (renamed from base/message_pump_gtk.cc)10
-rw-r--r--base/message_loop/message_pump_gtk.h (renamed from base/message_pump_gtk.h)8
-rw-r--r--base/message_loop/message_pump_io_ios.cc (renamed from base/message_pump_io_ios.cc)2
-rw-r--r--base/message_loop/message_pump_io_ios.h (renamed from base/message_pump_io_ios.h)8
-rw-r--r--base/message_loop/message_pump_io_ios_unittest.cc (renamed from base/message_pump_io_ios_unittest.cc)2
-rw-r--r--base/message_loop/message_pump_libevent.cc (renamed from base/message_pump_libevent.cc)12
-rw-r--r--base/message_loop/message_pump_libevent.h (renamed from base/message_pump_libevent.h)10
-rw-r--r--base/message_loop/message_pump_libevent_unittest.cc (renamed from base/message_pump_libevent_unittest.cc)4
-rw-r--r--base/message_loop/message_pump_mac.h (renamed from base/message_pump_mac.h)10
-rw-r--r--base/message_loop/message_pump_mac.mm (renamed from base/message_pump_mac.mm)4
-rw-r--r--base/message_loop/message_pump_observer.h (renamed from base/message_pump_observer.h)6
-rw-r--r--base/message_loop/message_pump_ozone.cc (renamed from base/message_pump_ozone.cc)4
-rw-r--r--base/message_loop/message_pump_ozone.h (renamed from base/message_pump_ozone.h)14
-rw-r--r--base/message_loop/message_pump_win.cc (renamed from base/message_pump_win.cc)14
-rw-r--r--base/message_loop/message_pump_win.h (renamed from base/message_pump_win.h)12
-rw-r--r--base/test/mock_chrome_application_mac.h2
-rw-r--r--base/test/test_support_android.cc4
-rw-r--r--base/test/test_support_ios.mm4
-rw-r--r--base/win/text_services_message_filter.h2
38 files changed, 316 insertions, 326 deletions
diff --git a/base/android/base_jni_registrar.cc b/base/android/base_jni_registrar.cc
index 468e297..36d638b 100644
--- a/base/android/base_jni_registrar.cc
+++ b/base/android/base_jni_registrar.cc
@@ -16,7 +16,7 @@
#include "base/android/thread_utils.h"
#include "base/basictypes.h"
#include "base/debug/trace_event.h"
-#include "base/message_pump_android.h"
+#include "base/message_loop/message_pump_android.h"
#include "base/power_monitor/power_monitor_android.h"
#if defined(GOOGLE_TV)
diff --git a/base/base.gyp b/base/base.gyp
index 3f59bb3..aaead7d 100644
--- a/base/base.gyp
+++ b/base/base.gyp
@@ -247,21 +247,21 @@
'linux_util.h',
'md5.cc',
'md5.h',
- 'message_pump_android.cc',
- 'message_pump_android.h',
- 'message_pump_glib.cc',
- 'message_pump_glib.h',
- 'message_pump_gtk.cc',
- 'message_pump_gtk.h',
- 'message_pump_io_ios.cc',
- 'message_pump_io_ios.h',
- 'message_pump_observer.h',
- 'message_pump_aurax11.cc',
- 'message_pump_aurax11.h',
- 'message_pump_libevent.cc',
- 'message_pump_libevent.h',
- 'message_pump_mac.h',
- 'message_pump_mac.mm',
+ 'message_loop/message_pump_android.cc',
+ 'message_loop/message_pump_android.h',
+ 'message_loop/message_pump_glib.cc',
+ 'message_loop/message_pump_glib.h',
+ 'message_loop/message_pump_gtk.cc',
+ 'message_loop/message_pump_gtk.h',
+ 'message_loop/message_pump_io_ios.cc',
+ 'message_loop/message_pump_io_ios.h',
+ 'message_loop/message_pump_observer.h',
+ 'message_loop/message_pump_aurax11.cc',
+ 'message_loop/message_pump_aurax11.h',
+ 'message_loop/message_pump_libevent.cc',
+ 'message_loop/message_pump_libevent.h',
+ 'message_loop/message_pump_mac.h',
+ 'message_loop/message_pump_mac.mm',
'metrics/field_trial.cc',
'metrics/field_trial.h',
'posix/file_descriptor_shuffle.cc',
@@ -526,9 +526,9 @@
'message_loop/message_loop_proxy_impl_unittest.cc',
'message_loop/message_loop_proxy_unittest.cc',
'message_loop/message_loop_unittest.cc',
- 'message_pump_glib_unittest.cc',
- 'message_pump_io_ios_unittest.cc',
- 'message_pump_libevent_unittest.cc',
+ 'message_loop/message_pump_glib_unittest.cc',
+ 'message_loop/message_pump_io_ios_unittest.cc',
+ 'message_loop/message_pump_libevent_unittest.cc',
'metrics/sample_map_unittest.cc',
'metrics/sample_vector_unittest.cc',
'metrics/bucket_ranges_unittest.cc',
@@ -685,7 +685,7 @@
# Requires spawning processes.
['exclude', '^metrics/stats_table_unittest\\.cc$'],
# iOS does not use message_pump_libevent.
- ['exclude', '^message_pump_libevent_unittest\\.cc$'],
+ ['exclude', '^message_loop/message_pump_libevent_unittest\\.cc$'],
],
'conditions': [
['coverage != 0', {
@@ -747,12 +747,12 @@
],
}, { # use_glib!=1
'sources!': [
- 'message_pump_glib_unittest.cc',
+ 'message_loop/message_pump_glib_unittest.cc',
]
}],
['use_ozone == 1', {
'sources!': [
- 'message_pump_glib_unittest.cc',
+ 'message_loop/message_pump_glib_unittest.cc',
]
}],
['OS == "win"', {
@@ -765,7 +765,7 @@
'file_descriptor_shuffle_unittest.cc',
'files/dir_reader_posix_unittest.cc',
'threading/worker_pool_posix_unittest.cc',
- 'message_pump_libevent_unittest.cc',
+ 'message_loop/message_pump_libevent_unittest.cc',
],
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
'msvs_disabled_warnings': [
diff --git a/base/base.gypi b/base/base.gypi
index 180f6873..7a5879b 100644
--- a/base/base.gypi
+++ b/base/base.gypi
@@ -303,16 +303,16 @@
'message_loop/message_loop_proxy.h',
'message_loop/message_loop_proxy_impl.cc',
'message_loop/message_loop_proxy_impl.h',
- 'message_pump.cc',
- 'message_pump.h',
- 'message_pump_android.cc',
- 'message_pump_android.h',
- 'message_pump_default.cc',
- 'message_pump_default.h',
- 'message_pump_ozone.cc',
- 'message_pump_ozone.h',
- 'message_pump_win.cc',
- 'message_pump_win.h',
+ 'message_loop/message_pump.cc',
+ 'message_loop/message_pump.h',
+ 'message_loop/message_pump_android.cc',
+ 'message_loop/message_pump_android.h',
+ 'message_loop/message_pump_default.cc',
+ 'message_loop/message_pump_default.h',
+ 'message_loop/message_pump_ozone.cc',
+ 'message_loop/message_pump_ozone.h',
+ 'message_loop/message_pump_win.cc',
+ 'message_loop/message_pump_win.h',
'metrics/sample_map.cc',
'metrics/sample_map.h',
'metrics/sample_vector.cc',
@@ -652,12 +652,12 @@
],
'sources!': [
'atomicops_internals_x86_gcc.cc',
- 'message_pump_glib.cc',
- 'message_pump_aurax11.cc',
+ 'message_loop/message_pump_glib.cc',
+ 'message_loop/message_pump_aurax11.cc',
],
}],
['<(toolkit_uses_gtk)==0 or >(nacl_untrusted_build)==1', {
- 'sources!': ['message_pump_gtk.cc'],
+ 'sources!': ['message_loop/message_pump_gtk.cc'],
}],
['(OS != "linux" and <(os_bsd) != 1 and OS != "android") or >(nacl_untrusted_build)==1', {
'sources!': [
@@ -740,7 +740,7 @@
['include', '^mac/scoped_mach_port\\.'],
['include', '^mac/scoped_nsautorelease_pool\\.'],
['include', '^memory/discardable_memory_mac\\.'],
- ['include', '^message_pump_mac\\.'],
+ ['include', '^message_loop/message_pump_mac\\.'],
['include', '^threading/platform_thread_mac\\.'],
['include', '^strings/sys_string_conversions_mac\\.'],
['include', '^time_mac\\.'],
@@ -751,7 +751,7 @@
['include', '^process_util_ios\\.mm$'],
],
'sources!': [
- 'message_pump_libevent.cc'
+ 'message_loop/message_pump_libevent.cc'
],
}],
['OS == "ios" and _toolset == "host"', {
@@ -794,7 +794,7 @@
'event_recorder_stubs.cc',
'files/file_path_watcher_kqueue.cc',
'files/file_path_watcher_stub.cc',
- 'message_pump_libevent.cc',
+ 'message_loop/message_pump_libevent.cc',
'posix/file_descriptor_shuffle.cc',
# Not using sha1_win.cc because it may have caused a
# regression to page cycler moz.
@@ -804,8 +804,8 @@
},],
['<(use_ozone) == 1', {
'sources!': [
- 'message_pump_glib.cc',
- 'message_pump_aurax11.cc',
+ 'message_loop/message_pump_glib.cc',
+ 'message_loop/message_pump_aurax11.cc',
]
}],
['OS == "linux" and >(nacl_untrusted_build)==0', {
diff --git a/base/mac/scoped_sending_event.h b/base/mac/scoped_sending_event.h
index f7637bb..62bb31f 100644
--- a/base/mac/scoped_sending_event.h
+++ b/base/mac/scoped_sending_event.h
@@ -8,7 +8,7 @@
#include "base/base_export.h"
#include "base/basictypes.h"
#include "base/memory/scoped_nsobject.h"
-#include "base/message_pump_mac.h"
+#include "base/message_loop/message_pump_mac.h"
// Nested event loops can pump IPC messages, including
// script-initiated tab closes, which could release objects that the
diff --git a/base/message_loop/message_loop.cc b/base/message_loop/message_loop.cc
index 0364a52..4e0c5f6 100644
--- a/base/message_loop/message_loop.cc
+++ b/base/message_loop/message_loop.cc
@@ -14,7 +14,7 @@
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop_proxy_impl.h"
-#include "base/message_pump_default.h"
+#include "base/message_loop/message_pump_default.h"
#include "base/metrics/histogram.h"
#include "base/metrics/statistics_recorder.h"
#include "base/run_loop.h"
@@ -25,13 +25,13 @@
#include "base/tracked_objects.h"
#if defined(OS_MACOSX)
-#include "base/message_pump_mac.h"
+#include "base/message_loop/message_pump_mac.h"
#endif
#if defined(OS_POSIX) && !defined(OS_IOS)
-#include "base/message_pump_libevent.h"
+#include "base/message_loop/message_pump_libevent.h"
#endif
#if defined(OS_ANDROID)
-#include "base/message_pump_android.h"
+#include "base/message_loop/message_pump_android.h"
#endif
#if defined(TOOLKIT_GTK)
diff --git a/base/message_loop/message_loop.h b/base/message_loop/message_loop.h
index d26b673..e765cef 100644
--- a/base/message_loop/message_loop.h
+++ b/base/message_loop/message_loop.h
@@ -14,7 +14,7 @@
#include "base/location.h"
#include "base/memory/ref_counted.h"
#include "base/message_loop/message_loop_proxy.h"
-#include "base/message_pump.h"
+#include "base/message_loop/message_pump.h"
#include "base/observer_list.h"
#include "base/pending_task.h"
#include "base/sequenced_task_runner_helpers.h"
@@ -25,25 +25,26 @@
#if defined(OS_WIN)
// We need this to declare base::MessagePumpWin::Dispatcher, which we should
// really just eliminate.
-#include "base/message_pump_win.h"
+#include "base/message_loop/message_pump_win.h"
#elif defined(OS_IOS)
-#include "base/message_pump_io_ios.h"
+#include "base/message_loop/message_pump_io_ios.h"
#elif defined(OS_POSIX)
-#include "base/message_pump_libevent.h"
+#include "base/message_loop/message_pump_libevent.h"
#if !defined(OS_MACOSX) && !defined(OS_ANDROID)
#if defined(USE_AURA) && defined(USE_X11) && !defined(OS_NACL)
-#include "base/message_pump_aurax11.h"
+#include "base/message_loop/message_pump_aurax11.h"
#elif defined(USE_OZONE) && !defined(OS_NACL)
-#include "base/message_pump_ozone.h"
+#include "base/message_loop/message_pump_ozone.h"
#else
-#include "base/message_pump_gtk.h"
+#include "base/message_loop/message_pump_gtk.h"
#endif
#endif
#endif
namespace base {
+
class HistogramBase;
class MessageLoopLockTest;
class RunLoop;
@@ -83,12 +84,12 @@ class MessagePumpForUI;
// Please be SURE your task is reentrant (nestable) and all global variables
// are stable and accessible before calling SetNestableTasksAllowed(true).
//
-class BASE_EXPORT MessageLoop : public base::MessagePump::Delegate {
+class BASE_EXPORT MessageLoop : public MessagePump::Delegate {
public:
#if !defined(OS_MACOSX) && !defined(OS_ANDROID)
- typedef base::MessagePumpDispatcher Dispatcher;
- typedef base::MessagePumpObserver Observer;
+ typedef MessagePumpDispatcher Dispatcher;
+ typedef MessagePumpObserver Observer;
#endif
// A MessageLoop has a particular type, which indicates the set of
@@ -121,7 +122,7 @@ class BASE_EXPORT MessageLoop : public base::MessagePump::Delegate {
static void EnableHistogrammer(bool enable_histogrammer);
- typedef base::MessagePump* (MessagePumpFactory)();
+ typedef MessagePump* (MessagePumpFactory)();
// Uses the given base::MessagePumpForUIFactory to override the default
// MessagePump implementation for 'TYPE_UI'. Returns true if the factory
// was successfully registered.
@@ -174,27 +175,22 @@ class BASE_EXPORT MessageLoop : public base::MessagePump::Delegate {
//
// NOTE: These methods may be called on any thread. The Task will be invoked
// on the thread that executes MessageLoop::Run().
- void PostTask(
- const tracked_objects::Location& from_here,
- const base::Closure& task);
+ void PostTask(const tracked_objects::Location& from_here,
+ const Closure& task);
- bool TryPostTask(
- const tracked_objects::Location& from_here,
- const base::Closure& task);
+ bool TryPostTask(const tracked_objects::Location& from_here,
+ const Closure& task);
- void PostDelayedTask(
- const tracked_objects::Location& from_here,
- const base::Closure& task,
- base::TimeDelta delay);
+ void PostDelayedTask(const tracked_objects::Location& from_here,
+ const Closure& task,
+ TimeDelta delay);
- void PostNonNestableTask(
- const tracked_objects::Location& from_here,
- const base::Closure& task);
+ void PostNonNestableTask(const tracked_objects::Location& from_here,
+ const Closure& task);
- void PostNonNestableDelayedTask(
- const tracked_objects::Location& from_here,
- const base::Closure& task,
- base::TimeDelta delay);
+ void PostNonNestableDelayedTask(const tracked_objects::Location& from_here,
+ const Closure& task,
+ TimeDelta delay);
// A variant on PostTask that deletes the given object. This is useful
// if the object needs to live until the next run of the MessageLoop (for
@@ -264,12 +260,12 @@ class BASE_EXPORT MessageLoop : public base::MessagePump::Delegate {
void QuitNow();
// TODO(jbates) remove this. crbug.com/131220. See QuitWhenIdleClosure().
- static base::Closure QuitClosure() { return QuitWhenIdleClosure(); }
+ static Closure QuitClosure() { return QuitWhenIdleClosure(); }
// Deprecated: use RunLoop instead.
// Construct a Closure that will call QuitWhenIdle(). Useful to schedule an
// arbitrary MessageLoop to QuitWhenIdle.
- static base::Closure QuitWhenIdleClosure();
+ static Closure QuitWhenIdleClosure();
// Returns true if this loop is |type|. This allows subclasses (especially
// those in tests) to specialize how they are identified.
@@ -286,7 +282,7 @@ class BASE_EXPORT MessageLoop : public base::MessagePump::Delegate {
const std::string& thread_name() const { return thread_name_; }
// Gets the message loop proxy associated with this message loop.
- scoped_refptr<base::MessageLoopProxy> message_loop_proxy() {
+ scoped_refptr<MessageLoopProxy> message_loop_proxy() {
return message_loop_proxy_.get();
}
@@ -349,10 +345,10 @@ class BASE_EXPORT MessageLoop : public base::MessagePump::Delegate {
TaskObserver();
// This method is called before processing a task.
- virtual void WillProcessTask(const base::PendingTask& pending_task) = 0;
+ virtual void WillProcessTask(const PendingTask& pending_task) = 0;
// This method is called after processing a task.
- virtual void DidProcessTask(const base::PendingTask& pending_task) = 0;
+ virtual void DidProcessTask(const PendingTask& pending_task) = 0;
protected:
virtual ~TaskObserver();
@@ -397,20 +393,20 @@ class BASE_EXPORT MessageLoop : public base::MessagePump::Delegate {
protected:
#if defined(OS_WIN)
- base::MessagePumpWin* pump_win() {
- return static_cast<base::MessagePumpWin*>(pump_.get());
+ MessagePumpWin* pump_win() {
+ return static_cast<MessagePumpWin*>(pump_.get());
}
#elif defined(OS_POSIX) && !defined(OS_IOS)
- base::MessagePumpLibevent* pump_libevent() {
- return static_cast<base::MessagePumpLibevent*>(pump_.get());
+ MessagePumpLibevent* pump_libevent() {
+ return static_cast<MessagePumpLibevent*>(pump_.get());
}
#endif
- scoped_refptr<base::MessagePump> pump_;
+ scoped_refptr<MessagePump> pump_;
private:
- friend class base::RunLoop;
- friend class base::MessageLoopLockTest;
+ friend class RunLoop;
+ friend class MessageLoopLockTest;
// A function to encapsulate all the exception handling capability in the
// stacks around the running of a main message loop. It will run the message
@@ -431,14 +427,14 @@ class BASE_EXPORT MessageLoop : public base::MessagePump::Delegate {
bool ProcessNextDelayedNonNestableTask();
// Runs the specified PendingTask.
- void RunTask(const base::PendingTask& pending_task);
+ void RunTask(const PendingTask& pending_task);
// Calls RunTask or queues the pending_task on the deferred task list if it
// cannot be run right now. Returns true if the task was run.
- bool DeferOrRunPendingTask(const base::PendingTask& pending_task);
+ bool DeferOrRunPendingTask(const PendingTask& pending_task);
// Adds the pending task to delayed_work_queue_.
- void AddToDelayedWorkQueue(const base::PendingTask& pending_task);
+ void AddToDelayedWorkQueue(const PendingTask& pending_task);
// This function attempts to add pending task to our incoming_queue_.
// The append can only possibly fail when |use_try_lock| is true.
@@ -454,7 +450,7 @@ class BASE_EXPORT MessageLoop : public base::MessagePump::Delegate {
// function will reset the value of pending_task->task. This is needed to
// ensure that the posting call stack does not retain pending_task->task
// beyond this function call.
- bool AddToIncomingQueue(base::PendingTask* pending_task, bool use_try_lock);
+ bool AddToIncomingQueue(PendingTask* pending_task, bool use_try_lock);
// Load tasks from the incoming_queue_ into work_queue_ if the latter is
// empty. The former requires a lock to access, while the latter is directly
@@ -467,7 +463,7 @@ class BASE_EXPORT MessageLoop : public base::MessagePump::Delegate {
bool DeletePendingTasks();
// Calculates the time at which a PendingTask should run.
- base::TimeTicks CalculateDelayedRuntime(base::TimeDelta delay);
+ TimeTicks CalculateDelayedRuntime(TimeDelta delay);
// Start recording histogram info about events and action IF it was enabled
// and IF the statistics recorder can accept a registration of our histogram.
@@ -478,27 +474,27 @@ class BASE_EXPORT MessageLoop : public base::MessagePump::Delegate {
// If message_histogram_ is NULL, this is a no-op.
void HistogramEvent(int event);
- // base::MessagePump::Delegate methods:
+ // MessagePump::Delegate methods:
virtual bool DoWork() OVERRIDE;
- virtual bool DoDelayedWork(base::TimeTicks* next_delayed_work_time) OVERRIDE;
+ virtual bool DoDelayedWork(TimeTicks* next_delayed_work_time) OVERRIDE;
virtual bool DoIdleWork() OVERRIDE;
Type type_;
// A list of tasks that need to be processed by this instance. Note that
// this queue is only accessed (push/pop) by our current thread.
- base::TaskQueue work_queue_;
+ TaskQueue work_queue_;
// Contains delayed tasks, sorted by their 'delayed_run_time' property.
- base::DelayedTaskQueue delayed_work_queue_;
+ DelayedTaskQueue delayed_work_queue_;
// A recent snapshot of Time::Now(), used to check delayed_work_queue_.
- base::TimeTicks recent_time_;
+ TimeTicks recent_time_;
// A queue of non-nestable tasks that we had to defer because when it came
// time to execute them we were in a nested message loop. They will execute
// once we're out of nested message loops.
- base::TaskQueue deferred_non_nestable_work_queue_;
+ TaskQueue deferred_non_nestable_work_queue_;
ObserverList<DestructionObserver> destruction_observers_;
@@ -510,19 +506,19 @@ class BASE_EXPORT MessageLoop : public base::MessagePump::Delegate {
std::string thread_name_;
// A profiling histogram showing the counts of various messages and events.
- base::HistogramBase* message_histogram_;
+ HistogramBase* message_histogram_;
// An incoming queue of tasks that are acquired under a mutex for processing
// on this instance's thread. These tasks have not yet been sorted out into
// items for our work_queue_ vs delayed_work_queue_.
- base::TaskQueue incoming_queue_;
+ TaskQueue incoming_queue_;
// Protect access to incoming_queue_.
- mutable base::Lock incoming_queue_lock_;
+ mutable Lock incoming_queue_lock_;
- base::RunLoop* run_loop_;
+ RunLoop* run_loop_;
#if defined(OS_WIN)
- base::TimeTicks high_resolution_timer_expiration_;
+ TimeTicks high_resolution_timer_expiration_;
// Should be set to true before calling Windows APIs like TrackPopupMenu, etc
// which enter a modal message loop.
bool os_modal_loop_;
@@ -535,8 +531,8 @@ class BASE_EXPORT MessageLoop : public base::MessagePump::Delegate {
ObserverList<TaskObserver> task_observers_;
// The message loop proxy associated with this message loop, if one exists.
- scoped_refptr<base::MessageLoopProxy> message_loop_proxy_;
- scoped_ptr<base::ThreadTaskRunnerHandle> thread_task_runner_handle_;
+ scoped_refptr<MessageLoopProxy> message_loop_proxy_;
+ scoped_ptr<ThreadTaskRunnerHandle> thread_task_runner_handle_;
template <class T, class R> friend class base::subtle::DeleteHelperInternal;
template <class T, class R> friend class base::subtle::ReleaseHelperInternal;
@@ -561,7 +557,7 @@ class BASE_EXPORT MessageLoop : public base::MessagePump::Delegate {
class BASE_EXPORT MessageLoopForUI : public MessageLoop {
public:
#if defined(OS_WIN)
- typedef base::MessagePumpForUI::MessageFilter MessageFilter;
+ typedef MessagePumpForUI::MessageFilter MessageFilter;
#endif
MessageLoopForUI() : MessageLoop(TYPE_UI) {
@@ -607,15 +603,15 @@ class BASE_EXPORT MessageLoopForUI : public MessageLoop {
protected:
#if defined(USE_AURA) && defined(USE_X11) && !defined(OS_NACL)
- friend class base::MessagePumpAuraX11;
+ friend class MessagePumpAuraX11;
#endif
#if defined(USE_OZONE) && !defined(OS_NACL)
- friend class base::MessagePumpOzone;
+ friend class MessagePumpOzone;
#endif
// TODO(rvargas): Make this platform independent.
- base::MessagePumpForUI* pump_ui() {
- return static_cast<base::MessagePumpForUI*>(pump_.get());
+ MessagePumpForUI* pump_ui() {
+ return static_cast<MessagePumpForUI*>(pump_.get());
}
#endif // !defined(OS_MACOSX)
};
@@ -636,30 +632,30 @@ COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForUI),
class BASE_EXPORT MessageLoopForIO : public MessageLoop {
public:
#if defined(OS_WIN)
- typedef base::MessagePumpForIO::IOHandler IOHandler;
- typedef base::MessagePumpForIO::IOContext IOContext;
- typedef base::MessagePumpForIO::IOObserver IOObserver;
+ typedef MessagePumpForIO::IOHandler IOHandler;
+ typedef MessagePumpForIO::IOContext IOContext;
+ typedef MessagePumpForIO::IOObserver IOObserver;
#elif defined(OS_IOS)
- typedef base::MessagePumpIOSForIO::Watcher Watcher;
- typedef base::MessagePumpIOSForIO::FileDescriptorWatcher
+ typedef MessagePumpIOSForIO::Watcher Watcher;
+ typedef MessagePumpIOSForIO::FileDescriptorWatcher
FileDescriptorWatcher;
- typedef base::MessagePumpIOSForIO::IOObserver IOObserver;
+ typedef MessagePumpIOSForIO::IOObserver IOObserver;
enum Mode {
- WATCH_READ = base::MessagePumpIOSForIO::WATCH_READ,
- WATCH_WRITE = base::MessagePumpIOSForIO::WATCH_WRITE,
- WATCH_READ_WRITE = base::MessagePumpIOSForIO::WATCH_READ_WRITE
+ WATCH_READ = MessagePumpIOSForIO::WATCH_READ,
+ WATCH_WRITE = MessagePumpIOSForIO::WATCH_WRITE,
+ WATCH_READ_WRITE = MessagePumpIOSForIO::WATCH_READ_WRITE
};
#elif defined(OS_POSIX)
- typedef base::MessagePumpLibevent::Watcher Watcher;
- typedef base::MessagePumpLibevent::FileDescriptorWatcher
+ typedef MessagePumpLibevent::Watcher Watcher;
+ typedef MessagePumpLibevent::FileDescriptorWatcher
FileDescriptorWatcher;
- typedef base::MessagePumpLibevent::IOObserver IOObserver;
+ typedef MessagePumpLibevent::IOObserver IOObserver;
enum Mode {
- WATCH_READ = base::MessagePumpLibevent::WATCH_READ,
- WATCH_WRITE = base::MessagePumpLibevent::WATCH_WRITE,
- WATCH_READ_WRITE = base::MessagePumpLibevent::WATCH_READ_WRITE
+ WATCH_READ = MessagePumpLibevent::WATCH_READ,
+ WATCH_WRITE = MessagePumpLibevent::WATCH_WRITE,
+ WATCH_READ_WRITE = MessagePumpLibevent::WATCH_READ_WRITE
};
#endif
@@ -690,8 +686,8 @@ class BASE_EXPORT MessageLoopForIO : public MessageLoop {
protected:
// TODO(rvargas): Make this platform independent.
- base::MessagePumpForIO* pump_io() {
- return static_cast<base::MessagePumpForIO*>(pump_.get());
+ MessagePumpForIO* pump_io() {
+ return static_cast<MessagePumpForIO*>(pump_.get());
}
#elif defined(OS_IOS)
@@ -703,8 +699,8 @@ class BASE_EXPORT MessageLoopForIO : public MessageLoop {
Watcher *delegate);
private:
- base::MessagePumpIOSForIO* pump_io() {
- return static_cast<base::MessagePumpIOSForIO*>(pump_.get());
+ MessagePumpIOSForIO* pump_io() {
+ return static_cast<MessagePumpIOSForIO*>(pump_.get());
}
#elif defined(OS_POSIX)
@@ -716,8 +712,8 @@ class BASE_EXPORT MessageLoopForIO : public MessageLoop {
Watcher* delegate);
private:
- base::MessagePumpLibevent* pump_io() {
- return static_cast<base::MessagePumpLibevent*>(pump_.get());
+ MessagePumpLibevent* pump_io() {
+ return static_cast<MessagePumpLibevent*>(pump_.get());
}
#endif // defined(OS_POSIX)
};
diff --git a/base/message_loop/message_loop_unittest.cc b/base/message_loop/message_loop_unittest.cc
index 0f85b14..504c8e3 100644
--- a/base/message_loop/message_loop_unittest.cc
+++ b/base/message_loop/message_loop_unittest.cc
@@ -9,7 +9,7 @@
#include "base/compiler_specific.h"
#include "base/logging.h"
#include "base/memory/ref_counted.h"
-#include "base/message_loop.h"
+#include "base/message_loop/message_loop.h"
#include "base/pending_task.h"
#include "base/posix/eintr_wrapper.h"
#include "base/run_loop.h"
@@ -20,7 +20,7 @@
#include "testing/gtest/include/gtest/gtest.h"
#if defined(OS_WIN)
-#include "base/message_pump_win.h"
+#include "base/message_loop/message_pump_win.h"
#include "base/win/scoped_handle.h"
#endif
@@ -29,8 +29,8 @@ namespace base {
class MessageLoopLockTest {
public:
static void LockWaitUnLock(MessageLoop* loop,
- base::WaitableEvent* caller_wait,
- base::WaitableEvent* caller_signal) {
+ WaitableEvent* caller_wait,
+ WaitableEvent* caller_signal) {
loop->incoming_queue_lock_.Acquire();
caller_wait->Signal();
@@ -121,7 +121,7 @@ void RunTest_PostTask(MessageLoop::Type message_loop_type) {
thread.Start();
thread.message_loop()->PostTask(
FROM_HERE,
- base::Bind(&MessageLoopLockTest::LockWaitUnLock,
+ Bind(&MessageLoopLockTest::LockWaitUnLock,
MessageLoop::current(),
&wait,
&signal));
@@ -1419,7 +1419,7 @@ void RunTest_RecursivePosts(MessageLoop::Type message_loop_type,
#if defined(OS_WIN)
-class DispatcherImpl : public base::MessageLoopForUI::Dispatcher {
+class DispatcherImpl : public MessageLoopForUI::Dispatcher {
public:
DispatcherImpl() : dispatch_count_(0) {}
diff --git a/base/message_pump.cc b/base/message_loop/message_pump.cc
index de7c517..7ffc2b1 100644
--- a/base/message_pump.cc
+++ b/base/message_loop/message_pump.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/message_pump.h"
+#include "base/message_loop/message_pump.h"
namespace base {
diff --git a/base/message_pump.h b/base/message_loop/message_pump.h
index b2e0a42..5b72232 100644
--- a/base/message_pump.h
+++ b/base/message_loop/message_pump.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef BASE_MESSAGE_PUMP_H_
-#define BASE_MESSAGE_PUMP_H_
+#ifndef BASE_MESSAGE_LOOP_MESSAGE_PUMP_H_
+#define BASE_MESSAGE_LOOP_MESSAGE_PUMP_H_
#include "base/base_export.h"
#include "base/memory/ref_counted.h"
@@ -126,4 +126,4 @@ class BASE_EXPORT MessagePump : public RefCountedThreadSafe<MessagePump> {
} // namespace base
-#endif // BASE_MESSAGE_PUMP_H_
+#endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_H_
diff --git a/base/message_pump_android.cc b/base/message_loop/message_pump_android.cc
index f02da67e..d7bf9a9 100644
--- a/base/message_pump_android.cc
+++ b/base/message_loop/message_pump_android.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/message_pump_android.h"
+#include "base/message_loop/message_pump_android.h"
#include <jni.h>
@@ -75,7 +75,7 @@ void MessagePumpForUI::Run(Delegate* delegate) {
}
void MessagePumpForUI::Start(Delegate* delegate) {
- run_loop_ = new base::RunLoop();
+ run_loop_ = new RunLoop();
// Since the RunLoop was just created above, BeforeRun should be guaranteed to
// return true (it only returns false if the RunLoop has been Quit already).
if (!run_loop_->BeforeRun())
@@ -124,7 +124,7 @@ void MessagePumpForUI::ScheduleDelayedWork(const TimeTicks& delayed_work_time) {
DCHECK(env);
jlong millis =
- (delayed_work_time - base::TimeTicks::Now()).InMillisecondsRoundedUp();
+ (delayed_work_time - TimeTicks::Now()).InMillisecondsRoundedUp();
// Note that we're truncating to milliseconds as required by the java side,
// even though delayed_work_time is microseconds resolution.
Java_SystemMessageHandler_setDelayedTimer(env,
diff --git a/base/message_pump_android.h b/base/message_loop/message_pump_android.h
index 5ef4bd6..fd934a7 100644
--- a/base/message_pump_android.h
+++ b/base/message_loop/message_pump_android.h
@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef BASE_MESSAGE_PUMP_ANDROID_H_
-#define BASE_MESSAGE_PUMP_ANDROID_H_
+#ifndef BASE_MESSAGE_LOOP_MESSAGE_PUMP_ANDROID_H_
+#define BASE_MESSAGE_LOOP_MESSAGE_PUMP_ANDROID_H_
#include <jni.h>
#include "base/base_export.h"
#include "base/compiler_specific.h"
-#include "base/message_pump.h"
+#include "base/message_loop/message_pump.h"
namespace base {
@@ -35,11 +35,11 @@ class BASE_EXPORT MessagePumpForUI : public MessagePump {
virtual ~MessagePumpForUI();
private:
- base::RunLoop* run_loop_;
+ RunLoop* run_loop_;
DISALLOW_COPY_AND_ASSIGN(MessagePumpForUI);
};
} // namespace base
-#endif // BASE_MESSAGE_PUMP_ANDROID_H_
+#endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_ANDROID_H_
diff --git a/base/message_pump_aurax11.cc b/base/message_loop/message_pump_aurax11.cc
index 9ba7989..70cae64 100644
--- a/base/message_pump_aurax11.cc
+++ b/base/message_loop/message_pump_aurax11.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/message_pump_aurax11.h"
+#include "base/message_loop/message_pump_aurax11.h"
#include <glib.h>
#include <X11/X.h>
@@ -12,10 +12,12 @@
#include "base/basictypes.h"
#include "base/message_loop.h"
+namespace base {
+
namespace {
gboolean XSourcePrepare(GSource* source, gint* timeout_ms) {
- if (XPending(base::MessagePumpAuraX11::GetDefaultXDisplay()))
+ if (XPending(MessagePumpAuraX11::GetDefaultXDisplay()))
*timeout_ms = 0;
else
*timeout_ms = -1;
@@ -23,13 +25,13 @@ gboolean XSourcePrepare(GSource* source, gint* timeout_ms) {
}
gboolean XSourceCheck(GSource* source) {
- return XPending(base::MessagePumpAuraX11::GetDefaultXDisplay());
+ return XPending(MessagePumpAuraX11::GetDefaultXDisplay());
}
gboolean XSourceDispatch(GSource* source,
GSourceFunc unused_func,
gpointer data) {
- base::MessagePumpAuraX11* pump = static_cast<base::MessagePumpAuraX11*>(data);
+ MessagePumpAuraX11* pump = static_cast<MessagePumpAuraX11*>(data);
return pump->DispatchXEvents();
}
@@ -52,7 +54,7 @@ Display* g_xdisplay = NULL;
int g_xinput_opcode = -1;
bool InitializeXInput2Internal() {
- Display* display = base::MessagePumpAuraX11::GetDefaultXDisplay();
+ Display* display = MessagePumpAuraX11::GetDefaultXDisplay();
if (!display)
return false;
@@ -86,7 +88,7 @@ bool InitializeXInput2Internal() {
return true;
}
-Window FindEventTarget(const base::NativeEvent& xev) {
+Window FindEventTarget(const NativeEvent& xev) {
Window target = xev->xany.window;
if (xev->type == GenericEvent &&
static_cast<XIEvent*>(xev->xcookie.data)->extension == g_xinput_opcode) {
@@ -101,7 +103,7 @@ bool InitializeXInput2() {
}
bool InitializeXkb() {
- Display* display = base::MessagePumpAuraX11::GetDefaultXDisplay();
+ Display* display = MessagePumpAuraX11::GetDefaultXDisplay();
if (!display)
return false;
@@ -126,8 +128,6 @@ bool InitializeXkb() {
} // namespace
-namespace base {
-
MessagePumpAuraX11::MessagePumpAuraX11() : MessagePumpGlib(),
x_source_(NULL) {
InitializeXInput2();
@@ -277,13 +277,13 @@ void MessagePumpAuraX11::DidProcessXEvent(XEvent* xevent) {
}
MessagePumpDispatcher* MessagePumpAuraX11::GetDispatcherForXEvent(
- const base::NativeEvent& xev) const {
+ const NativeEvent& xev) const {
::Window x_window = FindEventTarget(xev);
DispatchersMap::const_iterator it = dispatchers_.find(x_window);
return it != dispatchers_.end() ? it->second : NULL;
}
-bool MessagePumpAuraX11::Dispatch(const base::NativeEvent& xev) {
+bool MessagePumpAuraX11::Dispatch(const NativeEvent& xev) {
// MappingNotify events (meaning that the keyboard or pointer buttons have
// been remapped) aren't associated with a window; send them to all
// dispatchers.
diff --git a/base/message_pump_aurax11.h b/base/message_loop/message_pump_aurax11.h
index 486de4f..cec6934 100644
--- a/base/message_pump_aurax11.h
+++ b/base/message_loop/message_pump_aurax11.h
@@ -2,17 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef BASE_MESSAGE_PUMP_AURAX11_H
-#define BASE_MESSAGE_PUMP_AURAX11_H
+#ifndef BASE_MESSAGE_LOOP_MESSAGE_PUMP_AURAX11_H
+#define BASE_MESSAGE_LOOP_MESSAGE_PUMP_AURAX11_H
#include <bitset>
#include <map>
#include "base/memory/scoped_ptr.h"
-#include "base/message_pump.h"
-#include "base/message_pump_glib.h"
-#include "base/message_pump_dispatcher.h"
-#include "base/message_pump_observer.h"
+#include "base/message_loop/message_pump.h"
+#include "base/message_loop/message_pump_dispatcher.h"
+#include "base/message_loop/message_pump_glib.h"
+#include "base/message_loop/message_pump_observer.h"
#include "base/observer_list.h"
// It would be nice to include the X11 headers here so that we use Window
@@ -92,11 +92,10 @@ class BASE_EXPORT MessagePumpAuraX11 : public MessagePumpGlib,
void DidProcessXEvent(XEvent* xevent);
// Returns the Dispatcher based on the event's target window.
- MessagePumpDispatcher* GetDispatcherForXEvent(
- const base::NativeEvent& xev) const;
+ MessagePumpDispatcher* GetDispatcherForXEvent(const NativeEvent& xev) const;
// Overridden from MessagePumpDispatcher:
- virtual bool Dispatch(const base::NativeEvent& event) OVERRIDE;
+ virtual bool Dispatch(const NativeEvent& event) OVERRIDE;
// The event source for X events.
GSource* x_source_;
@@ -120,4 +119,4 @@ typedef MessagePumpAuraX11 MessagePumpForUI;
} // namespace base
-#endif // BASE_MESSAGE_PUMP_AURAX11_H
+#endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_AURAX11_H
diff --git a/base/message_pump_default.cc b/base/message_loop/message_pump_default.cc
index 649e2aa..b36ff21 100644
--- a/base/message_pump_default.cc
+++ b/base/message_loop/message_pump_default.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/message_pump_default.h"
+#include "base/message_loop/message_pump_default.h"
#include "base/logging.h"
#include "base/threading/thread_restrictions.h"
@@ -44,7 +44,7 @@ void MessagePumpDefault::Run(Delegate* delegate) {
if (did_work)
continue;
- base::ThreadRestrictions::ScopedAllowWait allow_wait;
+ ThreadRestrictions::ScopedAllowWait allow_wait;
if (delayed_work_time_.is_null()) {
event_.Wait();
} else {
diff --git a/base/message_pump_default.h b/base/message_loop/message_pump_default.h
index 6deec99..dd65973 100644
--- a/base/message_pump_default.h
+++ b/base/message_loop/message_pump_default.h
@@ -2,12 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef BASE_MESSAGE_PUMP_DEFAULT_H_
-#define BASE_MESSAGE_PUMP_DEFAULT_H_
+#ifndef BASE_MESSAGE_LOOP_MESSAGE_PUMP_DEFAULT_H_
+#define BASE_MESSAGE_LOOP_MESSAGE_PUMP_DEFAULT_H_
-#include "base/message_pump.h"
-#include "base/time.h"
+#include "base/message_loop/message_pump.h"
#include "base/synchronization/waitable_event.h"
+#include "base/time.h"
namespace base {
@@ -39,4 +39,4 @@ class MessagePumpDefault : public MessagePump {
} // namespace base
-#endif // BASE_MESSAGE_PUMP_DEFAULT_H_
+#endif // BASE__MESSAGE_LOOPMESSAGE_PUMP_DEFAULT_H_
diff --git a/base/message_pump_dispatcher.h b/base/message_loop/message_pump_dispatcher.h
index c3ccf3c0..e49fa4f 100644
--- a/base/message_pump_dispatcher.h
+++ b/base/message_loop/message_pump_dispatcher.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef BASE_MESSAGE_PUMP_DISPATCHER_H
-#define BASE_MESSAGE_PUMP_DISPATCHER_H
+#ifndef BASE_MESSAGE_LOOP_MESSAGE_PUMP_DISPATCHER_H
+#define BASE_MESSAGE_LOOP_MESSAGE_PUMP_DISPATCHER_H
#include "base/base_export.h"
#include "base/event_types.h"
@@ -29,4 +29,4 @@ class BASE_EXPORT MessagePumpDispatcher {
} // namespace base
-#endif // BASE_MESSAGE_PUMP_DISPATCHER_H
+#endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_DISPATCHER_H
diff --git a/base/message_pump_glib.cc b/base/message_loop/message_pump_glib.cc
index 7436558..de012fd 100644
--- a/base/message_pump_glib.cc
+++ b/base/message_loop/message_pump_glib.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/message_pump_glib.h"
+#include "base/message_loop/message_pump_glib.h"
#include <fcntl.h>
#include <math.h>
@@ -13,11 +13,13 @@
#include "base/posix/eintr_wrapper.h"
#include "base/threading/platform_thread.h"
+namespace base {
+
namespace {
// Return a timeout suitable for the glib loop, -1 to block forever,
// 0 to return right away, or a timeout in milliseconds from now.
-int GetTimeIntervalMilliseconds(const base::TimeTicks& from) {
+int GetTimeIntervalMilliseconds(const TimeTicks& from) {
if (from.is_null())
return -1;
@@ -25,7 +27,7 @@ int GetTimeIntervalMilliseconds(const base::TimeTicks& from) {
// value in milliseconds. If there are 5.5ms left, should the delay be 5 or
// 6? It should be 6 to avoid executing delayed work too early.
int delay = static_cast<int>(
- ceil((from - base::TimeTicks::Now()).InMillisecondsF()));
+ ceil((from - TimeTicks::Now()).InMillisecondsF()));
// If this value is negative, then we need to run delayed work soon.
return delay < 0 ? 0 : delay;
@@ -81,7 +83,7 @@ int GetTimeIntervalMilliseconds(const base::TimeTicks& from) {
// loop, around event handling.
struct WorkSource : public GSource {
- base::MessagePumpGlib* pump;
+ MessagePumpGlib* pump;
};
gboolean WorkSourcePrepare(GSource* source,
@@ -117,9 +119,6 @@ GSourceFuncs WorkSourceFuncs = {
} // namespace
-
-namespace base {
-
struct MessagePumpGlib::RunState {
Delegate* delegate;
MessagePumpDispatcher* dispatcher;
@@ -166,8 +165,8 @@ void MessagePumpGlib::RunWithDispatcher(Delegate* delegate,
#ifndef NDEBUG
// Make sure we only run this on one thread. X/GTK only has one message pump
// so we can only have one UI loop per process.
- static base::PlatformThreadId thread_id = base::PlatformThread::CurrentId();
- DCHECK(thread_id == base::PlatformThread::CurrentId()) <<
+ static PlatformThreadId thread_id = PlatformThread::CurrentId();
+ DCHECK(thread_id == PlatformThread::CurrentId()) <<
"Running MessagePumpGlib on two different threads; "
"this is unsupported by GLib!";
#endif
diff --git a/base/message_pump_glib.h b/base/message_loop/message_pump_glib.h
index 48afb55..e45591b 100644
--- a/base/message_pump_glib.h
+++ b/base/message_loop/message_pump_glib.h
@@ -2,12 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef BASE_MESSAGE_PUMP_GLIB_H_
-#define BASE_MESSAGE_PUMP_GLIB_H_
+#ifndef BASE_MESSAGE_LOOP_MESSAGE_PUMP_GLIB_H_
+#define BASE_MESSAGE_LOOP_MESSAGE_PUMP_GLIB_H_
#include "base/base_export.h"
#include "base/memory/scoped_ptr.h"
-#include "base/message_pump.h"
+#include "base/message_loop/message_pump.h"
#include "base/observer_list.h"
#include "base/time.h"
@@ -107,4 +107,4 @@ class BASE_EXPORT MessagePumpGlib : public MessagePump {
} // namespace base
-#endif // BASE_MESSAGE_PUMP_GLIB_H_
+#endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_GLIB_H_
diff --git a/base/message_pump_glib_unittest.cc b/base/message_loop/message_pump_glib_unittest.cc
index be11c2f..cb30bb0 100644
--- a/base/message_pump_glib_unittest.cc
+++ b/base/message_loop/message_pump_glib_unittest.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/message_pump_glib.h"
+#include "base/message_loop/message_pump_glib.h"
#include <glib.h>
#include <math.h>
@@ -47,14 +47,14 @@ class EventInjector {
// If the queue is empty, block.
if (events_.empty())
return -1;
- base::TimeDelta delta = events_[0].time - base::Time::NowFromSystemTime();
+ TimeDelta delta = events_[0].time - Time::NowFromSystemTime();
return std::max(0, static_cast<int>(ceil(delta.InMillisecondsF())));
}
bool HandleCheck() {
if (events_.empty())
return false;
- return events_[0].time <= base::Time::NowFromSystemTime();
+ return events_[0].time <= Time::NowFromSystemTime();
}
void HandleDispatch() {
@@ -71,16 +71,16 @@ class EventInjector {
// Adds an event to the queue. When "handled", executes |callback|.
// delay_ms is relative to the last event if any, or to Now() otherwise.
- void AddEvent(int delay_ms, const base::Closure& callback) {
- AddEventHelper(delay_ms, callback, base::Closure());
+ void AddEvent(int delay_ms, const Closure& callback) {
+ AddEventHelper(delay_ms, callback, Closure());
}
void AddDummyEvent(int delay_ms) {
- AddEventHelper(delay_ms, base::Closure(), base::Closure());
+ AddEventHelper(delay_ms, Closure(), Closure());
}
- void AddEventAsTask(int delay_ms, const base::Closure& task) {
- AddEventHelper(delay_ms, base::Closure(), task);
+ void AddEventAsTask(int delay_ms, const Closure& task) {
+ AddEventHelper(delay_ms, Closure(), task);
}
void Reset() {
@@ -92,9 +92,9 @@ class EventInjector {
private:
struct Event {
- base::Time time;
- base::Closure callback;
- base::Closure task;
+ Time time;
+ Closure callback;
+ Closure task;
};
struct Source : public GSource {
@@ -102,14 +102,14 @@ class EventInjector {
};
void AddEventHelper(
- int delay_ms, const base::Closure& callback, const base::Closure& task) {
- base::Time last_time;
+ int delay_ms, const Closure& callback, const Closure& task) {
+ Time last_time;
if (!events_.empty())
last_time = (events_.end()-1)->time;
else
- last_time = base::Time::NowFromSystemTime();
+ last_time = Time::NowFromSystemTime();
- base::Time future = last_time + base::TimeDelta::FromMilliseconds(delay_ms);
+ Time future = last_time + TimeDelta::FromMilliseconds(delay_ms);
EventInjector::Event event = {future, callback, task};
events_.push_back(event);
}
@@ -155,7 +155,7 @@ void ExpectProcessedEvents(EventInjector* injector, int count) {
// Posts a task on the current message loop.
void PostMessageLoopTask(const tracked_objects::Location& from_here,
- const base::Closure& task) {
+ const Closure& task) {
MessageLoop::current()->PostTask(from_here, task);
}
@@ -209,24 +209,24 @@ TEST_F(MessagePumpGLibTest, TestEventTaskInterleave) {
// If changes cause this test to fail, it is reasonable to change it, but
// TestWorkWhileWaitingForEvents and TestEventsWhileWaitingForWork have to be
// changed accordingly, otherwise they can become flaky.
- injector()->AddEventAsTask(0, base::Bind(&base::DoNothing));
- base::Closure check_task =
- base::Bind(&ExpectProcessedEvents, base::Unretained(injector()), 2);
- base::Closure posted_task =
- base::Bind(&PostMessageLoopTask, FROM_HERE, check_task);
+ injector()->AddEventAsTask(0, Bind(&DoNothing));
+ Closure check_task =
+ Bind(&ExpectProcessedEvents, Unretained(injector()), 2);
+ Closure posted_task =
+ Bind(&PostMessageLoopTask, FROM_HERE, check_task);
injector()->AddEventAsTask(0, posted_task);
- injector()->AddEventAsTask(0, base::Bind(&base::DoNothing));
+ injector()->AddEventAsTask(0, Bind(&DoNothing));
injector()->AddEvent(0, MessageLoop::QuitWhenIdleClosure());
loop()->Run();
EXPECT_EQ(4, injector()->processed_events());
injector()->Reset();
- injector()->AddEventAsTask(0, base::Bind(&base::DoNothing));
+ injector()->AddEventAsTask(0, Bind(&DoNothing));
check_task =
- base::Bind(&ExpectProcessedEvents, base::Unretained(injector()), 2);
- posted_task = base::Bind(&PostMessageLoopTask, FROM_HERE, check_task);
+ Bind(&ExpectProcessedEvents, Unretained(injector()), 2);
+ posted_task = Bind(&PostMessageLoopTask, FROM_HERE, check_task);
injector()->AddEventAsTask(0, posted_task);
- injector()->AddEventAsTask(10, base::Bind(&base::DoNothing));
+ injector()->AddEventAsTask(10, Bind(&DoNothing));
injector()->AddEvent(0, MessageLoop::QuitWhenIdleClosure());
loop()->Run();
EXPECT_EQ(4, injector()->processed_events());
@@ -237,13 +237,13 @@ TEST_F(MessagePumpGLibTest, TestWorkWhileWaitingForEvents) {
// Tests that we process tasks while waiting for new events.
// The event queue is empty at first.
for (int i = 0; i < 10; ++i) {
- loop()->PostTask(FROM_HERE, base::Bind(&IncrementInt, &task_count));
+ loop()->PostTask(FROM_HERE, Bind(&IncrementInt, &task_count));
}
// After all the previous tasks have executed, enqueue an event that will
// quit.
loop()->PostTask(
FROM_HERE,
- base::Bind(&EventInjector::AddEvent, base::Unretained(injector()), 0,
+ Bind(&EventInjector::AddEvent, Unretained(injector()), 0,
MessageLoop::QuitWhenIdleClosure()));
loop()->Run();
ASSERT_EQ(10, task_count);
@@ -255,8 +255,8 @@ TEST_F(MessagePumpGLibTest, TestWorkWhileWaitingForEvents) {
for (int i = 0; i < 10; ++i) {
loop()->PostDelayedTask(
FROM_HERE,
- base::Bind(&IncrementInt, &task_count),
- base::TimeDelta::FromMilliseconds(10*i));
+ Bind(&IncrementInt, &task_count),
+ TimeDelta::FromMilliseconds(10*i));
}
// After all the previous tasks have executed, enqueue an event that will
// quit.
@@ -264,9 +264,9 @@ TEST_F(MessagePumpGLibTest, TestWorkWhileWaitingForEvents) {
// That is verified in message_loop_unittest.cc.
loop()->PostDelayedTask(
FROM_HERE,
- base::Bind(&EventInjector::AddEvent, base::Unretained(injector()), 10,
+ Bind(&EventInjector::AddEvent, Unretained(injector()), 10,
MessageLoop::QuitWhenIdleClosure()),
- base::TimeDelta::FromMilliseconds(150));
+ TimeDelta::FromMilliseconds(150));
loop()->Run();
ASSERT_EQ(10, task_count);
EXPECT_EQ(1, injector()->processed_events());
@@ -281,10 +281,10 @@ TEST_F(MessagePumpGLibTest, TestEventsWhileWaitingForWork) {
// After all the events have been processed, post a task that will check that
// the events have been processed (note: the task executes after the event
// that posted it has been handled, so we expect 11 at that point).
- base::Closure check_task =
- base::Bind(&ExpectProcessedEvents, base::Unretained(injector()), 11);
- base::Closure posted_task =
- base::Bind(&PostMessageLoopTask, FROM_HERE, check_task);
+ Closure check_task =
+ Bind(&ExpectProcessedEvents, Unretained(injector()), 11);
+ Closure posted_task =
+ Bind(&PostMessageLoopTask, FROM_HERE, check_task);
injector()->AddEventAsTask(10, posted_task);
// And then quit (relies on the condition tested by TestEventTaskInterleave).
@@ -299,7 +299,7 @@ namespace {
// This class is a helper for the concurrent events / posted tasks test below.
// It will quit the main loop once enough tasks and events have been processed,
// while making sure there is always work to do and events in the queue.
-class ConcurrentHelper : public base::RefCounted<ConcurrentHelper> {
+class ConcurrentHelper : public RefCounted<ConcurrentHelper> {
public:
explicit ConcurrentHelper(EventInjector* injector)
: injector_(injector),
@@ -315,7 +315,7 @@ class ConcurrentHelper : public base::RefCounted<ConcurrentHelper> {
MessageLoop::current()->QuitWhenIdle();
} else {
MessageLoop::current()->PostTask(
- FROM_HERE, base::Bind(&ConcurrentHelper::FromTask, this));
+ FROM_HERE, Bind(&ConcurrentHelper::FromTask, this));
}
}
@@ -327,7 +327,7 @@ class ConcurrentHelper : public base::RefCounted<ConcurrentHelper> {
MessageLoop::current()->QuitWhenIdle();
} else {
injector_->AddEventAsTask(
- 0, base::Bind(&ConcurrentHelper::FromEvent, this));
+ 0, Bind(&ConcurrentHelper::FromEvent, this));
}
}
@@ -335,7 +335,7 @@ class ConcurrentHelper : public base::RefCounted<ConcurrentHelper> {
int task_count() const { return task_count_; }
private:
- friend class base::RefCounted<ConcurrentHelper>;
+ friend class RefCounted<ConcurrentHelper>;
~ConcurrentHelper() {}
@@ -360,15 +360,15 @@ TEST_F(MessagePumpGLibTest, TestConcurrentEventPostedTask) {
// Add 2 events to the queue to make sure it is always full (when we remove
// the event before processing it).
injector()->AddEventAsTask(
- 0, base::Bind(&ConcurrentHelper::FromEvent, helper.get()));
+ 0, Bind(&ConcurrentHelper::FromEvent, helper.get()));
injector()->AddEventAsTask(
- 0, base::Bind(&ConcurrentHelper::FromEvent, helper.get()));
+ 0, Bind(&ConcurrentHelper::FromEvent, helper.get()));
// Similarly post 2 tasks.
loop()->PostTask(
- FROM_HERE, base::Bind(&ConcurrentHelper::FromTask, helper.get()));
+ FROM_HERE, Bind(&ConcurrentHelper::FromTask, helper.get()));
loop()->PostTask(
- FROM_HERE, base::Bind(&ConcurrentHelper::FromTask, helper.get()));
+ FROM_HERE, Bind(&ConcurrentHelper::FromTask, helper.get()));
loop()->Run();
EXPECT_EQ(0, helper->event_count());
@@ -385,8 +385,8 @@ void AddEventsAndDrainGLib(EventInjector* injector) {
injector->AddEvent(0, MessageLoop::QuitWhenIdleClosure());
// Post a couple of dummy tasks
- MessageLoop::current()->PostTask(FROM_HERE, base::Bind(&base::DoNothing));
- MessageLoop::current()->PostTask(FROM_HERE, base::Bind(&base::DoNothing));
+ MessageLoop::current()->PostTask(FROM_HERE, Bind(&DoNothing));
+ MessageLoop::current()->PostTask(FROM_HERE, Bind(&DoNothing));
// Drain the events
while (g_main_context_pending(NULL)) {
@@ -400,7 +400,7 @@ TEST_F(MessagePumpGLibTest, TestDrainingGLib) {
// Tests that draining events using GLib works.
loop()->PostTask(
FROM_HERE,
- base::Bind(&AddEventsAndDrainGLib, base::Unretained(injector())));
+ Bind(&AddEventsAndDrainGLib, Unretained(injector())));
loop()->Run();
EXPECT_EQ(3, injector()->processed_events());
@@ -418,8 +418,8 @@ void AddEventsAndDrainGtk(EventInjector* injector) {
injector->AddEvent(0, MessageLoop::QuitWhenIdleClosure());
// Post a couple of dummy tasks
- MessageLoop::current()->PostTask(FROM_HERE, base::Bind(&base::DoNothing));
- MessageLoop::current()->PostTask(FROM_HERE, base::Bind(&base::DoNothing));
+ MessageLoop::current()->PostTask(FROM_HERE, Bind(&DoNothing));
+ MessageLoop::current()->PostTask(FROM_HERE, Bind(&DoNothing));
// Drain the events
while (gtk_events_pending()) {
@@ -435,7 +435,7 @@ TEST_F(MessagePumpGLibTest, TestDrainingGtk) {
// Tests that draining events using Gtk works.
loop()->PostTask(
FROM_HERE,
- base::Bind(&AddEventsAndDrainGtk, base::Unretained(injector())));
+ Bind(&AddEventsAndDrainGtk, Unretained(injector())));
loop()->Run();
EXPECT_EQ(3, injector()->processed_events());
@@ -445,7 +445,7 @@ TEST_F(MessagePumpGLibTest, TestDrainingGtk) {
namespace {
// Helper class that lets us run the GLib message loop.
-class GLibLoopRunner : public base::RefCounted<GLibLoopRunner> {
+class GLibLoopRunner : public RefCounted<GLibLoopRunner> {
public:
GLibLoopRunner() : quit_(false) { }
@@ -476,7 +476,7 @@ class GLibLoopRunner : public base::RefCounted<GLibLoopRunner> {
}
private:
- friend class base::RefCounted<GLibLoopRunner>;
+ friend class RefCounted<GLibLoopRunner>;
~GLibLoopRunner() {}
@@ -494,21 +494,21 @@ void TestGLibLoopInternal(EventInjector* injector) {
injector->AddDummyEvent(0);
// Post a couple of dummy tasks
MessageLoop::current()->PostTask(
- FROM_HERE, base::Bind(&IncrementInt, &task_count));
+ FROM_HERE, Bind(&IncrementInt, &task_count));
MessageLoop::current()->PostTask(
- FROM_HERE, base::Bind(&IncrementInt, &task_count));
+ FROM_HERE, Bind(&IncrementInt, &task_count));
// Delayed events
injector->AddDummyEvent(10);
injector->AddDummyEvent(10);
// Delayed work
MessageLoop::current()->PostDelayedTask(
FROM_HERE,
- base::Bind(&IncrementInt, &task_count),
- base::TimeDelta::FromMilliseconds(30));
+ Bind(&IncrementInt, &task_count),
+ TimeDelta::FromMilliseconds(30));
MessageLoop::current()->PostDelayedTask(
FROM_HERE,
- base::Bind(&GLibLoopRunner::Quit, runner.get()),
- base::TimeDelta::FromMilliseconds(40));
+ Bind(&GLibLoopRunner::Quit, runner.get()),
+ TimeDelta::FromMilliseconds(40));
// Run a nested, straight GLib message loop.
runner->RunGLib();
@@ -529,21 +529,21 @@ void TestGtkLoopInternal(EventInjector* injector) {
injector->AddDummyEvent(0);
// Post a couple of dummy tasks
MessageLoop::current()->PostTask(
- FROM_HERE, base::Bind(&IncrementInt, &task_count));
+ FROM_HERE, Bind(&IncrementInt, &task_count));
MessageLoop::current()->PostTask(
- FROM_HERE, base::Bind(&IncrementInt, &task_count));
+ FROM_HERE, Bind(&IncrementInt, &task_count));
// Delayed events
injector->AddDummyEvent(10);
injector->AddDummyEvent(10);
// Delayed work
MessageLoop::current()->PostDelayedTask(
FROM_HERE,
- base::Bind(&IncrementInt, &task_count),
- base::TimeDelta::FromMilliseconds(30));
+ Bind(&IncrementInt, &task_count),
+ TimeDelta::FromMilliseconds(30));
MessageLoop::current()->PostDelayedTask(
FROM_HERE,
- base::Bind(&GLibLoopRunner::Quit, runner.get()),
- base::TimeDelta::FromMilliseconds(40));
+ Bind(&GLibLoopRunner::Quit, runner.get()),
+ TimeDelta::FromMilliseconds(40));
// Run a nested, straight Gtk message loop.
runner->RunLoop();
@@ -562,7 +562,7 @@ TEST_F(MessagePumpGLibTest, TestGLibLoop) {
// between events and posted tasks.
loop()->PostTask(
FROM_HERE,
- base::Bind(&TestGLibLoopInternal, base::Unretained(injector())));
+ Bind(&TestGLibLoopInternal, Unretained(injector())));
loop()->Run();
}
@@ -573,7 +573,7 @@ TEST_F(MessagePumpGLibTest, TestGtkLoop) {
// between events and posted tasks.
loop()->PostTask(
FROM_HERE,
- base::Bind(&TestGtkLoopInternal, base::Unretained(injector())));
+ Bind(&TestGtkLoopInternal, Unretained(injector())));
loop()->Run();
}
diff --git a/base/message_pump_gtk.cc b/base/message_loop/message_pump_gtk.cc
index 780b4d8..8fa8cf2 100644
--- a/base/message_pump_gtk.cc
+++ b/base/message_loop/message_pump_gtk.cc
@@ -2,13 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/message_pump_gtk.h"
+#include "base/message_loop/message_pump_gtk.h"
#include <gtk/gtk.h>
#include <gdk/gdkx.h>
-#include "base/profiler/scoped_profile.h"
#include "base/debug/trace_event.h"
+#include "base/profiler/scoped_profile.h"
+
+namespace base {
namespace {
@@ -57,9 +59,7 @@ const char* EventToTypeString(const GdkEvent* event) {
}
}
-}
-
-namespace base {
+} // namespace
MessagePumpGtk::MessagePumpGtk() : MessagePumpGlib() {
gdk_event_handler_set(&EventDispatcher, this, NULL);
diff --git a/base/message_pump_gtk.h b/base/message_loop/message_pump_gtk.h
index ba5cff1..e22e04f 100644
--- a/base/message_pump_gtk.h
+++ b/base/message_loop/message_pump_gtk.h
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef BASE_MESSAGE_PUMP_GTK_H_
-#define BASE_MESSAGE_PUMP_GTK_H_
+#ifndef BASE_MESSAGE_LOOP_MESSAGE_PUMP_GTK_H_
+#define BASE_MESSAGE_LOOP_MESSAGE_PUMP_GTK_H_
-#include "base/message_pump_glib.h"
+#include "base/message_loop/message_pump_glib.h"
typedef union _GdkEvent GdkEvent;
typedef struct _XDisplay Display;
@@ -73,4 +73,4 @@ typedef MessagePumpGtk MessagePumpForUI;
} // namespace base
-#endif // BASE_MESSAGE_PUMP_GTK_H_
+#endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_GTK_H_
diff --git a/base/message_pump_io_ios.cc b/base/message_loop/message_pump_io_ios.cc
index ca800ff..5868195 100644
--- a/base/message_pump_io_ios.cc
+++ b/base/message_loop/message_pump_io_ios.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/message_pump_io_ios.h"
+#include "base/message_loop/message_pump_io_ios.h"
namespace base {
diff --git a/base/message_pump_io_ios.h b/base/message_loop/message_pump_io_ios.h
index 81f529d..3aaf037 100644
--- a/base/message_pump_io_ios.h
+++ b/base/message_loop/message_pump_io_ios.h
@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef BASE_MESSAGE_PUMP_IO_IOS_H_
-#define BASE_MESSAGE_PUMP_IO_IOS_H_
+#ifndef BASE_MESSAGE_LOOP_MESSAGE_PUMP_IO_IOS_H_
+#define BASE_MESSAGE_LOOP_MESSAGE_PUMP_IO_IOS_H_
#include "base/base_export.h"
#include "base/mac/scoped_cffiledescriptorref.h"
#include "base/mac/scoped_cftyperef.h"
#include "base/memory/ref_counted.h"
-#include "base/message_pump_mac.h"
+#include "base/message_loop/message_pump_mac.h"
#include "base/observer_list.h"
namespace base {
@@ -139,4 +139,4 @@ class BASE_EXPORT MessagePumpIOSForIO : public MessagePumpNSRunLoop {
} // namespace base
-#endif // BASE_MESSAGE_PUMP_IO_IOS_H_
+#endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_IO_IOS_H_
diff --git a/base/message_pump_io_ios_unittest.cc b/base/message_loop/message_pump_io_ios_unittest.cc
index 7a00d11..9e94c6b 100644
--- a/base/message_pump_io_ios_unittest.cc
+++ b/base/message_loop/message_pump_io_ios_unittest.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/message_pump_io_ios.h"
+#include "base/message_loop/message_pump_io_ios.h"
#include <unistd.h>
diff --git a/base/message_pump_libevent.cc b/base/message_loop/message_pump_libevent.cc
index 364f44a..8de0db2 100644
--- a/base/message_pump_libevent.cc
+++ b/base/message_loop/message_pump_libevent.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/message_pump_libevent.h"
+#include "base/message_loop/message_pump_libevent.h"
#include <errno.h>
#include <fcntl.h>
@@ -11,9 +11,6 @@
#include "base/auto_reset.h"
#include "base/compiler_specific.h"
#include "base/logging.h"
-#if defined(OS_MACOSX)
-#include "base/mac/scoped_nsautorelease_pool.h"
-#endif
#include "base/memory/scoped_ptr.h"
#include "base/observer_list.h"
#include "base/posix/eintr_wrapper.h"
@@ -221,7 +218,7 @@ static void timer_callback(int fd, short events, void *context)
// Reentrant!
void MessagePumpLibevent::Run(Delegate* delegate) {
DCHECK(keep_running_) << "Quit must have been called outside of Run!";
- base::AutoReset<bool> auto_reset_in_run(&in_run_, true);
+ AutoReset<bool> auto_reset_in_run(&in_run_, true);
// event_base_loopexit() + EVLOOP_ONCE is leaky, see http://crbug.com/25641.
// Instead, make our own timer and reuse it on each call to event_base_loop().
@@ -343,7 +340,7 @@ bool MessagePumpLibevent::Init() {
// static
void MessagePumpLibevent::OnLibeventNotification(int fd, short flags,
void* context) {
- base::WeakPtr<FileDescriptorWatcher> controller =
+ WeakPtr<FileDescriptorWatcher> controller =
static_cast<FileDescriptorWatcher*>(context)->weak_factory_.GetWeakPtr();
DCHECK(controller.get());
@@ -363,8 +360,7 @@ void MessagePumpLibevent::OnLibeventNotification(int fd, short flags,
// Called if a byte is received on the wakeup pipe.
// static
void MessagePumpLibevent::OnWakeup(int socket, short flags, void* context) {
- base::MessagePumpLibevent* that =
- static_cast<base::MessagePumpLibevent*>(context);
+ MessagePumpLibevent* that = static_cast<MessagePumpLibevent*>(context);
DCHECK(that->wakeup_pipe_out_ == socket);
// Remove and discard the wakeup byte.
diff --git a/base/message_pump_libevent.h b/base/message_loop/message_pump_libevent.h
index 90e8510..a54ef88 100644
--- a/base/message_pump_libevent.h
+++ b/base/message_loop/message_pump_libevent.h
@@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef BASE_MESSAGE_PUMP_LIBEVENT_H_
-#define BASE_MESSAGE_PUMP_LIBEVENT_H_
+#ifndef BASE_MESSAGE_LOOP_MESSAGE_PUMP_LIBEVENT_H_
+#define BASE_MESSAGE_LOOP_MESSAGE_PUMP_LIBEVENT_H_
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/memory/weak_ptr.h"
-#include "base/message_pump.h"
+#include "base/message_loop/message_pump.h"
#include "base/observer_list.h"
#include "base/threading/thread_checker.h"
#include "base/time.h"
@@ -86,7 +86,7 @@ class BASE_EXPORT MessagePumpLibevent : public MessagePump {
event* event_;
MessagePumpLibevent* pump_;
Watcher* watcher_;
- base::WeakPtrFactory<FileDescriptorWatcher> weak_factory_;
+ WeakPtrFactory<FileDescriptorWatcher> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(FileDescriptorWatcher);
};
@@ -176,4 +176,4 @@ class BASE_EXPORT MessagePumpLibevent : public MessagePump {
} // namespace base
-#endif // BASE_MESSAGE_PUMP_LIBEVENT_H_
+#endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_LIBEVENT_H_
diff --git a/base/message_pump_libevent_unittest.cc b/base/message_loop/message_pump_libevent_unittest.cc
index cd423af..657ac7d 100644
--- a/base/message_pump_libevent_unittest.cc
+++ b/base/message_loop/message_pump_libevent_unittest.cc
@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/message_pump_libevent.h"
+#include "base/message_loop/message_pump_libevent.h"
#include <unistd.h>
-#include "base/message_loop.h"
+#include "base/message_loop/message_loop.h"
#include "base/posix/eintr_wrapper.h"
#include "base/threading/thread.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/base/message_pump_mac.h b/base/message_loop/message_pump_mac.h
index 2dd5ecf..68c2a3d 100644
--- a/base/message_pump_mac.h
+++ b/base/message_loop/message_pump_mac.h
@@ -27,10 +27,10 @@
// or NSRunLoop-based MessagePump subclass depending on which thread it is
// called on.
-#ifndef BASE_MESSAGE_PUMP_MAC_H_
-#define BASE_MESSAGE_PUMP_MAC_H_
+#ifndef BASE_MESSAGE_LOOP_MESSAGE_PUMP_MAC_H_
+#define BASE_MESSAGE_LOOP_MESSAGE_PUMP_MAC_H_
-#include "base/message_pump.h"
+#include "base/message_loop/message_pump.h"
#include <CoreFoundation/CoreFoundation.h>
@@ -257,7 +257,7 @@ class MessagePumpUIApplication : public MessagePumpCFRunLoopBase {
virtual ~MessagePumpUIApplication();
private:
- base::RunLoop* run_loop_;
+ RunLoop* run_loop_;
DISALLOW_COPY_AND_ASSIGN(MessagePumpUIApplication);
};
@@ -334,4 +334,4 @@ class MessagePumpMac {
} // namespace base
-#endif // BASE_MESSAGE_PUMP_MAC_H_
+#endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_MAC_H_
diff --git a/base/message_pump_mac.mm b/base/message_loop/message_pump_mac.mm
index 4a07cd4..a419d48 100644
--- a/base/message_pump_mac.mm
+++ b/base/message_loop/message_pump_mac.mm
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#import "base/message_pump_mac.h"
+#import "base/message_loop/message_pump_mac.h"
#import <Foundation/Foundation.h>
@@ -546,7 +546,7 @@ void MessagePumpUIApplication::Quit() {
void MessagePumpUIApplication::Attach(Delegate* delegate) {
DCHECK(!run_loop_);
- run_loop_ = new base::RunLoop();
+ run_loop_ = new RunLoop();
CHECK(run_loop_->BeforeRun());
SetDelegate(delegate);
}
diff --git a/base/message_pump_observer.h b/base/message_loop/message_pump_observer.h
index a7d2aa7..cb46fa3 100644
--- a/base/message_pump_observer.h
+++ b/base/message_loop/message_pump_observer.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef BASE_MESSAGE_PUMP_OBSERVER_H
-#define BASE_MESSAGE_PUMP_OBSERVER_H
+#ifndef BASE_MESSAGE_LOOP_MESSAGE_PUMP_OBSERVER_H
+#define BASE_MESSAGE_LOOP_MESSAGE_PUMP_OBSERVER_H
#include "base/base_export.h"
#include "base/event_types.h"
@@ -44,4 +44,4 @@ class BASE_EXPORT MessagePumpObserver {
} // namespace base
-#endif // BASE_MESSAGE_PUMP_OBSERVER_VIEWS_H
+#endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_OBSERVER_H
diff --git a/base/message_pump_ozone.cc b/base/message_loop/message_pump_ozone.cc
index ca7f45d..5c0bf83 100644
--- a/base/message_pump_ozone.cc
+++ b/base/message_loop/message_pump_ozone.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/message_pump_ozone.h"
+#include "base/message_loop/message_pump_ozone.h"
#include "base/logging.h"
#include "base/message_loop.h"
@@ -43,7 +43,7 @@ void MessagePumpOzone::RemoveDispatcherForRootWindow(
dispatcher_.pop_back();
}
-bool MessagePumpOzone::Dispatch(const base::NativeEvent& dev) {
+bool MessagePumpOzone::Dispatch(const NativeEvent& dev) {
if (dispatcher_.size() > 0)
return dispatcher_[0]->Dispatch(dev);
else
diff --git a/base/message_pump_ozone.h b/base/message_loop/message_pump_ozone.h
index 8fb2f1d..de75ab4 100644
--- a/base/message_pump_ozone.h
+++ b/base/message_loop/message_pump_ozone.h
@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef BASE_MESSAGE_PUMP_OZONE_H_
-#define BASE_MESSAGE_PUMP_OZONE_H_
+#ifndef BASE_MESSAGE_LOOP_MESSAGE_PUMP_OZONE_H_
+#define BASE_MESSAGE_LOOP_MESSAGE_PUMP_OZONE_H_
#include "base/memory/scoped_ptr.h"
#include "base/memory/scoped_vector.h"
-#include "base/message_pump_dispatcher.h"
-#include "base/message_pump_libevent.h"
-#include "base/message_pump_observer.h"
+#include "base/message_loop/message_pump_dispatcher.h"
+#include "base/message_loop/message_pump_libevent.h"
+#include "base/message_loop/message_pump_observer.h"
#include "base/observer_list.h"
namespace base {
@@ -36,7 +36,7 @@ class BASE_EXPORT MessagePumpOzone : public MessagePumpLibevent,
void RemoveObserver(MessagePumpObserver* observer);
// Overridden from MessagePumpDispatcher.
- virtual bool Dispatch(const base::NativeEvent& event) OVERRIDE;
+ virtual bool Dispatch(const NativeEvent& event) OVERRIDE;
private:
virtual ~MessagePumpOzone();
@@ -49,4 +49,4 @@ typedef MessagePumpOzone MessagePumpForUI;
} // namespace base
-#endif // BASE_MESSAGE_PUMP_OZONE_H_
+#endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_OZONE_H_
diff --git a/base/message_pump_win.cc b/base/message_loop/message_pump_win.cc
index dcbb320..36a3210 100644
--- a/base/message_pump_win.cc
+++ b/base/message_loop/message_pump_win.cc
@@ -2,17 +2,19 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/message_pump_win.h"
+#include "base/message_loop/message_pump_win.h"
#include <math.h>
#include "base/debug/trace_event.h"
-#include "base/message_loop.h"
+#include "base/message_loop/message_loop.h"
#include "base/metrics/histogram.h"
#include "base/process_util.h"
#include "base/stringprintf.h"
#include "base/win/wrapped_window_proc.h"
+namespace base {
+
namespace {
enum MessageLoopProblems {
@@ -24,8 +26,6 @@ enum MessageLoopProblems {
} // namespace
-namespace base {
-
static const wchar_t kWndClassFormat[] = L"Chrome_MessagePumpWindow_%p";
// Message sent to get an additional time slice for pumping (processing) another
@@ -105,7 +105,7 @@ MessagePumpForUI::MessagePumpForUI()
MessagePumpForUI::~MessagePumpForUI() {
DestroyWindow(message_hwnd_);
UnregisterClass(MAKEINTATOM(atom_),
- base::GetModuleFromAddress(&WndProcThunk));
+ GetModuleFromAddress(&WndProcThunk));
}
void MessagePumpForUI::ScheduleWork() {
@@ -271,9 +271,9 @@ void MessagePumpForUI::DoRunLoop() {
void MessagePumpForUI::InitMessageWnd() {
// Generate a unique window class name.
- string16 class_name = base::StringPrintf(kWndClassFormat, this);
+ string16 class_name = StringPrintf(kWndClassFormat, this);
- HINSTANCE instance = base::GetModuleFromAddress(&WndProcThunk);
+ HINSTANCE instance = GetModuleFromAddress(&WndProcThunk);
WNDCLASSEX wc = {0};
wc.cbSize = sizeof(wc);
wc.lpfnWndProc = base::win::WrappedWindowProc<WndProcThunk>;
diff --git a/base/message_pump_win.h b/base/message_loop/message_pump_win.h
index a76bcfb..dbb41bd 100644
--- a/base/message_pump_win.h
+++ b/base/message_loop/message_pump_win.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef BASE_MESSAGE_PUMP_WIN_H_
-#define BASE_MESSAGE_PUMP_WIN_H_
+#ifndef BASE_MESSAGE_LOOP_MESSAGE_PUMP_WIN_H_
+#define BASE_MESSAGE_LOOP_MESSAGE_PUMP_WIN_H_
#include <windows.h>
@@ -12,9 +12,9 @@
#include "base/base_export.h"
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
-#include "base/message_pump.h"
-#include "base/message_pump_dispatcher.h"
-#include "base/message_pump_observer.h"
+#include "base/message_loop/message_pump.h"
+#include "base/message_loop/message_pump_dispatcher.h"
+#include "base/message_loop/message_pump_observer.h"
#include "base/observer_list.h"
#include "base/time.h"
#include "base/win/scoped_handle.h"
@@ -393,4 +393,4 @@ class BASE_EXPORT MessagePumpForIO : public MessagePumpWin {
} // namespace base
-#endif // BASE_MESSAGE_PUMP_WIN_H_
+#endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_WIN_H_
diff --git a/base/test/mock_chrome_application_mac.h b/base/test/mock_chrome_application_mac.h
index 5cd1d19..ffa3080 100644
--- a/base/test/mock_chrome_application_mac.h
+++ b/base/test/mock_chrome_application_mac.h
@@ -10,7 +10,7 @@
#import <AppKit/AppKit.h>
#include "base/mac/scoped_sending_event.h"
-#include "base/message_pump_mac.h"
+#include "base/message_loop/message_pump_mac.h"
// A basic implementation of CrAppProtocol and
// CrAppControlProtocol. This can be used in tests that need an
diff --git a/base/test/test_support_android.cc b/base/test/test_support_android.cc
index 64da18a..5180333 100644
--- a/base/test/test_support_android.cc
+++ b/base/test/test_support_android.cc
@@ -9,8 +9,8 @@
#include "base/files/file_path.h"
#include "base/logging.h"
#include "base/memory/singleton.h"
-#include "base/message_loop.h"
-#include "base/message_pump_android.h"
+#include "base/message_loop/message_loop.h"
+#include "base/message_loop/message_pump_android.h"
#include "base/path_service.h"
#include "base/synchronization/waitable_event.h"
diff --git a/base/test/test_support_ios.mm b/base/test/test_support_ios.mm
index cb07f00..ebe6767 100644
--- a/base/test/test_support_ios.mm
+++ b/base/test/test_support_ios.mm
@@ -8,8 +8,8 @@
#include "base/logging.h"
#include "base/mac/scoped_nsautorelease_pool.h"
#include "base/memory/scoped_nsobject.h"
-#include "base/message_loop.h"
-#include "base/message_pump_default.h"
+#include "base/message_loop/message_loop.h"
+#include "base/message_loop/message_pump_default.h"
#include "base/test/test_suite.h"
// Springboard will kill any iOS app that fails to check in after launch within
diff --git a/base/win/text_services_message_filter.h b/base/win/text_services_message_filter.h
index facd613..704c1da 100644
--- a/base/win/text_services_message_filter.h
+++ b/base/win/text_services_message_filter.h
@@ -9,7 +9,7 @@
#include <Windows.h>
#include "base/memory/scoped_ptr.h"
-#include "base/message_pump_win.h"
+#include "base/message_loop/message_pump_win.h"
#include "base/win/metro.h"
#include "base/win/scoped_comptr.h"