| 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 30 matching lines...) Expand all Loading... |
| 41 #include "core/loader/DocumentWriter.h" | 41 #include "core/loader/DocumentWriter.h" |
| 42 #include "core/loader/FrameLoaderTypes.h" | 42 #include "core/loader/FrameLoaderTypes.h" |
| 43 #include "core/loader/NavigationPolicy.h" | 43 #include "core/loader/NavigationPolicy.h" |
| 44 #include "platform/network/ResourceError.h" | 44 #include "platform/network/ResourceError.h" |
| 45 #include "platform/network/ResourceRequest.h" | 45 #include "platform/network/ResourceRequest.h" |
| 46 #include "platform/network/ResourceResponse.h" | 46 #include "platform/network/ResourceResponse.h" |
| 47 #include "wtf/HashSet.h" | 47 #include "wtf/HashSet.h" |
| 48 #include "wtf/RefPtr.h" | 48 #include "wtf/RefPtr.h" |
| 49 | 49 |
| 50 namespace blink { | 50 namespace blink { |
| 51 | |
| 52 class ApplicationCacheHost; | 51 class ApplicationCacheHost; |
| 53 class ResourceFetcher; | 52 class ResourceFetcher; |
| 54 class DocumentInit; | 53 class DocumentInit; |
| 55 class LocalFrame; | 54 class LocalFrame; |
| 56 class FrameLoader; | 55 class FrameLoader; |
| 57 class MHTMLArchive; | 56 class MHTMLArchive; |
| 58 class ResourceLoader; | 57 class ResourceLoader; |
| 59 class ThreadedDataReceiver; | 58 class ThreadedDataReceiver; |
| 60 | 59 |
| 61 class CORE_EXPORT DocumentLoader : public RefCountedWillBeGarbageCollectedFi
nalized<DocumentLoader>, private RawResourceClient { | 60 class CORE_EXPORT DocumentLoader : public RefCounted<DocumentLoader>, privat
e RawResourceClient { |
| 62 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(DocumentLoader); | 61 WTF_MAKE_FAST_ALLOCATED(DocumentLoader); |
| 63 public: | 62 public: |
| 64 static PassRefPtrWillBeRawPtr<DocumentLoader> create(LocalFrame* frame,
const ResourceRequest& request, const SubstituteData& data) | 63 static PassRefPtr<DocumentLoader> create(LocalFrame* frame, const Resour
ceRequest& request, const SubstituteData& data) |
| 65 { | 64 { |
| 66 return adoptRefWillBeNoop(new DocumentLoader(frame, request, data)); | 65 return adoptRef(new DocumentLoader(frame, request, data)); |
| 67 } | 66 } |
| 68 virtual ~DocumentLoader(); | 67 virtual ~DocumentLoader(); |
| 69 | 68 |
| 70 LocalFrame* frame() const { return m_frame; } | 69 LocalFrame* frame() const { return m_frame; } |
| 71 | 70 |
| 72 virtual void detachFromFrame(); | 71 void detachFromFrame(); |
| 73 | 72 |
| 74 unsigned long mainResourceIdentifier() const; | 73 unsigned long mainResourceIdentifier() const; |
| 75 | 74 |
| 76 void replaceDocumentWhileExecutingJavaScriptURL(const DocumentInit&, con
st String& source, Document*); | 75 void replaceDocumentWhileExecutingJavaScriptURL(const DocumentInit&, con
st String& source, Document*); |
| 77 | 76 |
| 78 const AtomicString& mimeType() const; | 77 const AtomicString& mimeType() const; |
| 79 | 78 |
| 80 const ResourceRequest& originalRequest() const; | 79 const ResourceRequest& originalRequest() const; |
| 81 | 80 |
| 82 const ResourceRequest& request() const; | 81 const ResourceRequest& request() const; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 | 134 |
| 136 // TODO(skobes): Move FrameView::m_wasScrolledByUser into here. | 135 // TODO(skobes): Move FrameView::m_wasScrolledByUser into here. |
| 137 bool didRestoreFromHistory; | 136 bool didRestoreFromHistory; |
| 138 }; | 137 }; |
| 139 InitialScrollState& initialScrollState() { return m_initialScrollState;
} | 138 InitialScrollState& initialScrollState() { return m_initialScrollState;
} |
| 140 | 139 |
| 141 bool loadingMultipartContent() const; | 140 bool loadingMultipartContent() const; |
| 142 | 141 |
| 143 void startPreload(Resource::Type, FetchRequest&); | 142 void startPreload(Resource::Type, FetchRequest&); |
| 144 | 143 |
| 145 DECLARE_VIRTUAL_TRACE(); | |
| 146 | |
| 147 protected: | 144 protected: |
| 148 DocumentLoader(LocalFrame*, const ResourceRequest&, const SubstituteData
&); | 145 DocumentLoader(LocalFrame*, const ResourceRequest&, const SubstituteData
&); |
| 149 | 146 |
| 150 Vector<KURL> m_redirectChain; | 147 Vector<KURL> m_redirectChain; |
| 151 | 148 |
| 152 private: | 149 private: |
| 153 static PassRefPtrWillBeRawPtr<DocumentWriter> createWriterFor(const Docu
ment* ownerDocument, const DocumentInit&, const AtomicString& mimeType, const At
omicString& encoding, bool dispatch, ParserSynchronizationPolicy); | 150 static PassRefPtrWillBeRawPtr<DocumentWriter> createWriterFor(const Docu
ment* ownerDocument, const DocumentInit&, const AtomicString& mimeType, const At
omicString& encoding, bool dispatch, ParserSynchronizationPolicy); |
| 154 | 151 |
| 155 void ensureWriter(const AtomicString& mimeType, const KURL& overridingUR
L = KURL()); | 152 void ensureWriter(const AtomicString& mimeType, const KURL& overridingUR
L = KURL()); |
| 156 void endWriting(DocumentWriter*); | 153 void endWriting(DocumentWriter*); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 177 virtual void responseReceived(Resource*, const ResourceResponse&, PassOw
nPtr<WebDataConsumerHandle>) override final; | 174 virtual void responseReceived(Resource*, const ResourceResponse&, PassOw
nPtr<WebDataConsumerHandle>) override final; |
| 178 virtual void dataReceived(Resource*, const char* data, unsigned length)
override final; | 175 virtual void dataReceived(Resource*, const char* data, unsigned length)
override final; |
| 179 virtual void notifyFinished(Resource*) override final; | 176 virtual void notifyFinished(Resource*) override final; |
| 180 | 177 |
| 181 bool maybeLoadEmpty(); | 178 bool maybeLoadEmpty(); |
| 182 | 179 |
| 183 bool isRedirectAfterPost(const ResourceRequest&, const ResourceResponse&
); | 180 bool isRedirectAfterPost(const ResourceRequest&, const ResourceResponse&
); |
| 184 | 181 |
| 185 bool shouldContinueForResponse() const; | 182 bool shouldContinueForResponse() const; |
| 186 | 183 |
| 187 RawPtrWillBeMember<LocalFrame> m_frame; | 184 LocalFrame* m_frame; |
| 188 RefPtrWillBeMember<ResourceFetcher> m_fetcher; | 185 RefPtrWillBePersistent<ResourceFetcher> m_fetcher; |
| 189 | 186 |
| 190 ResourcePtr<RawResource> m_mainResource; | 187 ResourcePtr<RawResource> m_mainResource; |
| 191 | 188 |
| 192 RefPtrWillBeMember<DocumentWriter> m_writer; | 189 RefPtrWillBePersistent<DocumentWriter> m_writer; |
| 193 | 190 |
| 194 // A reference to actual request used to create the data source. | 191 // A reference to actual request used to create the data source. |
| 195 // The only part of this request that should change is the url, and | 192 // The only part of this request that should change is the url, and |
| 196 // that only in the case of a same-document navigation. | 193 // that only in the case of a same-document navigation. |
| 197 ResourceRequest m_originalRequest; | 194 ResourceRequest m_originalRequest; |
| 198 | 195 |
| 199 SubstituteData m_substituteData; | 196 SubstituteData m_substituteData; |
| 200 | 197 |
| 201 // The 'working' request. It may be mutated | 198 // The 'working' request. It may be mutated |
| 202 // several times from the original request to include additional | 199 // several times from the original request to include additional |
| 203 // headers, cookie information, canonicalization and redirects. | 200 // headers, cookie information, canonicalization and redirects. |
| 204 ResourceRequest m_request; | 201 ResourceRequest m_request; |
| 205 | 202 |
| 206 ResourceResponse m_response; | 203 ResourceResponse m_response; |
| 207 | 204 |
| 208 ResourceError m_mainDocumentError; | 205 ResourceError m_mainDocumentError; |
| 209 | 206 |
| 210 bool m_committed; | 207 bool m_committed; |
| 211 bool m_isClientRedirect; | 208 bool m_isClientRedirect; |
| 212 bool m_replacesCurrentHistoryItem; | 209 bool m_replacesCurrentHistoryItem; |
| 213 | 210 |
| 214 NavigationType m_navigationType; | 211 NavigationType m_navigationType; |
| 215 | 212 |
| 216 RefPtrWillBeMember<MHTMLArchive> m_archive; | 213 RefPtrWillBePersistent<MHTMLArchive> m_archive; |
| 217 | 214 |
| 218 bool m_loadingMainResource; | 215 bool m_loadingMainResource; |
| 219 DocumentLoadTiming m_documentLoadTiming; | 216 DocumentLoadTiming m_documentLoadTiming; |
| 220 | 217 |
| 221 double m_timeOfLastDataReceived; | 218 double m_timeOfLastDataReceived; |
| 222 | 219 |
| 223 PersistentWillBeMember<ApplicationCacheHost> m_applicationCacheHost; | 220 friend class ApplicationCacheHost; // for substitute resource delivery |
| 221 OwnPtrWillBePersistent<ApplicationCacheHost> m_applicationCacheHost; |
| 224 | 222 |
| 225 RefPtr<ContentSecurityPolicy> m_contentSecurityPolicy; | 223 RefPtr<ContentSecurityPolicy> m_contentSecurityPolicy; |
| 226 ClientHintsPreferences m_clientHintsPreferences; | 224 ClientHintsPreferences m_clientHintsPreferences; |
| 227 InitialScrollState m_initialScrollState; | 225 InitialScrollState m_initialScrollState; |
| 228 }; | 226 }; |
| 229 | 227 } |
| 230 } // namespace blink | |
| 231 | 228 |
| 232 #endif // DocumentLoader_h | 229 #endif // DocumentLoader_h |
| OLD | NEW |