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

Unified Diff: Source/core/loader/FrameLoader.cpp

Issue 14054023: Add loadedNonEmptyDocument flag in FrameLoader for Resource Timing (Closed) Base URL: http://chromium.googlesource.com/chromium/blink.git@master
Patch Set: store loadedNonEmptyDocument state in HTMLIFrameElement Created 7 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
Index: Source/core/loader/FrameLoader.cpp
diff --git a/Source/core/loader/FrameLoader.cpp b/Source/core/loader/FrameLoader.cpp
index 047ab371aa46faef6adf253bf99c57d34fe263e5..46a926c889d5425d9540b42a79fc65cef146130a 100644
--- a/Source/core/loader/FrameLoader.cpp
+++ b/Source/core/loader/FrameLoader.cpp
@@ -501,9 +501,12 @@ void FrameLoader::didExplicitOpen()
m_didCallImplicitClose = false;
// Calling document.open counts as committing the first real document load.
- if (!m_stateMachine.committedFirstRealDocumentLoad())
+ if (!m_stateMachine.committedFirstRealDocumentLoad()) {
m_stateMachine.advanceTo(FrameLoaderStateMachine::DisplayingInitialEmptyDocumentPostCommit);
-
+ ASSERT(m_documentLoader);
+ if (m_frame->ownerElement() && !m_frame->ownerElement()->loadedNonEmptyDocument() && !m_documentLoader->requestURL().isBlankURL() && !m_documentLoader->requestURL().isEmpty())
+ m_frame->ownerElement()->didLoadNonEmptyDocument();
Nate Chapin 2013/04/30 19:55:58 Is there a case where we would load the first non-
Pan 2013/05/07 08:45:52 Yep, for example in iframe, it use "window.locatio
+ }
// Prevent window.open(url) -- eg window.open("about:blank") -- from blowing away results
// from a subsequent window.document.open / window.document.write call.
// Canceling redirection here works for all cases because document.open
@@ -1048,6 +1051,8 @@ void FrameLoader::prepareForHistoryNavigation()
ASSERT(stateMachine()->isDisplayingInitialEmptyDocument());
stateMachine()->advanceTo(FrameLoaderStateMachine::DisplayingInitialEmptyDocumentPostCommit);
+ if (m_frame->ownerElement() && !m_frame->ownerElement()->loadedNonEmptyDocument() && !currentItem->url().isBlankURL() && !currentItem->url().isEmpty())
+ m_frame->ownerElement()->didLoadNonEmptyDocument();
stateMachine()->advanceTo(FrameLoaderStateMachine::CommittedFirstRealLoad);
}
}
@@ -1712,8 +1717,12 @@ void FrameLoader::transitionToCommitted()
if (m_stateMachine.creatingInitialEmptyDocument())
return;
- if (!m_stateMachine.committedFirstRealDocumentLoad())
+ if (!m_stateMachine.committedFirstRealDocumentLoad()) {
m_stateMachine.advanceTo(FrameLoaderStateMachine::DisplayingInitialEmptyDocumentPostCommit);
+ ASSERT(m_documentLoader);
+ if (m_frame->ownerElement() && !m_frame->ownerElement()->loadedNonEmptyDocument() && !m_documentLoader->requestURL().isBlankURL() && !m_documentLoader->requestURL().isEmpty())
+ m_frame->ownerElement()->didLoadNonEmptyDocument();
+ }
}
void FrameLoader::clientRedirectCancelledOrFinished(bool cancelWithLoadInProgress)

Powered by Google App Engine
This is Rietveld 408576698