Index: base/message_loop.cc |
diff --git a/base/message_loop.cc b/base/message_loop.cc |
index 7a09f38dd962ef19f31347bba8e0c0870af102c3..3b136170911b10952ec8bdc95325cf70b60f24c5 100644 |
--- a/base/message_loop.cc |
+++ b/base/message_loop.cc |
@@ -149,6 +149,16 @@ void MessageLoop::RemoveDestructionObserver(DestructionObserver *obs) { |
destruction_observers_.RemoveObserver(obs); |
} |
+void MessageLoop::AddTaskObserver(TaskObserver *obs) { |
+ DCHECK_EQ(this, current()); |
+ task_observers_.AddObserver(obs); |
+} |
+ |
+void MessageLoop::RemoveTaskObserver(TaskObserver *obs) { |
+ DCHECK_EQ(this, current()); |
+ task_observers_.RemoveObserver(obs); |
+} |
+ |
void MessageLoop::Run() { |
AutoRunState save_state(this); |
RunHandler(); |
@@ -325,7 +335,10 @@ void MessageLoop::RunTask(Task* task) { |
nestable_tasks_allowed_ = false; |
HistogramEvent(kTaskRunEvent); |
+ FOR_EACH_OBSERVER(TaskObserver, task_observers_, |
+ WillProcessTask(task->tracked_birth_time())); |
task->Run(); |
+ FOR_EACH_OBSERVER(TaskObserver, task_observers_, DidProcessTask()); |
delete task; |
nestable_tasks_allowed_ = true; |
@@ -584,16 +597,9 @@ const LinearHistogram::DescriptionPair MessageLoop::event_descriptions_[] = { |
// MessageLoopForUI |
#if defined(OS_WIN) |
-void MessageLoopForUI::WillProcessMessage(const MSG& message) { |
- pump_win()->WillProcessMessage(message); |
-} |
void MessageLoopForUI::DidProcessMessage(const MSG& message) { |
pump_win()->DidProcessMessage(message); |
} |
-void MessageLoopForUI::PumpOutPendingPaintMessages() { |
- pump_ui()->PumpOutPendingPaintMessages(); |
-} |
- |
#endif // defined(OS_WIN) |
#if !defined(OS_MACOSX) |