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

Side by Side Diff: third_party/WebKit/Source/core/loader/DocumentLoader.cpp

Issue 2647643004: Report nav timing 2 instance as soon as it's requested. (Closed)
Patch Set: make ResourceTimingInfo ref-counted Created 3 years, 10 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 unified diff | Download patch
OLDNEW
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 11 matching lines...) Expand all
22 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */ 28 */
29 29
30 #include "core/loader/DocumentLoader.h" 30 #include "core/loader/DocumentLoader.h"
31 31
32 #include <memory>
32 #include "core/dom/Document.h" 33 #include "core/dom/Document.h"
33 #include "core/dom/WeakIdentifierMap.h" 34 #include "core/dom/WeakIdentifierMap.h"
34 #include "core/events/Event.h" 35 #include "core/events/Event.h"
35 #include "core/frame/Deprecation.h" 36 #include "core/frame/Deprecation.h"
36 #include "core/frame/FrameHost.h" 37 #include "core/frame/FrameHost.h"
37 #include "core/frame/LocalDOMWindow.h" 38 #include "core/frame/LocalDOMWindow.h"
38 #include "core/frame/LocalFrame.h" 39 #include "core/frame/LocalFrame.h"
39 #include "core/frame/Settings.h" 40 #include "core/frame/Settings.h"
40 #include "core/frame/csp/ContentSecurityPolicy.h" 41 #include "core/frame/csp/ContentSecurityPolicy.h"
41 #include "core/html/HTMLFrameOwnerElement.h" 42 #include "core/html/HTMLFrameOwnerElement.h"
(...skipping 16 matching lines...) Expand all
58 #include "platform/HTTPNames.h" 59 #include "platform/HTTPNames.h"
59 #include "platform/UserGestureIndicator.h" 60 #include "platform/UserGestureIndicator.h"
60 #include "platform/loader/fetch/FetchInitiatorTypeNames.h" 61 #include "platform/loader/fetch/FetchInitiatorTypeNames.h"
61 #include "platform/loader/fetch/FetchRequest.h" 62 #include "platform/loader/fetch/FetchRequest.h"
62 #include "platform/loader/fetch/FetchUtils.h" 63 #include "platform/loader/fetch/FetchUtils.h"
63 #include "platform/loader/fetch/MemoryCache.h" 64 #include "platform/loader/fetch/MemoryCache.h"
64 #include "platform/loader/fetch/ResourceFetcher.h" 65 #include "platform/loader/fetch/ResourceFetcher.h"
65 #include "platform/mhtml/ArchiveResource.h" 66 #include "platform/mhtml/ArchiveResource.h"
66 #include "platform/network/ContentSecurityPolicyResponseHeaders.h" 67 #include "platform/network/ContentSecurityPolicyResponseHeaders.h"
67 #include "platform/network/HTTPParsers.h" 68 #include "platform/network/HTTPParsers.h"
69 #include "platform/network/ResourceTimingInfo.h"
Kunihiko Sakamoto 2017/02/13 08:22:29 Still needed?
sunjian 2017/02/14 21:29:02 It compiles fine without it. But it is actually a
Kunihiko Sakamoto 2017/02/15 06:35:30 Oh I see. Let's keep it.
sunjian 2017/02/15 20:30:28 Acknowledged.
68 #include "platform/network/mime/MIMETypeRegistry.h" 70 #include "platform/network/mime/MIMETypeRegistry.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"
73 #include "public/platform/WebDocumentSubresourceFilter.h" 75 #include "public/platform/WebDocumentSubresourceFilter.h"
74 #include "wtf/Assertions.h" 76 #include "wtf/Assertions.h"
75 #include "wtf/AutoReset.h" 77 #include "wtf/AutoReset.h"
76 #include "wtf/text/WTFString.h" 78 #include "wtf/text/WTFString.h"
77 #include <memory>
78 79
79 namespace blink { 80 namespace blink {
80 81
81 static bool isArchiveMIMEType(const String& mimeType) { 82 static bool isArchiveMIMEType(const String& mimeType) {
82 return equalIgnoringCase("multipart/related", mimeType); 83 return equalIgnoringCase("multipart/related", mimeType);
83 } 84 }
84 85
85 static bool shouldInheritSecurityOriginFromOwner(const KURL& url) { 86 static bool shouldInheritSecurityOriginFromOwner(const KURL& url) {
86 // https://html.spec.whatwg.org/multipage/browsers.html#origin 87 // https://html.spec.whatwg.org/multipage/browsers.html#origin
87 // 88 //
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 visitor->trace(m_applicationCacheHost); 157 visitor->trace(m_applicationCacheHost);
157 visitor->trace(m_contentSecurityPolicy); 158 visitor->trace(m_contentSecurityPolicy);
158 RawResourceClient::trace(visitor); 159 RawResourceClient::trace(visitor);
159 } 160 }
160 161
161 unsigned long DocumentLoader::mainResourceIdentifier() const { 162 unsigned long DocumentLoader::mainResourceIdentifier() const {
162 return m_mainResource ? m_mainResource->identifier() : 0; 163 return m_mainResource ? m_mainResource->identifier() : 0;
163 } 164 }
164 165
165 ResourceTimingInfo* DocumentLoader::getNavigationTimingInfo() const { 166 ResourceTimingInfo* DocumentLoader::getNavigationTimingInfo() const {
167 DCHECK(fetcher());
166 return fetcher()->getNavigationTimingInfo(); 168 return fetcher()->getNavigationTimingInfo();
167 } 169 }
168 170
169 const ResourceRequest& DocumentLoader::originalRequest() const { 171 const ResourceRequest& DocumentLoader::originalRequest() const {
170 return m_originalRequest; 172 return m_originalRequest;
171 } 173 }
172 174
173 const ResourceRequest& DocumentLoader::getRequest() const { 175 const ResourceRequest& DocumentLoader::getRequest() const {
174 return m_request; 176 return m_request;
175 } 177 }
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after
813 m_writer ? m_writer->encoding() : emptyAtom, true, 815 m_writer ? m_writer->encoding() : emptyAtom, true,
814 ForceSynchronousParsing); 816 ForceSynchronousParsing);
815 if (!source.isNull()) 817 if (!source.isNull())
816 m_writer->appendReplacingData(source); 818 m_writer->appendReplacingData(source);
817 endWriting(); 819 endWriting();
818 } 820 }
819 821
820 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); 822 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader);
821 823
822 } // namespace blink 824 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698