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

Unified Diff: base/message_loop.cc

Issue 2098020: Jankometer: Generalize the code more. Add better support for monitoring IO thread. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Address darin's comments. Created 10 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/message_loop.h ('k') | base/message_loop_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « base/message_loop.h ('k') | base/message_loop_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698