Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2011 Google Inc. All rights reserved. | 3 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 53 #include "core/inspector/InspectorInstrumentation.h" | 53 #include "core/inspector/InspectorInstrumentation.h" |
| 54 #include "core/loader/FrameFetchContext.h" | 54 #include "core/loader/FrameFetchContext.h" |
| 55 #include "core/loader/FrameLoader.h" | 55 #include "core/loader/FrameLoader.h" |
| 56 #include "core/loader/FrameLoaderClient.h" | 56 #include "core/loader/FrameLoaderClient.h" |
| 57 #include "core/loader/LinkLoader.h" | 57 #include "core/loader/LinkLoader.h" |
| 58 #include "core/loader/NetworkHintsInterface.h" | 58 #include "core/loader/NetworkHintsInterface.h" |
| 59 #include "core/loader/ProgressTracker.h" | 59 #include "core/loader/ProgressTracker.h" |
| 60 #include "core/loader/appcache/ApplicationCacheHost.h" | 60 #include "core/loader/appcache/ApplicationCacheHost.h" |
| 61 #include "core/page/FrameTree.h" | 61 #include "core/page/FrameTree.h" |
| 62 #include "core/page/Page.h" | 62 #include "core/page/Page.h" |
| 63 #include "core/timing/DOMWindowPerformance.h" | |
| 64 #include "core/timing/Performance.h" | |
| 63 #include "platform/HTTPNames.h" | 65 #include "platform/HTTPNames.h" |
| 64 #include "platform/MIMETypeRegistry.h" | 66 #include "platform/MIMETypeRegistry.h" |
| 65 #include "platform/UserGestureIndicator.h" | 67 #include "platform/UserGestureIndicator.h" |
| 66 #include "platform/mhtml/ArchiveResource.h" | 68 #include "platform/mhtml/ArchiveResource.h" |
| 67 #include "platform/network/ContentSecurityPolicyResponseHeaders.h" | 69 #include "platform/network/ContentSecurityPolicyResponseHeaders.h" |
| 68 #include "platform/network/HTTPParsers.h" | 70 #include "platform/network/HTTPParsers.h" |
| 69 #include "platform/plugins/PluginData.h" | 71 #include "platform/plugins/PluginData.h" |
| 70 #include "platform/weborigin/SchemeRegistry.h" | 72 #include "platform/weborigin/SchemeRegistry.h" |
| 71 #include "platform/weborigin/SecurityPolicy.h" | 73 #include "platform/weborigin/SecurityPolicy.h" |
| 72 #include "public/platform/Platform.h" | 74 #include "public/platform/Platform.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 141 visitor->trace(m_documentLoadTiming); | 143 visitor->trace(m_documentLoadTiming); |
| 142 visitor->trace(m_applicationCacheHost); | 144 visitor->trace(m_applicationCacheHost); |
| 143 visitor->trace(m_contentSecurityPolicy); | 145 visitor->trace(m_contentSecurityPolicy); |
| 144 RawResourceClient::trace(visitor); | 146 RawResourceClient::trace(visitor); |
| 145 } | 147 } |
| 146 | 148 |
| 147 unsigned long DocumentLoader::mainResourceIdentifier() const { | 149 unsigned long DocumentLoader::mainResourceIdentifier() const { |
| 148 return m_mainResource ? m_mainResource->identifier() : 0; | 150 return m_mainResource ? m_mainResource->identifier() : 0; |
| 149 } | 151 } |
| 150 | 152 |
| 153 ResourceTimingInfo* DocumentLoader::getMainResourceTimingInfo() const { | |
| 154 return fetcher()->getMainResourceTimingInfo(mainResourceIdentifier()); | |
| 155 } | |
| 156 | |
| 151 const ResourceRequest& DocumentLoader::originalRequest() const { | 157 const ResourceRequest& DocumentLoader::originalRequest() const { |
| 152 return m_originalRequest; | 158 return m_originalRequest; |
| 153 } | 159 } |
| 154 | 160 |
| 155 const ResourceRequest& DocumentLoader::request() const { | 161 const ResourceRequest& DocumentLoader::request() const { |
| 156 return m_request; | 162 return m_request; |
| 157 } | 163 } |
| 158 | 164 |
| 159 const KURL& DocumentLoader::url() const { | 165 const KURL& DocumentLoader::url() const { |
| 160 return m_request.url(); | 166 return m_request.url(); |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 305 // If this is an empty document, it will not have actually been created yet. | 311 // If this is an empty document, it will not have actually been created yet. |
| 306 // Commit dummy data so that DocumentWriter::begin() gets called and creates | 312 // Commit dummy data so that DocumentWriter::begin() gets called and creates |
| 307 // the Document. | 313 // the Document. |
| 308 if (!m_writer) | 314 if (!m_writer) |
| 309 commitData(0, 0); | 315 commitData(0, 0); |
| 310 } | 316 } |
| 311 | 317 |
| 312 if (!m_frame) | 318 if (!m_frame) |
| 313 return; | 319 return; |
| 314 | 320 |
| 321 Performance* performance = | |
| 322 DOMWindowPerformance::performance(*m_frame->domWindow()); | |
| 323 DCHECK(performance); | |
| 324 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
| |
| 325 | |
| 315 m_applicationCacheHost->finishedLoadingMainResource(); | 326 m_applicationCacheHost->finishedLoadingMainResource(); |
| 316 endWriting(); | 327 endWriting(); |
| 317 if (m_state < MainResourceDone) | 328 if (m_state < MainResourceDone) |
| 318 m_state = MainResourceDone; | 329 m_state = MainResourceDone; |
| 319 clearMainResourceHandle(); | 330 clearMainResourceHandle(); |
| 320 } | 331 } |
| 321 | 332 |
| 322 bool DocumentLoader::redirectReceived( | 333 bool DocumentLoader::redirectReceived( |
| 323 Resource* resource, | 334 Resource* resource, |
| 324 const ResourceRequest& request, | 335 const ResourceRequest& request, |
| (...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 793 m_writer ? m_writer->encoding() : emptyAtom, true, | 804 m_writer ? m_writer->encoding() : emptyAtom, true, |
| 794 ForceSynchronousParsing); | 805 ForceSynchronousParsing); |
| 795 if (!source.isNull()) | 806 if (!source.isNull()) |
| 796 m_writer->appendReplacingData(source); | 807 m_writer->appendReplacingData(source); |
| 797 endWriting(); | 808 endWriting(); |
| 798 } | 809 } |
| 799 | 810 |
| 800 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); | 811 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); |
| 801 | 812 |
| 802 } // namespace blink | 813 } // namespace blink |
| OLD | NEW |