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

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

Issue 2511313002: transferSize implementation (Closed)
Patch Set: 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 49422fdcc3170c7a3bcdb084a2ae0cc6bed04de2..e0be86db22426962cd7603d7c4cf76090748b1d6 100644
--- a/third_party/WebKit/Source/core/loader/DocumentLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/DocumentLoader.cpp
@@ -60,6 +60,8 @@
#include "core/loader/appcache/ApplicationCacheHost.h"
#include "core/page/FrameTree.h"
#include "core/page/Page.h"
+#include "core/timing/DOMWindowPerformance.h"
+#include "core/timing/Performance.h"
#include "platform/HTTPNames.h"
#include "platform/MIMETypeRegistry.h"
#include "platform/UserGestureIndicator.h"
@@ -148,6 +150,10 @@ unsigned long DocumentLoader::mainResourceIdentifier() const {
return m_mainResource ? m_mainResource->identifier() : 0;
}
+ResourceTimingInfo* DocumentLoader::getMainResourceTimingInfo() const {
+ return fetcher()->getMainResourceTimingInfo(mainResourceIdentifier());
+}
+
const ResourceRequest& DocumentLoader::originalRequest() const {
return m_originalRequest;
}
@@ -312,6 +318,11 @@ void DocumentLoader::finishedLoading(double finishTime) {
if (!m_frame)
return;
+ Performance* performance =
+ DOMWindowPerformance::performance(*m_frame->domWindow());
+ DCHECK(performance);
+ performance->addNavigationTiming(m_frame, getMainResourceTimingInfo());
Yoav Weiss 2016/11/18 10:06:30 I may be wrong but I don't think this is guarantee
sunjian 2016/11/18 20:23:29 You are right about this. I made a mistake recogni
+
m_applicationCacheHost->finishedLoadingMainResource();
endWriting();
if (m_state < MainResourceDone)

Powered by Google App Engine
This is Rietveld 408576698