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 15 matching lines...) Expand all Loading... |
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 "core/fetch/RawResource.h" | 33 #include "core/fetch/RawResource.h" |
34 #include "core/fetch/ResourceLoaderOptions.h" | 34 #include "core/fetch/ResourceLoaderOptions.h" |
35 #include "core/fetch/ResourcePtr.h" | 35 #include "core/fetch/ResourcePtr.h" |
| 36 #include "core/frame/csp/ContentSecurityPolicy.h" |
36 #include "core/loader/DocumentLoadTiming.h" | 37 #include "core/loader/DocumentLoadTiming.h" |
37 #include "core/loader/DocumentWriter.h" | 38 #include "core/loader/DocumentWriter.h" |
38 #include "core/loader/NavigationAction.h" | 39 #include "core/loader/NavigationAction.h" |
39 #include "core/loader/SubstituteData.h" | 40 #include "core/loader/SubstituteData.h" |
40 #include "platform/network/ResourceError.h" | 41 #include "platform/network/ResourceError.h" |
41 #include "platform/network/ResourceRequest.h" | 42 #include "platform/network/ResourceRequest.h" |
42 #include "platform/network/ResourceResponse.h" | 43 #include "platform/network/ResourceResponse.h" |
43 #include "wtf/HashSet.h" | 44 #include "wtf/HashSet.h" |
44 #include "wtf/RefPtr.h" | 45 #include "wtf/RefPtr.h" |
45 | 46 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 | 130 |
130 void attachThreadedDataReceiver(PassOwnPtr<blink::WebThreadedDataReceive
r>); | 131 void attachThreadedDataReceiver(PassOwnPtr<blink::WebThreadedDataReceive
r>); |
131 DocumentLoadTiming* timing() { return &m_documentLoadTiming; } | 132 DocumentLoadTiming* timing() { return &m_documentLoadTiming; } |
132 | 133 |
133 ApplicationCacheHost* applicationCacheHost() const { return m_applicatio
nCacheHost.get(); } | 134 ApplicationCacheHost* applicationCacheHost() const { return m_applicatio
nCacheHost.get(); } |
134 | 135 |
135 bool isRedirect() const { return m_redirectChain.size() > 1; } | 136 bool isRedirect() const { return m_redirectChain.size() > 1; } |
136 void clearRedirectChain(); | 137 void clearRedirectChain(); |
137 void appendRedirect(const KURL&); | 138 void appendRedirect(const KURL&); |
138 | 139 |
| 140 PassRefPtr<ContentSecurityPolicy> releaseContentSecurityPolicy() { retur
n m_contentSecurityPolicy.release(); } |
| 141 |
139 protected: | 142 protected: |
140 DocumentLoader(LocalFrame*, const ResourceRequest&, const SubstituteData
&); | 143 DocumentLoader(LocalFrame*, const ResourceRequest&, const SubstituteData
&); |
141 | 144 |
142 Vector<KURL> m_redirectChain; | 145 Vector<KURL> m_redirectChain; |
143 | 146 |
144 private: | 147 private: |
145 static PassRefPtrWillBeRawPtr<DocumentWriter> createWriterFor(const Docu
ment* ownerDocument, const DocumentInit&, const AtomicString& mimeType, const At
omicString& encoding, bool dispatch); | 148 static PassRefPtrWillBeRawPtr<DocumentWriter> createWriterFor(const Docu
ment* ownerDocument, const DocumentInit&, const AtomicString& mimeType, const At
omicString& encoding, bool dispatch); |
146 | 149 |
147 void ensureWriter(const AtomicString& mimeType, const KURL& overridingUR
L = KURL()); | 150 void ensureWriter(const AtomicString& mimeType, const KURL& overridingUR
L = KURL()); |
148 void endWriting(DocumentWriter*); | 151 void endWriting(DocumentWriter*); |
149 | 152 |
150 Document* document() const; | 153 Document* document() const; |
151 FrameLoader* frameLoader() const; | 154 FrameLoader* frameLoader() const; |
152 | 155 |
153 void commitIfReady(); | 156 void commitIfReady(); |
154 void commitData(const char* bytes, size_t length); | 157 void commitData(const char* bytes, size_t length); |
155 void setMainDocumentError(const ResourceError&); | 158 void setMainDocumentError(const ResourceError&); |
156 void clearMainResourceLoader(); | 159 void clearMainResourceLoader(); |
157 ResourceLoader* mainResourceLoader() const; | 160 ResourceLoader* mainResourceLoader() const; |
158 void clearMainResourceHandle(); | 161 void clearMainResourceHandle(); |
159 | 162 |
160 bool maybeCreateArchive(); | 163 bool maybeCreateArchive(); |
161 | 164 |
162 void prepareSubframeArchiveLoadIfNeeded(); | 165 void prepareSubframeArchiveLoadIfNeeded(); |
163 void addAllArchiveResources(MHTMLArchive*); | 166 void addAllArchiveResources(MHTMLArchive*); |
164 | 167 |
165 void willSendRequest(ResourceRequest&, const ResourceResponse&); | 168 void willSendRequest(ResourceRequest&, const ResourceResponse&); |
166 void finishedLoading(double finishTime); | 169 void finishedLoading(double finishTime); |
167 void mainReceivedError(const ResourceError&); | 170 void mainReceivedError(const ResourceError&); |
| 171 void cancelLoadAfterXFrameOptionsOrCSPDenied(const ResourceResponse&); |
168 virtual void redirectReceived(Resource*, ResourceRequest&, const Resourc
eResponse&) OVERRIDE FINAL; | 172 virtual void redirectReceived(Resource*, ResourceRequest&, const Resourc
eResponse&) OVERRIDE FINAL; |
169 virtual void updateRequest(Resource*, const ResourceRequest&) OVERRIDE F
INAL; | 173 virtual void updateRequest(Resource*, const ResourceRequest&) OVERRIDE F
INAL; |
170 virtual void responseReceived(Resource*, const ResourceResponse&) OVERRI
DE FINAL; | 174 virtual void responseReceived(Resource*, const ResourceResponse&) OVERRI
DE FINAL; |
171 virtual void dataReceived(Resource*, const char* data, int length) OVERR
IDE FINAL; | 175 virtual void dataReceived(Resource*, const char* data, int length) OVERR
IDE FINAL; |
172 virtual void notifyFinished(Resource*) OVERRIDE FINAL; | 176 virtual void notifyFinished(Resource*) OVERRIDE FINAL; |
173 | 177 |
174 bool maybeLoadEmpty(); | 178 bool maybeLoadEmpty(); |
175 | 179 |
176 bool isRedirectAfterPost(const ResourceRequest&, const ResourceResponse&
); | 180 bool isRedirectAfterPost(const ResourceRequest&, const ResourceResponse&
); |
177 | 181 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 OwnPtrWillBePersistent<ArchiveResourceCollection> m_archiveResourceColle
ction; | 217 OwnPtrWillBePersistent<ArchiveResourceCollection> m_archiveResourceColle
ction; |
214 RefPtrWillBePersistent<MHTMLArchive> m_archive; | 218 RefPtrWillBePersistent<MHTMLArchive> m_archive; |
215 | 219 |
216 bool m_loadingMainResource; | 220 bool m_loadingMainResource; |
217 DocumentLoadTiming m_documentLoadTiming; | 221 DocumentLoadTiming m_documentLoadTiming; |
218 | 222 |
219 double m_timeOfLastDataReceived; | 223 double m_timeOfLastDataReceived; |
220 | 224 |
221 friend class ApplicationCacheHost; // for substitute resource delivery | 225 friend class ApplicationCacheHost; // for substitute resource delivery |
222 OwnPtrWillBePersistent<ApplicationCacheHost> m_applicationCacheHost; | 226 OwnPtrWillBePersistent<ApplicationCacheHost> m_applicationCacheHost; |
| 227 |
| 228 RefPtr<ContentSecurityPolicy> m_contentSecurityPolicy; |
223 }; | 229 }; |
224 } | 230 } |
225 | 231 |
226 #endif // DocumentLoader_h | 232 #endif // DocumentLoader_h |
OLD | NEW |