Chromium Code Reviews| 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) |