summaryrefslogtreecommitdiffstats
path: root/base/message_loop.h
diff options
context:
space:
mode:
authorjoth@chromium.org <joth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-31 15:32:08 +0000
committerjoth@chromium.org <joth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-31 15:32:08 +0000
commit3f095c0a8f6a5ee43e205be6add05276c42bd240 (patch)
tree3b3e29d1814e7aad93304d09be237e9cd936b7e3 /base/message_loop.h
parenta0645703e4069c2def1dff4cca774ec47763d052 (diff)
downloadchromium_src-3f095c0a8f6a5ee43e205be6add05276c42bd240.zip
chromium_src-3f095c0a8f6a5ee43e205be6add05276c42bd240.tar.gz
chromium_src-3f095c0a8f6a5ee43e205be6add05276c42bd240.tar.bz2
Revert 107895 - Fully enable about:tracking by default
This is a re-land of: http://codereview.chromium.org/8391019/ Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=107793 Original landing had trouble with message_loop_x.h, due to header include ordering. I pulled out the structure that was really needed by tracked_objects.h into a new file tracked_info.*. This allows tracked_objects to inlude this tracked_info, but not have to include the message_loop.h totality. I also removed a DCHECK that that was triggering on a test, and added yet one more file (browser_main.cc) where I removed a #ifdef for TRACKING_ALL_OBJECTS. The changes were minor, and I'm hoping to get clear perf runs with tihs landing, so I'm going to TBR it and reland early in the morning. Comments from original landing: Support is now controlled by the flag: --enable-tracking and the default is always on. To turn it off, use: --enable-tracking=0 All profiler code is compiled now in release and official builds (in addition to debug, where it was already active), but most entry points can be disabled (turned into no-ops) by a single const bool setting atop tracked_objects.cc (in case folks want to revert the perf-impact of this change). Transition to faster Now() service on Windows for the profiler use only. The TimeTicks::Now() function on Window uses locking to get a 64 bit time value. This CL transitions times used for profiling to more directly use a 32 bit Time interface, which is actually what drives the 64 bit TimeTicks. By using the smaller value, we avoid the need for locks, or even atomic operations for the most part in the tracking system. On linux, we just down-sample the standard TimeTicks to 32 bits for consistency (clean ability to snapshot asyncronously without atomics... but I should verify that such is helpful to performance). I've also put in yet more cleanup and refactoring. tbr=rtenneti bug=101856 Review URL: http://codereview.chromium.org/8414036 TBR=jar@chromium.org Review URL: http://codereview.chromium.org/8430004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107961 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/message_loop.h')
-rw-r--r--base/message_loop.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/base/message_loop.h b/base/message_loop.h
index d94dc2f..732de03 100644
--- a/base/message_loop.h
+++ b/base/message_loop.h
@@ -19,7 +19,6 @@
#include "base/observer_list.h"
#include "base/synchronization/lock.h"
#include "base/task.h"
-#include "base/tracking_info.h"
#include "base/time.h"
#if defined(OS_WIN)
@@ -45,9 +44,11 @@ namespace base {
class Histogram;
}
+#if defined(TRACK_ALL_TASK_OBJECTS)
namespace tracked_objects {
class Births;
}
+#endif // defined(TRACK_ALL_TASK_OBJECTS)
// A MessageLoop is used to process events for a particular thread. There is
// at most one MessageLoop instance per thread.
@@ -409,7 +410,7 @@ class BASE_EXPORT MessageLoop : public base::MessagePump::Delegate {
#endif
// This structure is copied around by value.
- struct PendingTask : public base::TrackingInfo {
+ struct PendingTask {
PendingTask(const base::Closure& task,
const tracked_objects::Location& posted_from,
base::TimeTicks delayed_run_time,
@@ -422,6 +423,17 @@ class BASE_EXPORT MessageLoop : public base::MessagePump::Delegate {
// The task to run.
base::Closure task;
+#if defined(TRACK_ALL_TASK_OBJECTS)
+ // Counter for location where the Closure was posted from.
+ tracked_objects::Births* post_births;
+#endif // defined(TRACK_ALL_TASK_OBJECTS)
+
+ // Time this PendingTask was posted.
+ base::TimeTicks time_posted;
+
+ // The time when the task should be run.
+ base::TimeTicks delayed_run_time;
+
// The site this PendingTask was posted from.
tracked_objects::Location posted_from;