summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-14 23:15:32 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-14 23:15:32 +0000
commit9bf0b36044584756132943f37a06f2fcaef7e5fb (patch)
tree6e7f6e0c831372cb1fee518bc9166c0c4331ed96 /base
parentbb4628ae89c01f3ed942a24405a56f58cfbee68a (diff)
downloadchromium_src-9bf0b36044584756132943f37a06f2fcaef7e5fb.zip
chromium_src-9bf0b36044584756132943f37a06f2fcaef7e5fb.tar.gz
chromium_src-9bf0b36044584756132943f37a06f2fcaef7e5fb.tar.bz2
Revert 206507 "Move message_pump to base/message_loop."
> 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. > > BUG= > R=sky@chromium.org > > Review URL: https://codereview.chromium.org/17078005 TBR=brettw@chromium.org Review URL: https://codereview.chromium.org/16897005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@206513 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_pump.cc (renamed from base/message_loop/message_pump.cc)2
-rw-r--r--base/message_pump.h (renamed from base/message_loop/message_pump.h)6
-rw-r--r--base/message_pump_android.cc (renamed from base/message_loop/message_pump_android.cc)8
-rw-r--r--base/message_pump_android.h (renamed from base/message_loop/message_pump_android.h)10
-rw-r--r--base/message_pump_aurax11.cc (renamed from base/message_loop/message_pump_aurax11.cc)22
-rw-r--r--base/message_pump_aurax11.h (renamed from base/message_loop/message_pump_aurax11.h)19
-rw-r--r--base/message_pump_default.cc (renamed from base/message_loop/message_pump_default.cc)4
-rw-r--r--base/message_pump_default.h (renamed from base/message_loop/message_pump_default.h)10
-rw-r--r--base/message_pump_dispatcher.h (renamed from base/message_loop/message_pump_dispatcher.h)6
-rw-r--r--base/message_pump_glib.cc (renamed from base/message_loop/message_pump_glib.cc)17
-rw-r--r--base/message_pump_glib.h (renamed from base/message_loop/message_pump_glib.h)8
-rw-r--r--base/message_pump_glib_unittest.cc (renamed from base/message_loop/message_pump_glib_unittest.cc)132
-rw-r--r--base/message_pump_gtk.cc (renamed from base/message_loop/message_pump_gtk.cc)10
-rw-r--r--base/message_pump_gtk.h (renamed from base/message_loop/message_pump_gtk.h)8
-rw-r--r--base/message_pump_io_ios.cc (renamed from base/message_loop/message_pump_io_ios.cc)2
-rw-r--r--base/message_pump_io_ios.h (renamed from base/message_loop/message_pump_io_ios.h)8
-rw-r--r--base/message_pump_io_ios_unittest.cc (renamed from base/message_loop/message_pump_io_ios_unittest.cc)2
-rw-r--r--base/message_pump_libevent.cc (renamed from base/message_loop/message_pump_libevent.cc)12
-rw-r--r--base/message_pump_libevent.h (renamed from base/message_loop/message_pump_libevent.h)10
-rw-r--r--base/message_pump_libevent_unittest.cc (renamed from base/message_loop/message_pump_libevent_unittest.cc)4
-rw-r--r--base/message_pump_mac.h (renamed from base/message_loop/message_pump_mac.h)10
-rw-r--r--base/message_pump_mac.mm (renamed from base/message_loop/message_pump_mac.mm)4
-rw-r--r--base/message_pump_observer.h (renamed from base/message_loop/message_pump_observer.h)6
-rw-r--r--base/message_pump_ozone.cc (renamed from base/message_loop/message_pump_ozone.cc)4
-rw-r--r--base/message_pump_ozone.h (renamed from base/message_loop/message_pump_ozone.h)14
-rw-r--r--base/message_pump_win.cc (renamed from base/message_loop/message_pump_win.cc)14
-rw-r--r--base/message_pump_win.h (renamed from base/message_loop/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, 327 insertions, 317 deletions
diff --git a/base/android/base_jni_registrar.cc b/base/android/base_jni_registrar.cc
index 36d638b..468e297 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_loop/message_pump_android.h"
+#include "base/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 54ed4b7..fa4b00e 100644
--- a/base/base.gyp
+++ b/base/base.gyp
@@ -247,21 +247,21 @@
'linux_util.h',
'md5.cc',
'md5.h',
- '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',
+ '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',
'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_loop/message_pump_glib_unittest.cc',
- 'message_loop/message_pump_io_ios_unittest.cc',
- 'message_loop/message_pump_libevent_unittest.cc',
+ 'message_pump_glib_unittest.cc',
+ 'message_pump_io_ios_unittest.cc',
+ 'message_pump_libevent_unittest.cc',
'metrics/sample_map_unittest.cc',
'metrics/sample_vector_unittest.cc',
'metrics/bucket_ranges_unittest.cc',
@@ -684,7 +684,7 @@
# Requires spawning processes.
['exclude', '^metrics/stats_table_unittest\\.cc$'],
# iOS does not use message_pump_libevent.
- ['exclude', '^message_loop/message_pump_libevent_unittest\\.cc$'],
+ ['exclude', '^message_pump_libevent_unittest\\.cc$'],
],
'conditions': [
['coverage != 0', {
@@ -746,12 +746,12 @@
],
}, { # use_glib!=1
'sources!': [
- 'message_loop/message_pump_glib_unittest.cc',
+ 'message_pump_glib_unittest.cc',
]
}],
['use_ozone == 1', {
'sources!': [
- 'message_loop/message_pump_glib_unittest.cc',
+ 'message_pump_glib_unittest.cc',
]
}],
['OS == "win"', {
@@ -764,7 +764,7 @@
'file_descriptor_shuffle_unittest.cc',
'files/dir_reader_posix_unittest.cc',
'threading/worker_pool_posix_unittest.cc',
- 'message_loop/message_pump_libevent_unittest.cc',
+ '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 b96038b..0a580fd 100644
--- a/base/base.gypi
+++ b/base/base.gypi
@@ -301,16 +301,16 @@
'message_loop/message_loop_proxy.h',
'message_loop/message_loop_proxy_impl.cc',
'message_loop/message_loop_proxy_impl.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',
+ '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',
'metrics/sample_map.cc',
'metrics/sample_map.h',
'metrics/sample_vector.cc',
@@ -648,12 +648,12 @@
],
'sources!': [
'atomicops_internals_x86_gcc.cc',
- 'message_loop/message_pump_glib.cc',
- 'message_loop/message_pump_aurax11.cc',
+ 'message_pump_glib.cc',
+ 'message_pump_aurax11.cc',
],
}],
['<(toolkit_uses_gtk)==0 or >(nacl_untrusted_build)==1', {
- 'sources!': ['message_loop/message_pump_gtk.cc'],
+ 'sources!': ['message_pump_gtk.cc'],
}],
['(OS != "linux" and <(os_bsd) != 1 and OS != "android") or >(nacl_untrusted_build)==1', {
'sources!': [
@@ -736,7 +736,7 @@
['include', '^mac/scoped_mach_port\\.'],
['include', '^mac/scoped_nsautorelease_pool\\.'],
['include', '^memory/discardable_memory_mac\\.'],
- ['include', '^message_loop/message_pump_mac\\.'],
+ ['include', '^message_pump_mac\\.'],
['include', '^threading/platform_thread_mac\\.'],
['include', '^strings/sys_string_conversions_mac\\.'],
['include', '^time_mac\\.'],
@@ -747,7 +747,7 @@
['include', '^process_util_ios\\.mm$'],
],
'sources!': [
- 'message_loop/message_pump_libevent.cc'
+ 'message_pump_libevent.cc'
],
}],
['OS == "ios" and _toolset == "host"', {
@@ -790,7 +790,7 @@
'event_recorder_stubs.cc',
'files/file_path_watcher_kqueue.cc',
'files/file_path_watcher_stub.cc',
- 'message_loop/message_pump_libevent.cc',
+ '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.
@@ -800,8 +800,8 @@
},],
['<(use_ozone) == 1', {
'sources!': [
- 'message_loop/message_pump_glib.cc',
- 'message_loop/message_pump_aurax11.cc',
+ 'message_pump_glib.cc',
+ '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 62bb31f..f7637bb 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_loop/message_pump_mac.h"
+#include "base/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 4e0c5f6..0364a52 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_loop/message_pump_default.h"
+#include "base/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_loop/message_pump_mac.h"
+#include "base/message_pump_mac.h"
#endif
#if defined(OS_POSIX) && !defined(OS_IOS)
-#include "base/message_loop/message_pump_libevent.h"
+#include "base/message_pump_libevent.h"
#endif
#if defined(OS_ANDROID)
-#include "base/message_loop/message_pump_android.h"
+#include "base/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 e765cef..d26b673 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_loop/message_pump.h"
+#include "base/message_pump.h"
#include "base/observer_list.h"
#include "base/pending_task.h"
#include "base/sequenced_task_runner_helpers.h"
@@ -25,26 +25,25 @@
#if defined(OS_WIN)
// We need this to declare base::MessagePumpWin::Dispatcher, which we should
// really just eliminate.
-#include "base/message_loop/message_pump_win.h"
+#include "base/message_pump_win.h"
#elif defined(OS_IOS)
-#include "base/message_loop/message_pump_io_ios.h"
+#include "base/message_pump_io_ios.h"
#elif defined(OS_POSIX)
-#include "base/message_loop/message_pump_libevent.h"
+#include "base/message_pump_libevent.h"
#if !defined(OS_MACOSX) && !defined(OS_ANDROID)
#if defined(USE_AURA) && defined(USE_X11) && !defined(OS_NACL)
-#include "base/message_loop/message_pump_aurax11.h"
+#include "base/message_pump_aurax11.h"
#elif defined(USE_OZONE) && !defined(OS_NACL)
-#include "base/message_loop/message_pump_ozone.h"
+#include "base/message_pump_ozone.h"
#else
-#include "base/message_loop/message_pump_gtk.h"
+#include "base/message_pump_gtk.h"
#endif
#endif
#endif
namespace base {
-
class HistogramBase;
class MessageLoopLockTest;
class RunLoop;
@@ -84,12 +83,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 MessagePump::Delegate {
+class BASE_EXPORT MessageLoop : public base::MessagePump::Delegate {
public:
#if !defined(OS_MACOSX) && !defined(OS_ANDROID)
- typedef MessagePumpDispatcher Dispatcher;
- typedef MessagePumpObserver Observer;
+ typedef base::MessagePumpDispatcher Dispatcher;
+ typedef base::MessagePumpObserver Observer;
#endif
// A MessageLoop has a particular type, which indicates the set of
@@ -122,7 +121,7 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate {
static void EnableHistogrammer(bool enable_histogrammer);
- typedef MessagePump* (MessagePumpFactory)();
+ typedef base::MessagePump* (MessagePumpFactory)();
// Uses the given base::MessagePumpForUIFactory to override the default
// MessagePump implementation for 'TYPE_UI'. Returns true if the factory
// was successfully registered.
@@ -175,22 +174,27 @@ class BASE_EXPORT MessageLoop : public 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 Closure& task);
+ void PostTask(
+ const tracked_objects::Location& from_here,
+ const base::Closure& task);
- bool TryPostTask(const tracked_objects::Location& from_here,
- const Closure& task);
+ bool TryPostTask(
+ const tracked_objects::Location& from_here,
+ const base::Closure& task);
- void PostDelayedTask(const tracked_objects::Location& from_here,
- const Closure& task,
- TimeDelta delay);
+ void PostDelayedTask(
+ const tracked_objects::Location& from_here,
+ const base::Closure& task,
+ base::TimeDelta delay);
- void PostNonNestableTask(const tracked_objects::Location& from_here,
- const Closure& task);
+ void PostNonNestableTask(
+ const tracked_objects::Location& from_here,
+ const base::Closure& task);
- void PostNonNestableDelayedTask(const tracked_objects::Location& from_here,
- const Closure& task,
- TimeDelta delay);
+ void PostNonNestableDelayedTask(
+ const tracked_objects::Location& from_here,
+ const base::Closure& task,
+ base::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
@@ -260,12 +264,12 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate {
void QuitNow();
// TODO(jbates) remove this. crbug.com/131220. See QuitWhenIdleClosure().
- static Closure QuitClosure() { return QuitWhenIdleClosure(); }
+ static base::Closure QuitClosure() { return QuitWhenIdleClosure(); }
// Deprecated: use RunLoop instead.
// Construct a Closure that will call QuitWhenIdle(). Useful to schedule an
// arbitrary MessageLoop to QuitWhenIdle.
- static Closure QuitWhenIdleClosure();
+ static base::Closure QuitWhenIdleClosure();
// Returns true if this loop is |type|. This allows subclasses (especially
// those in tests) to specialize how they are identified.
@@ -282,7 +286,7 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate {
const std::string& thread_name() const { return thread_name_; }
// Gets the message loop proxy associated with this message loop.
- scoped_refptr<MessageLoopProxy> message_loop_proxy() {
+ scoped_refptr<base::MessageLoopProxy> message_loop_proxy() {
return message_loop_proxy_.get();
}
@@ -345,10 +349,10 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate {
TaskObserver();
// This method is called before processing a task.
- virtual void WillProcessTask(const PendingTask& pending_task) = 0;
+ virtual void WillProcessTask(const base::PendingTask& pending_task) = 0;
// This method is called after processing a task.
- virtual void DidProcessTask(const PendingTask& pending_task) = 0;
+ virtual void DidProcessTask(const base::PendingTask& pending_task) = 0;
protected:
virtual ~TaskObserver();
@@ -393,20 +397,20 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate {
protected:
#if defined(OS_WIN)
- MessagePumpWin* pump_win() {
- return static_cast<MessagePumpWin*>(pump_.get());
+ base::MessagePumpWin* pump_win() {
+ return static_cast<base::MessagePumpWin*>(pump_.get());
}
#elif defined(OS_POSIX) && !defined(OS_IOS)
- MessagePumpLibevent* pump_libevent() {
- return static_cast<MessagePumpLibevent*>(pump_.get());
+ base::MessagePumpLibevent* pump_libevent() {
+ return static_cast<base::MessagePumpLibevent*>(pump_.get());
}
#endif
- scoped_refptr<MessagePump> pump_;
+ scoped_refptr<base::MessagePump> pump_;
private:
- friend class RunLoop;
- friend class MessageLoopLockTest;
+ friend class base::RunLoop;
+ friend class base::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
@@ -427,14 +431,14 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate {
bool ProcessNextDelayedNonNestableTask();
// Runs the specified PendingTask.
- void RunTask(const PendingTask& pending_task);
+ void RunTask(const base::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 PendingTask& pending_task);
+ bool DeferOrRunPendingTask(const base::PendingTask& pending_task);
// Adds the pending task to delayed_work_queue_.
- void AddToDelayedWorkQueue(const PendingTask& pending_task);
+ void AddToDelayedWorkQueue(const base::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.
@@ -450,7 +454,7 @@ class BASE_EXPORT MessageLoop : public 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(PendingTask* pending_task, bool use_try_lock);
+ bool AddToIncomingQueue(base::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
@@ -463,7 +467,7 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate {
bool DeletePendingTasks();
// Calculates the time at which a PendingTask should run.
- TimeTicks CalculateDelayedRuntime(TimeDelta delay);
+ base::TimeTicks CalculateDelayedRuntime(base::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.
@@ -474,27 +478,27 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate {
// If message_histogram_ is NULL, this is a no-op.
void HistogramEvent(int event);
- // MessagePump::Delegate methods:
+ // base::MessagePump::Delegate methods:
virtual bool DoWork() OVERRIDE;
- virtual bool DoDelayedWork(TimeTicks* next_delayed_work_time) OVERRIDE;
+ virtual bool DoDelayedWork(base::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.
- TaskQueue work_queue_;
+ base::TaskQueue work_queue_;
// Contains delayed tasks, sorted by their 'delayed_run_time' property.
- DelayedTaskQueue delayed_work_queue_;
+ base::DelayedTaskQueue delayed_work_queue_;
// A recent snapshot of Time::Now(), used to check delayed_work_queue_.
- TimeTicks recent_time_;
+ base::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.
- TaskQueue deferred_non_nestable_work_queue_;
+ base::TaskQueue deferred_non_nestable_work_queue_;
ObserverList<DestructionObserver> destruction_observers_;
@@ -506,19 +510,19 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate {
std::string thread_name_;
// A profiling histogram showing the counts of various messages and events.
- HistogramBase* message_histogram_;
+ base::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_.
- TaskQueue incoming_queue_;
+ base::TaskQueue incoming_queue_;
// Protect access to incoming_queue_.
- mutable Lock incoming_queue_lock_;
+ mutable base::Lock incoming_queue_lock_;
- RunLoop* run_loop_;
+ base::RunLoop* run_loop_;
#if defined(OS_WIN)
- TimeTicks high_resolution_timer_expiration_;
+ base::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_;
@@ -531,8 +535,8 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate {
ObserverList<TaskObserver> task_observers_;
// The message loop proxy associated with this message loop, if one exists.
- scoped_refptr<MessageLoopProxy> message_loop_proxy_;
- scoped_ptr<ThreadTaskRunnerHandle> thread_task_runner_handle_;
+ scoped_refptr<base::MessageLoopProxy> message_loop_proxy_;
+ scoped_ptr<base::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;
@@ -557,7 +561,7 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate {
class BASE_EXPORT MessageLoopForUI : public MessageLoop {
public:
#if defined(OS_WIN)
- typedef MessagePumpForUI::MessageFilter MessageFilter;
+ typedef base::MessagePumpForUI::MessageFilter MessageFilter;
#endif
MessageLoopForUI() : MessageLoop(TYPE_UI) {
@@ -603,15 +607,15 @@ class BASE_EXPORT MessageLoopForUI : public MessageLoop {
protected:
#if defined(USE_AURA) && defined(USE_X11) && !defined(OS_NACL)
- friend class MessagePumpAuraX11;
+ friend class base::MessagePumpAuraX11;
#endif
#if defined(USE_OZONE) && !defined(OS_NACL)
- friend class MessagePumpOzone;
+ friend class base::MessagePumpOzone;
#endif
// TODO(rvargas): Make this platform independent.
- MessagePumpForUI* pump_ui() {
- return static_cast<MessagePumpForUI*>(pump_.get());
+ base::MessagePumpForUI* pump_ui() {
+ return static_cast<base::MessagePumpForUI*>(pump_.get());
}
#endif // !defined(OS_MACOSX)
};
@@ -632,30 +636,30 @@ COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForUI),
class BASE_EXPORT MessageLoopForIO : public MessageLoop {
public:
#if defined(OS_WIN)
- typedef MessagePumpForIO::IOHandler IOHandler;
- typedef MessagePumpForIO::IOContext IOContext;
- typedef MessagePumpForIO::IOObserver IOObserver;
+ typedef base::MessagePumpForIO::IOHandler IOHandler;
+ typedef base::MessagePumpForIO::IOContext IOContext;
+ typedef base::MessagePumpForIO::IOObserver IOObserver;
#elif defined(OS_IOS)
- typedef MessagePumpIOSForIO::Watcher Watcher;
- typedef MessagePumpIOSForIO::FileDescriptorWatcher
+ typedef base::MessagePumpIOSForIO::Watcher Watcher;
+ typedef base::MessagePumpIOSForIO::FileDescriptorWatcher
FileDescriptorWatcher;
- typedef MessagePumpIOSForIO::IOObserver IOObserver;
+ typedef base::MessagePumpIOSForIO::IOObserver IOObserver;
enum Mode {
- WATCH_READ = MessagePumpIOSForIO::WATCH_READ,
- WATCH_WRITE = MessagePumpIOSForIO::WATCH_WRITE,
- WATCH_READ_WRITE = MessagePumpIOSForIO::WATCH_READ_WRITE
+ WATCH_READ = base::MessagePumpIOSForIO::WATCH_READ,
+ WATCH_WRITE = base::MessagePumpIOSForIO::WATCH_WRITE,
+ WATCH_READ_WRITE = base::MessagePumpIOSForIO::WATCH_READ_WRITE
};
#elif defined(OS_POSIX)
- typedef MessagePumpLibevent::Watcher Watcher;
- typedef MessagePumpLibevent::FileDescriptorWatcher
+ typedef base::MessagePumpLibevent::Watcher Watcher;
+ typedef base::MessagePumpLibevent::FileDescriptorWatcher
FileDescriptorWatcher;
- typedef MessagePumpLibevent::IOObserver IOObserver;
+ typedef base::MessagePumpLibevent::IOObserver IOObserver;
enum Mode {
- WATCH_READ = MessagePumpLibevent::WATCH_READ,
- WATCH_WRITE = MessagePumpLibevent::WATCH_WRITE,
- WATCH_READ_WRITE = MessagePumpLibevent::WATCH_READ_WRITE
+ WATCH_READ = base::MessagePumpLibevent::WATCH_READ,
+ WATCH_WRITE = base::MessagePumpLibevent::WATCH_WRITE,
+ WATCH_READ_WRITE = base::MessagePumpLibevent::WATCH_READ_WRITE
};
#endif
@@ -686,8 +690,8 @@ class BASE_EXPORT MessageLoopForIO : public MessageLoop {
protected:
// TODO(rvargas): Make this platform independent.
- MessagePumpForIO* pump_io() {
- return static_cast<MessagePumpForIO*>(pump_.get());
+ base::MessagePumpForIO* pump_io() {
+ return static_cast<base::MessagePumpForIO*>(pump_.get());
}
#elif defined(OS_IOS)
@@ -699,8 +703,8 @@ class BASE_EXPORT MessageLoopForIO : public MessageLoop {
Watcher *delegate);
private:
- MessagePumpIOSForIO* pump_io() {
- return static_cast<MessagePumpIOSForIO*>(pump_.get());
+ base::MessagePumpIOSForIO* pump_io() {
+ return static_cast<base::MessagePumpIOSForIO*>(pump_.get());
}
#elif defined(OS_POSIX)
@@ -712,8 +716,8 @@ class BASE_EXPORT MessageLoopForIO : public MessageLoop {
Watcher* delegate);
private:
- MessagePumpLibevent* pump_io() {
- return static_cast<MessagePumpLibevent*>(pump_.get());
+ base::MessagePumpLibevent* pump_io() {
+ return static_cast<base::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 504c8e3..0f85b14 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/message_loop.h"
+#include "base/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_loop/message_pump_win.h"
+#include "base/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,
- WaitableEvent* caller_wait,
- WaitableEvent* caller_signal) {
+ base::WaitableEvent* caller_wait,
+ base::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,
- Bind(&MessageLoopLockTest::LockWaitUnLock,
+ base::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 MessageLoopForUI::Dispatcher {
+class DispatcherImpl : public base::MessageLoopForUI::Dispatcher {
public:
DispatcherImpl() : dispatch_count_(0) {}
diff --git a/base/message_loop/message_pump.cc b/base/message_pump.cc
index 7ffc2b1..de7c517 100644
--- a/base/message_loop/message_pump.cc
+++ b/base/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_loop/message_pump.h"
+#include "base/message_pump.h"
namespace base {
diff --git a/base/message_loop/message_pump.h b/base/message_pump.h
index 5b72232..b2e0a42 100644
--- a/base/message_loop/message_pump.h
+++ b/base/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_LOOP_MESSAGE_PUMP_H_
-#define BASE_MESSAGE_LOOP_MESSAGE_PUMP_H_
+#ifndef BASE_MESSAGE_PUMP_H_
+#define BASE_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_LOOP_MESSAGE_PUMP_H_
+#endif // BASE_MESSAGE_PUMP_H_
diff --git a/base/message_loop/message_pump_android.cc b/base/message_pump_android.cc
index 7374d9c..f02da67e 100644
--- a/base/message_loop/message_pump_android.cc
+++ b/base/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_loop/message_pump_android.h"
+#include "base/message_pump_android.h"
#include <jni.h>
@@ -18,7 +18,7 @@ using base::android::ScopedJavaLocalRef;
namespace {
-LazyInstance<android::ScopedJavaGlobalRef<jobject> >
+base::LazyInstance<base::android::ScopedJavaGlobalRef<jobject> >
g_system_message_handler_obj = LAZY_INSTANCE_INITIALIZER;
} // namespace
@@ -75,7 +75,7 @@ void MessagePumpForUI::Run(Delegate* delegate) {
}
void MessagePumpForUI::Start(Delegate* delegate) {
- run_loop_ = new RunLoop();
+ run_loop_ = new base::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 - TimeTicks::Now()).InMillisecondsRoundedUp();
+ (delayed_work_time - base::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_loop/message_pump_android.h b/base/message_pump_android.h
index fd934a7..5ef4bd6 100644
--- a/base/message_loop/message_pump_android.h
+++ b/base/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_LOOP_MESSAGE_PUMP_ANDROID_H_
-#define BASE_MESSAGE_LOOP_MESSAGE_PUMP_ANDROID_H_
+#ifndef BASE_MESSAGE_PUMP_ANDROID_H_
+#define BASE_MESSAGE_PUMP_ANDROID_H_
#include <jni.h>
#include "base/base_export.h"
#include "base/compiler_specific.h"
-#include "base/message_loop/message_pump.h"
+#include "base/message_pump.h"
namespace base {
@@ -35,11 +35,11 @@ class BASE_EXPORT MessagePumpForUI : public MessagePump {
virtual ~MessagePumpForUI();
private:
- RunLoop* run_loop_;
+ base::RunLoop* run_loop_;
DISALLOW_COPY_AND_ASSIGN(MessagePumpForUI);
};
} // namespace base
-#endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_ANDROID_H_
+#endif // BASE_MESSAGE_PUMP_ANDROID_H_
diff --git a/base/message_loop/message_pump_aurax11.cc b/base/message_pump_aurax11.cc
index 70cae64..9ba7989 100644
--- a/base/message_loop/message_pump_aurax11.cc
+++ b/base/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_loop/message_pump_aurax11.h"
+#include "base/message_pump_aurax11.h"
#include <glib.h>
#include <X11/X.h>
@@ -12,12 +12,10 @@
#include "base/basictypes.h"
#include "base/message_loop.h"
-namespace base {
-
namespace {
gboolean XSourcePrepare(GSource* source, gint* timeout_ms) {
- if (XPending(MessagePumpAuraX11::GetDefaultXDisplay()))
+ if (XPending(base::MessagePumpAuraX11::GetDefaultXDisplay()))
*timeout_ms = 0;
else
*timeout_ms = -1;
@@ -25,13 +23,13 @@ gboolean XSourcePrepare(GSource* source, gint* timeout_ms) {
}
gboolean XSourceCheck(GSource* source) {
- return XPending(MessagePumpAuraX11::GetDefaultXDisplay());
+ return XPending(base::MessagePumpAuraX11::GetDefaultXDisplay());
}
gboolean XSourceDispatch(GSource* source,
GSourceFunc unused_func,
gpointer data) {
- MessagePumpAuraX11* pump = static_cast<MessagePumpAuraX11*>(data);
+ base::MessagePumpAuraX11* pump = static_cast<base::MessagePumpAuraX11*>(data);
return pump->DispatchXEvents();
}
@@ -54,7 +52,7 @@ Display* g_xdisplay = NULL;
int g_xinput_opcode = -1;
bool InitializeXInput2Internal() {
- Display* display = MessagePumpAuraX11::GetDefaultXDisplay();
+ Display* display = base::MessagePumpAuraX11::GetDefaultXDisplay();
if (!display)
return false;
@@ -88,7 +86,7 @@ bool InitializeXInput2Internal() {
return true;
}
-Window FindEventTarget(const NativeEvent& xev) {
+Window FindEventTarget(const base::NativeEvent& xev) {
Window target = xev->xany.window;
if (xev->type == GenericEvent &&
static_cast<XIEvent*>(xev->xcookie.data)->extension == g_xinput_opcode) {
@@ -103,7 +101,7 @@ bool InitializeXInput2() {
}
bool InitializeXkb() {
- Display* display = MessagePumpAuraX11::GetDefaultXDisplay();
+ Display* display = base::MessagePumpAuraX11::GetDefaultXDisplay();
if (!display)
return false;
@@ -128,6 +126,8 @@ 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 NativeEvent& xev) const {
+ const base::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 NativeEvent& xev) {
+bool MessagePumpAuraX11::Dispatch(const base::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_loop/message_pump_aurax11.h b/base/message_pump_aurax11.h
index cec6934..486de4f 100644
--- a/base/message_loop/message_pump_aurax11.h
+++ b/base/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_LOOP_MESSAGE_PUMP_AURAX11_H
-#define BASE_MESSAGE_LOOP_MESSAGE_PUMP_AURAX11_H
+#ifndef BASE_MESSAGE_PUMP_AURAX11_H
+#define BASE_MESSAGE_PUMP_AURAX11_H
#include <bitset>
#include <map>
#include "base/memory/scoped_ptr.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/message_pump.h"
+#include "base/message_pump_glib.h"
+#include "base/message_pump_dispatcher.h"
+#include "base/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,10 +92,11 @@ class BASE_EXPORT MessagePumpAuraX11 : public MessagePumpGlib,
void DidProcessXEvent(XEvent* xevent);
// Returns the Dispatcher based on the event's target window.
- MessagePumpDispatcher* GetDispatcherForXEvent(const NativeEvent& xev) const;
+ MessagePumpDispatcher* GetDispatcherForXEvent(
+ const base::NativeEvent& xev) const;
// Overridden from MessagePumpDispatcher:
- virtual bool Dispatch(const NativeEvent& event) OVERRIDE;
+ virtual bool Dispatch(const base::NativeEvent& event) OVERRIDE;
// The event source for X events.
GSource* x_source_;
@@ -119,4 +120,4 @@ typedef MessagePumpAuraX11 MessagePumpForUI;
} // namespace base
-#endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_AURAX11_H
+#endif // BASE_MESSAGE_PUMP_AURAX11_H
diff --git a/base/message_loop/message_pump_default.cc b/base/message_pump_default.cc
index b36ff21..649e2aa 100644
--- a/base/message_loop/message_pump_default.cc
+++ b/base/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_loop/message_pump_default.h"
+#include "base/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;
- ThreadRestrictions::ScopedAllowWait allow_wait;
+ base::ThreadRestrictions::ScopedAllowWait allow_wait;
if (delayed_work_time_.is_null()) {
event_.Wait();
} else {
diff --git a/base/message_loop/message_pump_default.h b/base/message_pump_default.h
index dd65973..6deec99 100644
--- a/base/message_loop/message_pump_default.h
+++ b/base/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_LOOP_MESSAGE_PUMP_DEFAULT_H_
-#define BASE_MESSAGE_LOOP_MESSAGE_PUMP_DEFAULT_H_
+#ifndef BASE_MESSAGE_PUMP_DEFAULT_H_
+#define BASE_MESSAGE_PUMP_DEFAULT_H_
-#include "base/message_loop/message_pump.h"
-#include "base/synchronization/waitable_event.h"
+#include "base/message_pump.h"
#include "base/time.h"
+#include "base/synchronization/waitable_event.h"
namespace base {
@@ -39,4 +39,4 @@ class MessagePumpDefault : public MessagePump {
} // namespace base
-#endif // BASE__MESSAGE_LOOPMESSAGE_PUMP_DEFAULT_H_
+#endif // BASE_MESSAGE_PUMP_DEFAULT_H_
diff --git a/base/message_loop/message_pump_dispatcher.h b/base/message_pump_dispatcher.h
index e49fa4f..c3ccf3c0 100644
--- a/base/message_loop/message_pump_dispatcher.h
+++ b/base/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_LOOP_MESSAGE_PUMP_DISPATCHER_H
-#define BASE_MESSAGE_LOOP_MESSAGE_PUMP_DISPATCHER_H
+#ifndef BASE_MESSAGE_PUMP_DISPATCHER_H
+#define BASE_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_LOOP_MESSAGE_PUMP_DISPATCHER_H
+#endif // BASE_MESSAGE_PUMP_DISPATCHER_H
diff --git a/base/message_loop/message_pump_glib.cc b/base/message_pump_glib.cc
index de012fd..7436558 100644
--- a/base/message_loop/message_pump_glib.cc
+++ b/base/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_loop/message_pump_glib.h"
+#include "base/message_pump_glib.h"
#include <fcntl.h>
#include <math.h>
@@ -13,13 +13,11 @@
#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 TimeTicks& from) {
+int GetTimeIntervalMilliseconds(const base::TimeTicks& from) {
if (from.is_null())
return -1;
@@ -27,7 +25,7 @@ int GetTimeIntervalMilliseconds(const 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 - TimeTicks::Now()).InMillisecondsF()));
+ ceil((from - base::TimeTicks::Now()).InMillisecondsF()));
// If this value is negative, then we need to run delayed work soon.
return delay < 0 ? 0 : delay;
@@ -83,7 +81,7 @@ int GetTimeIntervalMilliseconds(const TimeTicks& from) {
// loop, around event handling.
struct WorkSource : public GSource {
- MessagePumpGlib* pump;
+ base::MessagePumpGlib* pump;
};
gboolean WorkSourcePrepare(GSource* source,
@@ -119,6 +117,9 @@ GSourceFuncs WorkSourceFuncs = {
} // namespace
+
+namespace base {
+
struct MessagePumpGlib::RunState {
Delegate* delegate;
MessagePumpDispatcher* dispatcher;
@@ -165,8 +166,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 PlatformThreadId thread_id = PlatformThread::CurrentId();
- DCHECK(thread_id == PlatformThread::CurrentId()) <<
+ static base::PlatformThreadId thread_id = base::PlatformThread::CurrentId();
+ DCHECK(thread_id == base::PlatformThread::CurrentId()) <<
"Running MessagePumpGlib on two different threads; "
"this is unsupported by GLib!";
#endif
diff --git a/base/message_loop/message_pump_glib.h b/base/message_pump_glib.h
index e45591b..48afb55 100644
--- a/base/message_loop/message_pump_glib.h
+++ b/base/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_LOOP_MESSAGE_PUMP_GLIB_H_
-#define BASE_MESSAGE_LOOP_MESSAGE_PUMP_GLIB_H_
+#ifndef BASE_MESSAGE_PUMP_GLIB_H_
+#define BASE_MESSAGE_PUMP_GLIB_H_
#include "base/base_export.h"
#include "base/memory/scoped_ptr.h"
-#include "base/message_loop/message_pump.h"
+#include "base/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_LOOP_MESSAGE_PUMP_GLIB_H_
+#endif // BASE_MESSAGE_PUMP_GLIB_H_
diff --git a/base/message_loop/message_pump_glib_unittest.cc b/base/message_pump_glib_unittest.cc
index cb30bb0..be11c2f 100644
--- a/base/message_loop/message_pump_glib_unittest.cc
+++ b/base/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_loop/message_pump_glib.h"
+#include "base/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;
- TimeDelta delta = events_[0].time - Time::NowFromSystemTime();
+ base::TimeDelta delta = events_[0].time - base::Time::NowFromSystemTime();
return std::max(0, static_cast<int>(ceil(delta.InMillisecondsF())));
}
bool HandleCheck() {
if (events_.empty())
return false;
- return events_[0].time <= Time::NowFromSystemTime();
+ return events_[0].time <= base::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 Closure& callback) {
- AddEventHelper(delay_ms, callback, Closure());
+ void AddEvent(int delay_ms, const base::Closure& callback) {
+ AddEventHelper(delay_ms, callback, base::Closure());
}
void AddDummyEvent(int delay_ms) {
- AddEventHelper(delay_ms, Closure(), Closure());
+ AddEventHelper(delay_ms, base::Closure(), base::Closure());
}
- void AddEventAsTask(int delay_ms, const Closure& task) {
- AddEventHelper(delay_ms, Closure(), task);
+ void AddEventAsTask(int delay_ms, const base::Closure& task) {
+ AddEventHelper(delay_ms, base::Closure(), task);
}
void Reset() {
@@ -92,9 +92,9 @@ class EventInjector {
private:
struct Event {
- Time time;
- Closure callback;
- Closure task;
+ base::Time time;
+ base::Closure callback;
+ base::Closure task;
};
struct Source : public GSource {
@@ -102,14 +102,14 @@ class EventInjector {
};
void AddEventHelper(
- int delay_ms, const Closure& callback, const Closure& task) {
- Time last_time;
+ int delay_ms, const base::Closure& callback, const base::Closure& task) {
+ base::Time last_time;
if (!events_.empty())
last_time = (events_.end()-1)->time;
else
- last_time = Time::NowFromSystemTime();
+ last_time = base::Time::NowFromSystemTime();
- Time future = last_time + TimeDelta::FromMilliseconds(delay_ms);
+ base::Time future = last_time + base::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 Closure& task) {
+ const base::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, Bind(&DoNothing));
- Closure check_task =
- Bind(&ExpectProcessedEvents, Unretained(injector()), 2);
- Closure posted_task =
- Bind(&PostMessageLoopTask, FROM_HERE, check_task);
+ 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, posted_task);
- injector()->AddEventAsTask(0, Bind(&DoNothing));
+ injector()->AddEventAsTask(0, base::Bind(&base::DoNothing));
injector()->AddEvent(0, MessageLoop::QuitWhenIdleClosure());
loop()->Run();
EXPECT_EQ(4, injector()->processed_events());
injector()->Reset();
- injector()->AddEventAsTask(0, Bind(&DoNothing));
+ injector()->AddEventAsTask(0, base::Bind(&base::DoNothing));
check_task =
- Bind(&ExpectProcessedEvents, Unretained(injector()), 2);
- posted_task = Bind(&PostMessageLoopTask, FROM_HERE, check_task);
+ base::Bind(&ExpectProcessedEvents, base::Unretained(injector()), 2);
+ posted_task = base::Bind(&PostMessageLoopTask, FROM_HERE, check_task);
injector()->AddEventAsTask(0, posted_task);
- injector()->AddEventAsTask(10, Bind(&DoNothing));
+ injector()->AddEventAsTask(10, base::Bind(&base::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, Bind(&IncrementInt, &task_count));
+ loop()->PostTask(FROM_HERE, base::Bind(&IncrementInt, &task_count));
}
// After all the previous tasks have executed, enqueue an event that will
// quit.
loop()->PostTask(
FROM_HERE,
- Bind(&EventInjector::AddEvent, Unretained(injector()), 0,
+ base::Bind(&EventInjector::AddEvent, base::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,
- Bind(&IncrementInt, &task_count),
- TimeDelta::FromMilliseconds(10*i));
+ base::Bind(&IncrementInt, &task_count),
+ base::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,
- Bind(&EventInjector::AddEvent, Unretained(injector()), 10,
+ base::Bind(&EventInjector::AddEvent, base::Unretained(injector()), 10,
MessageLoop::QuitWhenIdleClosure()),
- TimeDelta::FromMilliseconds(150));
+ base::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).
- Closure check_task =
- Bind(&ExpectProcessedEvents, Unretained(injector()), 11);
- Closure posted_task =
- Bind(&PostMessageLoopTask, FROM_HERE, check_task);
+ base::Closure check_task =
+ base::Bind(&ExpectProcessedEvents, base::Unretained(injector()), 11);
+ base::Closure posted_task =
+ base::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 RefCounted<ConcurrentHelper> {
+class ConcurrentHelper : public base::RefCounted<ConcurrentHelper> {
public:
explicit ConcurrentHelper(EventInjector* injector)
: injector_(injector),
@@ -315,7 +315,7 @@ class ConcurrentHelper : public RefCounted<ConcurrentHelper> {
MessageLoop::current()->QuitWhenIdle();
} else {
MessageLoop::current()->PostTask(
- FROM_HERE, Bind(&ConcurrentHelper::FromTask, this));
+ FROM_HERE, base::Bind(&ConcurrentHelper::FromTask, this));
}
}
@@ -327,7 +327,7 @@ class ConcurrentHelper : public RefCounted<ConcurrentHelper> {
MessageLoop::current()->QuitWhenIdle();
} else {
injector_->AddEventAsTask(
- 0, Bind(&ConcurrentHelper::FromEvent, this));
+ 0, base::Bind(&ConcurrentHelper::FromEvent, this));
}
}
@@ -335,7 +335,7 @@ class ConcurrentHelper : public RefCounted<ConcurrentHelper> {
int task_count() const { return task_count_; }
private:
- friend class RefCounted<ConcurrentHelper>;
+ friend class base::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, Bind(&ConcurrentHelper::FromEvent, helper.get()));
+ 0, base::Bind(&ConcurrentHelper::FromEvent, helper.get()));
injector()->AddEventAsTask(
- 0, Bind(&ConcurrentHelper::FromEvent, helper.get()));
+ 0, base::Bind(&ConcurrentHelper::FromEvent, helper.get()));
// Similarly post 2 tasks.
loop()->PostTask(
- FROM_HERE, Bind(&ConcurrentHelper::FromTask, helper.get()));
+ FROM_HERE, base::Bind(&ConcurrentHelper::FromTask, helper.get()));
loop()->PostTask(
- FROM_HERE, Bind(&ConcurrentHelper::FromTask, helper.get()));
+ FROM_HERE, base::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, Bind(&DoNothing));
- MessageLoop::current()->PostTask(FROM_HERE, Bind(&DoNothing));
+ MessageLoop::current()->PostTask(FROM_HERE, base::Bind(&base::DoNothing));
+ MessageLoop::current()->PostTask(FROM_HERE, base::Bind(&base::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,
- Bind(&AddEventsAndDrainGLib, Unretained(injector())));
+ base::Bind(&AddEventsAndDrainGLib, base::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, Bind(&DoNothing));
- MessageLoop::current()->PostTask(FROM_HERE, Bind(&DoNothing));
+ MessageLoop::current()->PostTask(FROM_HERE, base::Bind(&base::DoNothing));
+ MessageLoop::current()->PostTask(FROM_HERE, base::Bind(&base::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,
- Bind(&AddEventsAndDrainGtk, Unretained(injector())));
+ base::Bind(&AddEventsAndDrainGtk, base::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 RefCounted<GLibLoopRunner> {
+class GLibLoopRunner : public base::RefCounted<GLibLoopRunner> {
public:
GLibLoopRunner() : quit_(false) { }
@@ -476,7 +476,7 @@ class GLibLoopRunner : public RefCounted<GLibLoopRunner> {
}
private:
- friend class RefCounted<GLibLoopRunner>;
+ friend class base::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, Bind(&IncrementInt, &task_count));
+ FROM_HERE, base::Bind(&IncrementInt, &task_count));
MessageLoop::current()->PostTask(
- FROM_HERE, Bind(&IncrementInt, &task_count));
+ FROM_HERE, base::Bind(&IncrementInt, &task_count));
// Delayed events
injector->AddDummyEvent(10);
injector->AddDummyEvent(10);
// Delayed work
MessageLoop::current()->PostDelayedTask(
FROM_HERE,
- Bind(&IncrementInt, &task_count),
- TimeDelta::FromMilliseconds(30));
+ base::Bind(&IncrementInt, &task_count),
+ base::TimeDelta::FromMilliseconds(30));
MessageLoop::current()->PostDelayedTask(
FROM_HERE,
- Bind(&GLibLoopRunner::Quit, runner.get()),
- TimeDelta::FromMilliseconds(40));
+ base::Bind(&GLibLoopRunner::Quit, runner.get()),
+ base::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, Bind(&IncrementInt, &task_count));
+ FROM_HERE, base::Bind(&IncrementInt, &task_count));
MessageLoop::current()->PostTask(
- FROM_HERE, Bind(&IncrementInt, &task_count));
+ FROM_HERE, base::Bind(&IncrementInt, &task_count));
// Delayed events
injector->AddDummyEvent(10);
injector->AddDummyEvent(10);
// Delayed work
MessageLoop::current()->PostDelayedTask(
FROM_HERE,
- Bind(&IncrementInt, &task_count),
- TimeDelta::FromMilliseconds(30));
+ base::Bind(&IncrementInt, &task_count),
+ base::TimeDelta::FromMilliseconds(30));
MessageLoop::current()->PostDelayedTask(
FROM_HERE,
- Bind(&GLibLoopRunner::Quit, runner.get()),
- TimeDelta::FromMilliseconds(40));
+ base::Bind(&GLibLoopRunner::Quit, runner.get()),
+ base::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,
- Bind(&TestGLibLoopInternal, Unretained(injector())));
+ base::Bind(&TestGLibLoopInternal, base::Unretained(injector())));
loop()->Run();
}
@@ -573,7 +573,7 @@ TEST_F(MessagePumpGLibTest, TestGtkLoop) {
// between events and posted tasks.
loop()->PostTask(
FROM_HERE,
- Bind(&TestGtkLoopInternal, Unretained(injector())));
+ base::Bind(&TestGtkLoopInternal, base::Unretained(injector())));
loop()->Run();
}
diff --git a/base/message_loop/message_pump_gtk.cc b/base/message_pump_gtk.cc
index 8fa8cf2..780b4d8 100644
--- a/base/message_loop/message_pump_gtk.cc
+++ b/base/message_pump_gtk.cc
@@ -2,15 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/message_loop/message_pump_gtk.h"
+#include "base/message_pump_gtk.h"
#include <gtk/gtk.h>
#include <gdk/gdkx.h>
-#include "base/debug/trace_event.h"
#include "base/profiler/scoped_profile.h"
-
-namespace base {
+#include "base/debug/trace_event.h"
namespace {
@@ -59,7 +57,9 @@ const char* EventToTypeString(const GdkEvent* event) {
}
}
-} // namespace
+}
+
+namespace base {
MessagePumpGtk::MessagePumpGtk() : MessagePumpGlib() {
gdk_event_handler_set(&EventDispatcher, this, NULL);
diff --git a/base/message_loop/message_pump_gtk.h b/base/message_pump_gtk.h
index e22e04f..ba5cff1 100644
--- a/base/message_loop/message_pump_gtk.h
+++ b/base/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_LOOP_MESSAGE_PUMP_GTK_H_
-#define BASE_MESSAGE_LOOP_MESSAGE_PUMP_GTK_H_
+#ifndef BASE_MESSAGE_PUMP_GTK_H_
+#define BASE_MESSAGE_PUMP_GTK_H_
-#include "base/message_loop/message_pump_glib.h"
+#include "base/message_pump_glib.h"
typedef union _GdkEvent GdkEvent;
typedef struct _XDisplay Display;
@@ -73,4 +73,4 @@ typedef MessagePumpGtk MessagePumpForUI;
} // namespace base
-#endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_GTK_H_
+#endif // BASE_MESSAGE_PUMP_GTK_H_
diff --git a/base/message_loop/message_pump_io_ios.cc b/base/message_pump_io_ios.cc
index 5868195..ca800ff 100644
--- a/base/message_loop/message_pump_io_ios.cc
+++ b/base/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_loop/message_pump_io_ios.h"
+#include "base/message_pump_io_ios.h"
namespace base {
diff --git a/base/message_loop/message_pump_io_ios.h b/base/message_pump_io_ios.h
index 3aaf037..81f529d 100644
--- a/base/message_loop/message_pump_io_ios.h
+++ b/base/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_LOOP_MESSAGE_PUMP_IO_IOS_H_
-#define BASE_MESSAGE_LOOP_MESSAGE_PUMP_IO_IOS_H_
+#ifndef BASE_MESSAGE_PUMP_IO_IOS_H_
+#define BASE_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_loop/message_pump_mac.h"
+#include "base/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_LOOP_MESSAGE_PUMP_IO_IOS_H_
+#endif // BASE_MESSAGE_PUMP_IO_IOS_H_
diff --git a/base/message_loop/message_pump_io_ios_unittest.cc b/base/message_pump_io_ios_unittest.cc
index 9e94c6b..7a00d11 100644
--- a/base/message_loop/message_pump_io_ios_unittest.cc
+++ b/base/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_loop/message_pump_io_ios.h"
+#include "base/message_pump_io_ios.h"
#include <unistd.h>
diff --git a/base/message_loop/message_pump_libevent.cc b/base/message_pump_libevent.cc
index 8de0db2..364f44a 100644
--- a/base/message_loop/message_pump_libevent.cc
+++ b/base/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_loop/message_pump_libevent.h"
+#include "base/message_pump_libevent.h"
#include <errno.h>
#include <fcntl.h>
@@ -11,6 +11,9 @@
#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"
@@ -218,7 +221,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!";
- AutoReset<bool> auto_reset_in_run(&in_run_, true);
+ base::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().
@@ -340,7 +343,7 @@ bool MessagePumpLibevent::Init() {
// static
void MessagePumpLibevent::OnLibeventNotification(int fd, short flags,
void* context) {
- WeakPtr<FileDescriptorWatcher> controller =
+ base::WeakPtr<FileDescriptorWatcher> controller =
static_cast<FileDescriptorWatcher*>(context)->weak_factory_.GetWeakPtr();
DCHECK(controller.get());
@@ -360,7 +363,8 @@ 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) {
- MessagePumpLibevent* that = static_cast<MessagePumpLibevent*>(context);
+ base::MessagePumpLibevent* that =
+ static_cast<base::MessagePumpLibevent*>(context);
DCHECK(that->wakeup_pipe_out_ == socket);
// Remove and discard the wakeup byte.
diff --git a/base/message_loop/message_pump_libevent.h b/base/message_pump_libevent.h
index a54ef88..90e8510 100644
--- a/base/message_loop/message_pump_libevent.h
+++ b/base/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_LOOP_MESSAGE_PUMP_LIBEVENT_H_
-#define BASE_MESSAGE_LOOP_MESSAGE_PUMP_LIBEVENT_H_
+#ifndef BASE_MESSAGE_PUMP_LIBEVENT_H_
+#define BASE_MESSAGE_PUMP_LIBEVENT_H_
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/memory/weak_ptr.h"
-#include "base/message_loop/message_pump.h"
+#include "base/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_;
- WeakPtrFactory<FileDescriptorWatcher> weak_factory_;
+ base::WeakPtrFactory<FileDescriptorWatcher> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(FileDescriptorWatcher);
};
@@ -176,4 +176,4 @@ class BASE_EXPORT MessagePumpLibevent : public MessagePump {
} // namespace base
-#endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_LIBEVENT_H_
+#endif // BASE_MESSAGE_PUMP_LIBEVENT_H_
diff --git a/base/message_loop/message_pump_libevent_unittest.cc b/base/message_pump_libevent_unittest.cc
index 657ac7d..cd423af 100644
--- a/base/message_loop/message_pump_libevent_unittest.cc
+++ b/base/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_loop/message_pump_libevent.h"
+#include "base/message_pump_libevent.h"
#include <unistd.h>
-#include "base/message_loop/message_loop.h"
+#include "base/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_loop/message_pump_mac.h b/base/message_pump_mac.h
index 68c2a3d..2dd5ecf 100644
--- a/base/message_loop/message_pump_mac.h
+++ b/base/message_pump_mac.h
@@ -27,10 +27,10 @@
// or NSRunLoop-based MessagePump subclass depending on which thread it is
// called on.
-#ifndef BASE_MESSAGE_LOOP_MESSAGE_PUMP_MAC_H_
-#define BASE_MESSAGE_LOOP_MESSAGE_PUMP_MAC_H_
+#ifndef BASE_MESSAGE_PUMP_MAC_H_
+#define BASE_MESSAGE_PUMP_MAC_H_
-#include "base/message_loop/message_pump.h"
+#include "base/message_pump.h"
#include <CoreFoundation/CoreFoundation.h>
@@ -257,7 +257,7 @@ class MessagePumpUIApplication : public MessagePumpCFRunLoopBase {
virtual ~MessagePumpUIApplication();
private:
- RunLoop* run_loop_;
+ base::RunLoop* run_loop_;
DISALLOW_COPY_AND_ASSIGN(MessagePumpUIApplication);
};
@@ -334,4 +334,4 @@ class MessagePumpMac {
} // namespace base
-#endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_MAC_H_
+#endif // BASE_MESSAGE_PUMP_MAC_H_
diff --git a/base/message_loop/message_pump_mac.mm b/base/message_pump_mac.mm
index a419d48..4a07cd4 100644
--- a/base/message_loop/message_pump_mac.mm
+++ b/base/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_loop/message_pump_mac.h"
+#import "base/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 RunLoop();
+ run_loop_ = new base::RunLoop();
CHECK(run_loop_->BeforeRun());
SetDelegate(delegate);
}
diff --git a/base/message_loop/message_pump_observer.h b/base/message_pump_observer.h
index cb46fa3..a7d2aa7 100644
--- a/base/message_loop/message_pump_observer.h
+++ b/base/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_LOOP_MESSAGE_PUMP_OBSERVER_H
-#define BASE_MESSAGE_LOOP_MESSAGE_PUMP_OBSERVER_H
+#ifndef BASE_MESSAGE_PUMP_OBSERVER_H
+#define BASE_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_LOOP_MESSAGE_PUMP_OBSERVER_H
+#endif // BASE_MESSAGE_PUMP_OBSERVER_VIEWS_H
diff --git a/base/message_loop/message_pump_ozone.cc b/base/message_pump_ozone.cc
index 5c0bf83..ca7f45d 100644
--- a/base/message_loop/message_pump_ozone.cc
+++ b/base/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_loop/message_pump_ozone.h"
+#include "base/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 NativeEvent& dev) {
+bool MessagePumpOzone::Dispatch(const base::NativeEvent& dev) {
if (dispatcher_.size() > 0)
return dispatcher_[0]->Dispatch(dev);
else
diff --git a/base/message_loop/message_pump_ozone.h b/base/message_pump_ozone.h
index de75ab4..8fb2f1d 100644
--- a/base/message_loop/message_pump_ozone.h
+++ b/base/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_LOOP_MESSAGE_PUMP_OZONE_H_
-#define BASE_MESSAGE_LOOP_MESSAGE_PUMP_OZONE_H_
+#ifndef BASE_MESSAGE_PUMP_OZONE_H_
+#define BASE_MESSAGE_PUMP_OZONE_H_
#include "base/memory/scoped_ptr.h"
#include "base/memory/scoped_vector.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/message_pump_dispatcher.h"
+#include "base/message_pump_libevent.h"
+#include "base/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 NativeEvent& event) OVERRIDE;
+ virtual bool Dispatch(const base::NativeEvent& event) OVERRIDE;
private:
virtual ~MessagePumpOzone();
@@ -49,4 +49,4 @@ typedef MessagePumpOzone MessagePumpForUI;
} // namespace base
-#endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_OZONE_H_
+#endif // BASE_MESSAGE_PUMP_OZONE_H_
diff --git a/base/message_loop/message_pump_win.cc b/base/message_pump_win.cc
index 36a3210..dcbb320 100644
--- a/base/message_loop/message_pump_win.cc
+++ b/base/message_pump_win.cc
@@ -2,19 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/message_loop/message_pump_win.h"
+#include "base/message_pump_win.h"
#include <math.h>
#include "base/debug/trace_event.h"
-#include "base/message_loop/message_loop.h"
+#include "base/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 {
@@ -26,6 +24,8 @@ 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_),
- GetModuleFromAddress(&WndProcThunk));
+ base::GetModuleFromAddress(&WndProcThunk));
}
void MessagePumpForUI::ScheduleWork() {
@@ -271,9 +271,9 @@ void MessagePumpForUI::DoRunLoop() {
void MessagePumpForUI::InitMessageWnd() {
// Generate a unique window class name.
- string16 class_name = StringPrintf(kWndClassFormat, this);
+ string16 class_name = base::StringPrintf(kWndClassFormat, this);
- HINSTANCE instance = GetModuleFromAddress(&WndProcThunk);
+ HINSTANCE instance = base::GetModuleFromAddress(&WndProcThunk);
WNDCLASSEX wc = {0};
wc.cbSize = sizeof(wc);
wc.lpfnWndProc = base::win::WrappedWindowProc<WndProcThunk>;
diff --git a/base/message_loop/message_pump_win.h b/base/message_pump_win.h
index dbb41bd..a76bcfb 100644
--- a/base/message_loop/message_pump_win.h
+++ b/base/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_LOOP_MESSAGE_PUMP_WIN_H_
-#define BASE_MESSAGE_LOOP_MESSAGE_PUMP_WIN_H_
+#ifndef BASE_MESSAGE_PUMP_WIN_H_
+#define BASE_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_loop/message_pump.h"
-#include "base/message_loop/message_pump_dispatcher.h"
-#include "base/message_loop/message_pump_observer.h"
+#include "base/message_pump.h"
+#include "base/message_pump_dispatcher.h"
+#include "base/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_LOOP_MESSAGE_PUMP_WIN_H_
+#endif // BASE_MESSAGE_PUMP_WIN_H_
diff --git a/base/test/mock_chrome_application_mac.h b/base/test/mock_chrome_application_mac.h
index ffa3080..5cd1d19 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_loop/message_pump_mac.h"
+#include "base/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 5180333..64da18a 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/message_loop.h"
-#include "base/message_loop/message_pump_android.h"
+#include "base/message_loop.h"
+#include "base/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 ebe6767..cb07f00 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/message_loop.h"
-#include "base/message_loop/message_pump_default.h"
+#include "base/message_loop.h"
+#include "base/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 704c1da..facd613 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_loop/message_pump_win.h"
+#include "base/message_pump_win.h"
#include "base/win/metro.h"
#include "base/win/scoped_comptr.h"