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

Unified Diff: base/time/time.h

Issue 1910063003: More accurate implementation of watched thread time for Gpu Watchdog. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed comment Created 4 years, 8 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 | « no previous file | base/time/time_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/time/time.h
diff --git a/base/time/time.h b/base/time/time.h
index 1989dbf8f27758e0643a3732859bcb62aca672c2..9fce71b581e4ca27c216e31cb40ab78b867760ea 100644
--- a/base/time/time.h
+++ b/base/time/time.h
@@ -74,12 +74,12 @@
// For FILETIME in FromFileTime, until it moves to a new converter class.
// See TODO(iyengar) below.
#include <windows.h>
-
#include "base/gtest_prod_util.h"
#endif
namespace base {
+class PlatformThreadHandle;
class TimeDelta;
// The functions in the time_internal namespace are meant to be used only by the
@@ -749,11 +749,18 @@ class BASE_EXPORT ThreadTicks : public time_internal::TimeBase<ThreadTicks> {
// absolutely needed, call WaitUntilInitialized() before this method.
static ThreadTicks Now();
+#if defined(OS_WIN)
+ // Similar to Now() above except this returns thread-specific CPU time for an
+ // arbitrary thread. All comments for Now() method above apply apply to this
+ // method as well.
+ static ThreadTicks GetForThread(const PlatformThreadHandle& thread_handle);
+#endif
+
private:
friend class time_internal::TimeBase<ThreadTicks>;
- // Please use Now() to create a new object. This is for internal use
- // and testing.
+ // Please use Now() or GetForThread() to create a new object. This is for
+ // internal use and testing.
explicit ThreadTicks(int64_t us) : TimeBase(us) {}
#if defined(OS_WIN)
« no previous file with comments | « no previous file | base/time/time_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698