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

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

Issue 2781723007: Plumb initiator out of Blink. (Closed)
Patch Set: Created 3 years, 8 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, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009 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 15 matching lines...) Expand all
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 #ifndef DocumentLoader_h 30 #ifndef DocumentLoader_h
31 #define DocumentLoader_h 31 #define DocumentLoader_h
32 32
33 #include <memory> 33 #include <memory>
34 #include "bindings/core/v8/SourceLocation.h" 34 #include "bindings/core/v8/SourceLocation.h"
35 #include "core/CoreExport.h" 35 #include "core/CoreExport.h"
36 #include "core/dom/Document.h"
36 #include "core/dom/ViewportDescription.h" 37 #include "core/dom/ViewportDescription.h"
37 #include "core/dom/WeakIdentifierMap.h" 38 #include "core/dom/WeakIdentifierMap.h"
38 #include "core/frame/FrameTypes.h" 39 #include "core/frame/FrameTypes.h"
39 #include "core/frame/csp/ContentSecurityPolicy.h" 40 #include "core/frame/csp/ContentSecurityPolicy.h"
40 #include "core/loader/DocumentLoadTiming.h" 41 #include "core/loader/DocumentLoadTiming.h"
41 #include "core/loader/DocumentWriter.h" 42 #include "core/loader/DocumentWriter.h"
42 #include "core/loader/FrameLoaderTypes.h" 43 #include "core/loader/FrameLoaderTypes.h"
43 #include "core/loader/LinkLoader.h" 44 #include "core/loader/LinkLoader.h"
44 #include "core/loader/NavigationPolicy.h" 45 #include "core/loader/NavigationPolicy.h"
45 #include "platform/SharedBuffer.h" 46 #include "platform/SharedBuffer.h"
(...skipping 25 matching lines...) Expand all
71 72
72 class CORE_EXPORT DocumentLoader 73 class CORE_EXPORT DocumentLoader
73 : public GarbageCollectedFinalized<DocumentLoader>, 74 : public GarbageCollectedFinalized<DocumentLoader>,
74 private RawResourceClient { 75 private RawResourceClient {
75 USING_GARBAGE_COLLECTED_MIXIN(DocumentLoader); 76 USING_GARBAGE_COLLECTED_MIXIN(DocumentLoader);
76 77
77 public: 78 public:
78 static DocumentLoader* create(LocalFrame* frame, 79 static DocumentLoader* create(LocalFrame* frame,
79 const ResourceRequest& request, 80 const ResourceRequest& request,
80 const SubstituteData& data, 81 const SubstituteData& data,
81 ClientRedirectPolicy clientRedirectPolicy) { 82 ClientRedirectPolicy clientRedirectPolicy,
83 Document* originDocument) {
82 DCHECK(frame); 84 DCHECK(frame);
83 85
84 return new DocumentLoader(frame, request, data, clientRedirectPolicy); 86 return new DocumentLoader(frame, request, data, clientRedirectPolicy,
87 originDocument);
85 } 88 }
86 ~DocumentLoader() override; 89 ~DocumentLoader() override;
87 90
88 LocalFrame* frame() const { return m_frame; } 91 LocalFrame* frame() const { return m_frame; }
89 92
90 ResourceTimingInfo* getNavigationTimingInfo() const; 93 ResourceTimingInfo* getNavigationTimingInfo() const;
91 94
92 virtual void detachFromFrame(); 95 virtual void detachFromFrame();
93 96
94 unsigned long mainResourceIdentifier() const; 97 unsigned long mainResourceIdentifier() const;
95 98
96 void replaceDocumentWhileExecutingJavaScriptURL(const DocumentInit&, 99 void replaceDocumentWhileExecutingJavaScriptURL(const DocumentInit&,
97 const String& source); 100 const String& source);
98 101
99 const AtomicString& mimeType() const; 102 const AtomicString& mimeType() const;
100 103
101 const ResourceRequest& originalRequest() const; 104 const ResourceRequest& originalRequest() const;
102 105
103 const ResourceRequest& getRequest() const; 106 const ResourceRequest& getRequest() const;
104 107
105 ResourceFetcher* fetcher() const { return m_fetcher.get(); } 108 ResourceFetcher* fetcher() const { return m_fetcher.get(); }
106 109
110 Document* originDocument() const { return m_originDocument.get(); }
111
107 void setSubresourceFilter(SubresourceFilter*); 112 void setSubresourceFilter(SubresourceFilter*);
108 SubresourceFilter* subresourceFilter() const { 113 SubresourceFilter* subresourceFilter() const {
109 return m_subresourceFilter.get(); 114 return m_subresourceFilter.get();
110 } 115 }
111 116
112 const SubstituteData& substituteData() const { return m_substituteData; } 117 const SubstituteData& substituteData() const { return m_substituteData; }
113 118
114 const KURL& url() const; 119 const KURL& url() const;
115 const KURL& unreachableURL() const; 120 const KURL& unreachableURL() const;
116 const KURL& urlForHistory() const; 121 const KURL& urlForHistory() const;
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 205
201 std::unique_ptr<SourceLocation> copySourceLocation() const; 206 std::unique_ptr<SourceLocation> copySourceLocation() const;
202 void setSourceLocation(std::unique_ptr<SourceLocation>); 207 void setSourceLocation(std::unique_ptr<SourceLocation>);
203 208
204 DECLARE_VIRTUAL_TRACE(); 209 DECLARE_VIRTUAL_TRACE();
205 210
206 protected: 211 protected:
207 DocumentLoader(LocalFrame*, 212 DocumentLoader(LocalFrame*,
208 const ResourceRequest&, 213 const ResourceRequest&,
209 const SubstituteData&, 214 const SubstituteData&,
210 ClientRedirectPolicy); 215 ClientRedirectPolicy,
216 Document* originDocument);
211 217
212 Vector<KURL> m_redirectChain; 218 Vector<KURL> m_redirectChain;
213 219
214 private: 220 private:
215 // installNewDocument() does the work of creating a Document and 221 // installNewDocument() does the work of creating a Document and
216 // DocumentWriter, as well as creating a new LocalDOMWindow if needed. It also 222 // DocumentWriter, as well as creating a new LocalDOMWindow if needed. It also
217 // initalizes a bunch of state on the Document (e.g., the state based on 223 // initalizes a bunch of state on the Document (e.g., the state based on
218 // response headers). 224 // response headers).
219 enum class InstallNewDocumentReason { kNavigation, kJavascriptURL }; 225 enum class InstallNewDocumentReason { kNavigation, kJavascriptURL };
220 void installNewDocument(const DocumentInit&, 226 void installNewDocument(const DocumentInit&,
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 271
266 bool shouldContinueForResponse() const; 272 bool shouldContinueForResponse() const;
267 273
268 Member<LocalFrame> m_frame; 274 Member<LocalFrame> m_frame;
269 Member<ResourceFetcher> m_fetcher; 275 Member<ResourceFetcher> m_fetcher;
270 276
271 Member<RawResource> m_mainResource; 277 Member<RawResource> m_mainResource;
272 278
273 Member<DocumentWriter> m_writer; 279 Member<DocumentWriter> m_writer;
274 280
281 Member<Document> m_originDocument;
282
275 Member<SubresourceFilter> m_subresourceFilter; 283 Member<SubresourceFilter> m_subresourceFilter;
276 284
277 // A reference to actual request used to create the data source. 285 // A reference to actual request used to create the data source.
278 // The only part of this request that should change is the url, and 286 // The only part of this request that should change is the url, and
279 // that only in the case of a same-document navigation. 287 // that only in the case of a same-document navigation.
280 ResourceRequest m_originalRequest; 288 ResourceRequest m_originalRequest;
281 289
282 SubstituteData m_substituteData; 290 SubstituteData m_substituteData;
283 291
284 // The 'working' request. It may be mutated 292 // The 'working' request. It may be mutated
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 // Used to protect against reentrancy into dataReceived(). 335 // Used to protect against reentrancy into dataReceived().
328 bool m_inDataReceived; 336 bool m_inDataReceived;
329 RefPtr<SharedBuffer> m_dataBuffer; 337 RefPtr<SharedBuffer> m_dataBuffer;
330 }; 338 };
331 339
332 DECLARE_WEAK_IDENTIFIER_MAP(DocumentLoader); 340 DECLARE_WEAK_IDENTIFIER_MAP(DocumentLoader);
333 341
334 } // namespace blink 342 } // namespace blink
335 343
336 #endif // DocumentLoader_h 344 #endif // DocumentLoader_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/RemoteFrameClient.h ('k') | third_party/WebKit/Source/core/loader/DocumentLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698