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

Unified Diff: third_party/WebKit/Source/core/loader/DocumentLoadTiming.cpp

Issue 1425823002: (DEPRECATED) Send navigation_start to browser process in DidStartProvisionalLoad (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Stop calling didCreateDataSource for same-page navs Created 5 years, 1 month 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/loader/DocumentLoadTiming.cpp
diff --git a/third_party/WebKit/Source/core/loader/DocumentLoadTiming.cpp b/third_party/WebKit/Source/core/loader/DocumentLoadTiming.cpp
index 33f85356cf1b5a720608c174489791809809e6ee..011335672676f1c5a996ed6d478b87ddee0759fd 100644
--- a/third_party/WebKit/Source/core/loader/DocumentLoadTiming.cpp
+++ b/third_party/WebKit/Source/core/loader/DocumentLoadTiming.cpp
@@ -87,6 +87,12 @@ double DocumentLoadTiming::pseudoWallTimeToMonotonicTime(double pseudoWallTime)
void DocumentLoadTiming::markNavigationStart()
{
+ // Allow the embedder to override navigationStart before we record it if
+ // they have a more accurate timestamp.
+ if (m_navigationStart) {
+ ASSERT(m_referenceMonotonicTime && m_referenceWallTime);
+ return;
+ }
TRACE_EVENT_MARK("blink.user_timing", "navigationStart");
ASSERT(!m_navigationStart && !m_referenceMonotonicTime && !m_referenceWallTime);
@@ -98,14 +104,16 @@ void DocumentLoadTiming::markNavigationStart()
void DocumentLoadTiming::setNavigationStart(double navigationStart)
{
TRACE_EVENT_MARK_WITH_TIMESTAMP("blink.user_timing", "navigationStart", navigationStart);
- ASSERT(m_referenceMonotonicTime && m_referenceWallTime);
m_navigationStart = navigationStart;
// |m_referenceMonotonicTime| and |m_referenceWallTime| represent
// navigationStart. When the embedder sets navigationStart (because the
// navigation started earlied on the browser side), we need to adjust these
// as well.
- m_referenceWallTime = monotonicTimeToPseudoWallTime(navigationStart);
+ if (!m_referenceWallTime)
+ m_referenceWallTime = currentTime();
+ else
+ m_referenceWallTime = monotonicTimeToPseudoWallTime(navigationStart);
m_referenceMonotonicTime = navigationStart;
notifyDocumentTimingChanged();
}

Powered by Google App Engine
This is Rietveld 408576698