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

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

Issue 2511313002: transferSize implementation (Closed)
Patch Set: added TODO Created 4 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/DocumentLoader.cpp
diff --git a/third_party/WebKit/Source/core/loader/DocumentLoader.cpp b/third_party/WebKit/Source/core/loader/DocumentLoader.cpp
index ba90b82aa70e5e3e32e3a4f5ed2fca29cdde0e33..a978ba0fdc0ba547e0e20b21aeabbe14e79da404 100644
--- a/third_party/WebKit/Source/core/loader/DocumentLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/DocumentLoader.cpp
@@ -107,6 +107,7 @@ DocumentLoader::DocumentLoader(LocalFrame* frame,
ClientRedirectPolicy::ClientRedirect),
m_replacesCurrentHistoryItem(false),
m_dataReceived(false),
+ m_mainResourceIdentifier(0),
m_navigationType(NavigationTypeOther),
m_documentLoadTiming(*this),
m_timeOfLastDataReceived(0.0),
@@ -145,7 +146,11 @@ DEFINE_TRACE(DocumentLoader) {
}
unsigned long DocumentLoader::mainResourceIdentifier() const {
- return m_mainResource ? m_mainResource->identifier() : 0;
+ return m_mainResourceIdentifier;
Yoav Weiss 2016/11/29 10:39:32 Why do we need to store this rather than get the i
sunjian 2016/11/29 19:33:30 Yeah, m_mainResource gets reset to nullptr after i
+}
+
+ResourceTimingInfo* DocumentLoader::getMainResourceTimingInfo() const {
+ return fetcher()->getMainResourceTimingInfo(mainResourceIdentifier());
}
const ResourceRequest& DocumentLoader::originalRequest() const {
@@ -717,6 +722,7 @@ void DocumentLoader::startLoadingMainResource() {
mainResourceLoadOptions);
m_mainResource =
RawResource::fetchMainResource(fetchRequest, fetcher(), m_substituteData);
+ m_mainResourceIdentifier = m_mainResource ? m_mainResource->identifier() : 0;
// PlzNavigate:
// The final access checks are still performed here, potentially rejecting

Powered by Google App Engine
This is Rietveld 408576698