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

Unified Diff: base/run_loop.cc

Issue 445413003: Creating a framework for suppressing pollution of the profiler data (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Clarifying terminology Created 6 years, 4 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
Index: base/run_loop.cc
diff --git a/base/run_loop.cc b/base/run_loop.cc
index 8344aa41b1631f6946e242e9ef0efbafdee23279..c28c50c8f74dc6c22f8cd17a67c949c47a5780b7 100644
--- a/base/run_loop.cc
+++ b/base/run_loop.cc
@@ -5,6 +5,7 @@
#include "base/run_loop.h"
#include "base/bind.h"
+#include "base/tracked_objects.h"
#if defined(OS_WIN)
#include "base/message_loop/message_pump_dispatcher.h"
@@ -46,7 +47,14 @@ RunLoop::~RunLoop() {
void RunLoop::Run() {
if (!BeforeRun())
return;
- loop_->RunHandler();
+ {
+ // Use task stopwatch to exclude the loop run time from the current task, if
+ // any.
+ tracked_objects::TaskStopwatch stopwatch;
+ stopwatch.Start(tracked_objects::ThreadData::Now());
+ loop_->RunHandler();
+ stopwatch.Stop(tracked_objects::ThreadData::Now());
+ }
AfterRun();
}

Powered by Google App Engine
This is Rietveld 408576698