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

Unified Diff: third_party/WebKit/Source/core/timing/PerformanceBase.h

Issue 1352523002: Use high precision timestamp for Event.timestamp (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 5 years, 2 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: third_party/WebKit/Source/core/timing/PerformanceBase.h
diff --git a/third_party/WebKit/Source/core/timing/PerformanceBase.h b/third_party/WebKit/Source/core/timing/PerformanceBase.h
index 7b9644c2dd7c819ab12964d7a9cb499ccc6d3d9e..aa3e09748c3669f5b7ce0ee5b652a9caaa61343d 100644
--- a/third_party/WebKit/Source/core/timing/PerformanceBase.h
+++ b/third_party/WebKit/Source/core/timing/PerformanceBase.h
@@ -33,6 +33,7 @@
#define PerformanceBase_h
#include "core/CoreExport.h"
+#include "core/dom/DOMHighResTimeStamp.h"
#include "core/events/EventTarget.h"
#include "core/timing/PerformanceEntry.h"
#include "platform/Timer.h"
@@ -61,12 +62,20 @@ public:
const AtomicString& interfaceName() const override;
virtual PerformanceTiming* timing() const;
- double now() const;
-
- double timeOrigin() const { return m_timeOrigin; }
+ // Reduce the resolution to 5µs to prevent timing attacks. See:
+ // http://www.w3.org/TR/hr-time-2/#privacy-security
static double clampTimeResolution(double timeSeconds);
+ // Translate given platform monotonic time in seconds into a high resolution
+ // DOMHighResTimeStamp in milliseconds. The result timestamp is relative to
+ // document's time origin and has a time resolution that is safe for
+ // exposing to web.
+ DOMHighResTimeStamp monotonicTimeToDOMHighResTimeStamp(double) const;
+ DOMHighResTimeStamp now() const;
+
+ double timeOrigin() const { return m_timeOrigin; }
+
PerformanceEntryVector getEntries() const;
PerformanceEntryVector getEntriesByType(const String& entryType);
PerformanceEntryVector getEntriesByName(const String& name, const String& entryType);
« no previous file with comments | « third_party/WebKit/Source/core/testing/Internals.idl ('k') | third_party/WebKit/Source/core/timing/PerformanceBase.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698