Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 = nullptr) { |
|
dcheng
2016/11/23 08:32:59
The default arg made it easier to add this argumen
Mike West
2016/11/23 11:11:20
Looks like we only call it in ~5 places, mostly te
dcheng
2016/11/23 14:41:44
Done.
| |
| 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 Loading... | |
| 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 Loading... | |
| 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 Loading... | |
| 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 |
| OLD | NEW |