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

Unified Diff: base/tracked_objects.h

Issue 9212025: Support use of third party time function to profiler (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 10 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/tracked_objects.h
===================================================================
--- base/tracked_objects.h (revision 121705)
+++ base/tracked_objects.h (working copy)
@@ -17,6 +17,7 @@
#include "base/gtest_prod_util.h"
#include "base/lazy_instance.h"
#include "base/location.h"
+#include "base/profiler/alternate_timer.h"
#include "base/profiler/tracked_time.h"
#include "base/time.h"
#include "base/synchronization/lock.h"
@@ -469,6 +470,12 @@
// the code).
static TrackedTime Now();
+ // Use the function |now| to provide current times, instead of calling the
+ // TrackedTime::Now() function. Since this alternate function is being used,
+ // the other time arguments (used for calculating queueing delay) will be
+ // ignored.
+ static void SetAlternateTimeSource(NowFunction* now);
+
// This function can be called at process termination to validate that thread
// cleanup routines have been called for at least some number of named
// threads.
@@ -545,6 +552,10 @@
// ThreadData instances.
static void ShutdownSingleThreadedCleanup(bool leak);
+ // When non-null, this specifies an external function that supplies monotone
+ // increasing time functcion.
+ static NowFunction* now_function_;
+
// We use thread local store to identify which ThreadData to interact with.
static base::ThreadLocalStorage::StaticSlot tls_index_;

Powered by Google App Engine
This is Rietveld 408576698