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

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

Issue 2416523002: Expose the initiating origin/URL of a navigation in the Blink public API (Closed)
Patch Set: rebase Created 4 years 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/loader/DocumentLoader.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 65
66 class CORE_EXPORT DocumentLoader 66 class CORE_EXPORT DocumentLoader
67 : public GarbageCollectedFinalized<DocumentLoader>, 67 : public GarbageCollectedFinalized<DocumentLoader>,
68 private RawResourceClient { 68 private RawResourceClient {
69 USING_GARBAGE_COLLECTED_MIXIN(DocumentLoader); 69 USING_GARBAGE_COLLECTED_MIXIN(DocumentLoader);
70 70
71 public: 71 public:
72 static DocumentLoader* create(LocalFrame* frame, 72 static DocumentLoader* create(LocalFrame* frame,
73 const ResourceRequest& request, 73 const ResourceRequest& request,
74 const SubstituteData& data, 74 const SubstituteData& data,
75 ClientRedirectPolicy clientRedirectPolicy) { 75 ClientRedirectPolicy clientRedirectPolicy,
76 return new DocumentLoader(frame, request, data, clientRedirectPolicy); 76 Document* requestorDocument) {
77 return new DocumentLoader(frame, request, data, clientRedirectPolicy,
78 requestorDocument);
77 } 79 }
78 ~DocumentLoader() override; 80 ~DocumentLoader() override;
79 81
80 LocalFrame* frame() const { return m_frame; } 82 LocalFrame* frame() const { return m_frame; }
81 83
82 virtual void detachFromFrame(); 84 virtual void detachFromFrame();
83 85
84 unsigned long mainResourceIdentifier() const; 86 unsigned long mainResourceIdentifier() const;
85 87
86 void replaceDocumentWhileExecutingJavaScriptURL(const DocumentInit&, 88 void replaceDocumentWhileExecutingJavaScriptURL(const DocumentInit&,
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 LinkLoader::MediaPreloadPolicy); 183 LinkLoader::MediaPreloadPolicy);
182 184
183 Resource* startPreload(Resource::Type, FetchRequest&); 185 Resource* startPreload(Resource::Type, FetchRequest&);
184 186
185 DECLARE_VIRTUAL_TRACE(); 187 DECLARE_VIRTUAL_TRACE();
186 188
187 protected: 189 protected:
188 DocumentLoader(LocalFrame*, 190 DocumentLoader(LocalFrame*,
189 const ResourceRequest&, 191 const ResourceRequest&,
190 const SubstituteData&, 192 const SubstituteData&,
191 ClientRedirectPolicy); 193 ClientRedirectPolicy,
194 Document* requestorDocument);
195
196 Document* requestorDocument() const { return m_requestorDocument; }
192 197
193 void didRedirect(const KURL& oldURL, const KURL& newURL); 198 void didRedirect(const KURL& oldURL, const KURL& newURL);
194 199
195 Vector<KURL> m_redirectChain; 200 Vector<KURL> m_redirectChain;
196 201
197 private: 202 private:
198 static DocumentWriter* createWriterFor(const DocumentInit&, 203 static DocumentWriter* createWriterFor(const DocumentInit&,
199 const AtomicString& mimeType, 204 const AtomicString& mimeType,
200 const AtomicString& encoding, 205 const AtomicString& encoding,
201 bool dispatchWindowObjectAvailable, 206 bool dispatchWindowObjectAvailable,
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 bool shouldContinueForResponse() const; 239 bool shouldContinueForResponse() const;
235 240
236 Member<LocalFrame> m_frame; 241 Member<LocalFrame> m_frame;
237 Member<ResourceFetcher> m_fetcher; 242 Member<ResourceFetcher> m_fetcher;
238 std::unique_ptr<WebDocumentSubresourceFilter> m_subresourceFilter; 243 std::unique_ptr<WebDocumentSubresourceFilter> m_subresourceFilter;
239 244
240 Member<RawResource> m_mainResource; 245 Member<RawResource> m_mainResource;
241 246
242 Member<DocumentWriter> m_writer; 247 Member<DocumentWriter> m_writer;
243 248
249 Member<Document> m_requestorDocument;
250
244 // A reference to actual request used to create the data source. 251 // A reference to actual request used to create the data source.
245 // The only part of this request that should change is the url, and 252 // The only part of this request that should change is the url, and
246 // that only in the case of a same-document navigation. 253 // that only in the case of a same-document navigation.
247 ResourceRequest m_originalRequest; 254 ResourceRequest m_originalRequest;
248 255
249 SubstituteData m_substituteData; 256 SubstituteData m_substituteData;
250 257
251 // The 'working' request. It may be mutated 258 // The 'working' request. It may be mutated
252 // several times from the original request to include additional 259 // several times from the original request to include additional
253 // headers, cookie information, canonicalization and redirects. 260 // headers, cookie information, canonicalization and redirects.
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 // Used to protect against reentrancy into dataReceived(). 292 // Used to protect against reentrancy into dataReceived().
286 bool m_inDataReceived; 293 bool m_inDataReceived;
287 RefPtr<SharedBuffer> m_dataBuffer; 294 RefPtr<SharedBuffer> m_dataBuffer;
288 }; 295 };
289 296
290 DECLARE_WEAK_IDENTIFIER_MAP(DocumentLoader); 297 DECLARE_WEAK_IDENTIFIER_MAP(DocumentLoader);
291 298
292 } // namespace blink 299 } // namespace blink
293 300
294 #endif // DocumentLoader_h 301 #endif // DocumentLoader_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/loader/DocumentLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698