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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 namespace blink { | 57 namespace blink { |
58 | 58 |
59 class ApplicationCacheHost; | 59 class ApplicationCacheHost; |
60 class SubresourceFilter; | 60 class SubresourceFilter; |
61 class ResourceFetcher; | 61 class ResourceFetcher; |
62 class DocumentInit; | 62 class DocumentInit; |
63 class LocalFrame; | 63 class LocalFrame; |
64 class LocalFrameClient; | 64 class LocalFrameClient; |
65 class FrameLoader; | 65 class FrameLoader; |
66 class ResourceTimingInfo; | 66 class ResourceTimingInfo; |
| 67 class WebServiceWorkerNetworkProvider; |
67 struct ViewportDescriptionWrapper; | 68 struct ViewportDescriptionWrapper; |
68 | 69 |
69 class CORE_EXPORT DocumentLoader | 70 class CORE_EXPORT DocumentLoader |
70 : public GarbageCollectedFinalized<DocumentLoader>, | 71 : public GarbageCollectedFinalized<DocumentLoader>, |
71 private RawResourceClient { | 72 private RawResourceClient { |
72 USING_GARBAGE_COLLECTED_MIXIN(DocumentLoader); | 73 USING_GARBAGE_COLLECTED_MIXIN(DocumentLoader); |
73 | 74 |
74 public: | 75 public: |
75 static DocumentLoader* create(LocalFrame* frame, | 76 static DocumentLoader* create(LocalFrame* frame, |
76 const ResourceRequest& request, | 77 const ResourceRequest& request, |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 InitialScrollState& initialScrollState() { return m_initialScrollState; } | 183 InitialScrollState& initialScrollState() { return m_initialScrollState; } |
183 | 184 |
184 void setWasBlockedAfterCSP() { m_wasBlockedAfterCSP = true; } | 185 void setWasBlockedAfterCSP() { m_wasBlockedAfterCSP = true; } |
185 bool wasBlockedAfterCSP() { return m_wasBlockedAfterCSP; } | 186 bool wasBlockedAfterCSP() { return m_wasBlockedAfterCSP; } |
186 | 187 |
187 void dispatchLinkHeaderPreloads(ViewportDescriptionWrapper*, | 188 void dispatchLinkHeaderPreloads(ViewportDescriptionWrapper*, |
188 LinkLoader::MediaPreloadPolicy); | 189 LinkLoader::MediaPreloadPolicy); |
189 | 190 |
190 Resource* startPreload(Resource::Type, FetchRequest&); | 191 Resource* startPreload(Resource::Type, FetchRequest&); |
191 | 192 |
| 193 void setServiceWorkerNetworkProvider( |
| 194 std::unique_ptr<WebServiceWorkerNetworkProvider>); |
| 195 |
| 196 // May return null before the first HTML tag is inserted by the |
| 197 // parser (before didCreateDataSource is called), after the document |
| 198 // is detached from frame, or in tests. |
| 199 WebServiceWorkerNetworkProvider* getServiceWorkerNetworkProvider() { |
| 200 return m_serviceWorkerNetworkProvider.get(); |
| 201 } |
| 202 |
192 DECLARE_VIRTUAL_TRACE(); | 203 DECLARE_VIRTUAL_TRACE(); |
193 | 204 |
194 protected: | 205 protected: |
195 DocumentLoader(LocalFrame*, | 206 DocumentLoader(LocalFrame*, |
196 const ResourceRequest&, | 207 const ResourceRequest&, |
197 const SubstituteData&, | 208 const SubstituteData&, |
198 ClientRedirectPolicy); | 209 ClientRedirectPolicy); |
199 | 210 |
200 Vector<KURL> m_redirectChain; | 211 Vector<KURL> m_redirectChain; |
201 | 212 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 bool m_dataReceived; | 287 bool m_dataReceived; |
277 | 288 |
278 NavigationType m_navigationType; | 289 NavigationType m_navigationType; |
279 | 290 |
280 DocumentLoadTiming m_documentLoadTiming; | 291 DocumentLoadTiming m_documentLoadTiming; |
281 | 292 |
282 double m_timeOfLastDataReceived; | 293 double m_timeOfLastDataReceived; |
283 | 294 |
284 Member<ApplicationCacheHost> m_applicationCacheHost; | 295 Member<ApplicationCacheHost> m_applicationCacheHost; |
285 | 296 |
| 297 std::unique_ptr<WebServiceWorkerNetworkProvider> |
| 298 m_serviceWorkerNetworkProvider; |
| 299 |
286 Member<ContentSecurityPolicy> m_contentSecurityPolicy; | 300 Member<ContentSecurityPolicy> m_contentSecurityPolicy; |
287 ClientHintsPreferences m_clientHintsPreferences; | 301 ClientHintsPreferences m_clientHintsPreferences; |
288 InitialScrollState m_initialScrollState; | 302 InitialScrollState m_initialScrollState; |
289 | 303 |
290 bool m_wasBlockedAfterCSP; | 304 bool m_wasBlockedAfterCSP; |
291 | 305 |
292 enum State { | 306 enum State { |
293 NotStarted, | 307 NotStarted, |
294 Provisional, | 308 Provisional, |
295 Committed, | 309 Committed, |
296 SentDidFinishLoad | 310 SentDidFinishLoad |
297 }; | 311 }; |
298 State m_state; | 312 State m_state; |
299 | 313 |
300 // Used to protect against reentrancy into dataReceived(). | 314 // Used to protect against reentrancy into dataReceived(). |
301 bool m_inDataReceived; | 315 bool m_inDataReceived; |
302 RefPtr<SharedBuffer> m_dataBuffer; | 316 RefPtr<SharedBuffer> m_dataBuffer; |
303 }; | 317 }; |
304 | 318 |
305 DECLARE_WEAK_IDENTIFIER_MAP(DocumentLoader); | 319 DECLARE_WEAK_IDENTIFIER_MAP(DocumentLoader); |
306 | 320 |
307 } // namespace blink | 321 } // namespace blink |
308 | 322 |
309 #endif // DocumentLoader_h | 323 #endif // DocumentLoader_h |
OLD | NEW |