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

Unified Diff: Source/core/page/Performance.cpp

Issue 23367007: Record the reference time when Performance is constructed (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Move to initializer Created 7 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
« no previous file with comments | « Source/core/page/Performance.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/Performance.cpp
diff --git a/Source/core/page/Performance.cpp b/Source/core/page/Performance.cpp
index 0d9b274dfcd630d9e6c74e934b44f3328be20b94..c77484c46f696cdd180a1cb613d8e9f0bfe55452 100644
--- a/Source/core/page/Performance.cpp
+++ b/Source/core/page/Performance.cpp
@@ -54,7 +54,9 @@ Performance::Performance(Frame* frame)
: DOMWindowProperty(frame)
, m_resourceTimingBufferSize(defaultResourceTimingBufferSize)
, m_userTiming(0)
+ , m_referenceTime(frame->document()->loader()->timing()->referenceMonotonicTime())
{
+ ASSERT(m_referenceTime);
ScriptWrappable::init(this);
}
@@ -286,7 +288,7 @@ void Performance::clearMeasures(const String& measureName)
double Performance::now() const
{
- return 1000.0 * m_frame->document()->loader()->timing()->monotonicTimeToZeroBasedDocumentTime(monotonicallyIncreasingTime());
+ return 1000.0 * (monotonicallyIncreasingTime() - m_referenceTime);
}
} // namespace WebCore
« no previous file with comments | « Source/core/page/Performance.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698