| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "modules/fetch/FetchManager.h" | 5 #include "modules/fetch/FetchManager.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/ExceptionState.h" | 7 #include "bindings/core/v8/ExceptionState.h" |
| 8 #include "bindings/core/v8/ScriptPromiseResolver.h" | 8 #include "bindings/core/v8/ScriptPromiseResolver.h" |
| 9 #include "bindings/core/v8/ScriptState.h" | 9 #include "bindings/core/v8/ScriptState.h" |
| 10 #include "bindings/core/v8/V8ThrowException.h" | 10 #include "bindings/core/v8/V8ThrowException.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 #include "modules/fetch/ResponseInit.h" | 32 #include "modules/fetch/ResponseInit.h" |
| 33 #include "platform/HTTPNames.h" | 33 #include "platform/HTTPNames.h" |
| 34 #include "platform/network/ResourceError.h" | 34 #include "platform/network/ResourceError.h" |
| 35 #include "platform/network/ResourceRequest.h" | 35 #include "platform/network/ResourceRequest.h" |
| 36 #include "platform/network/ResourceResponse.h" | 36 #include "platform/network/ResourceResponse.h" |
| 37 #include "platform/weborigin/SchemeRegistry.h" | 37 #include "platform/weborigin/SchemeRegistry.h" |
| 38 #include "platform/weborigin/SecurityOrigin.h" | 38 #include "platform/weborigin/SecurityOrigin.h" |
| 39 #include "platform/weborigin/SecurityPolicy.h" | 39 #include "platform/weborigin/SecurityPolicy.h" |
| 40 #include "public/platform/WebURLRequest.h" | 40 #include "public/platform/WebURLRequest.h" |
| 41 #include "wtf/HashSet.h" | 41 #include "wtf/HashSet.h" |
| 42 #include "wtf/OwnPtr.h" |
| 42 #include "wtf/Vector.h" | 43 #include "wtf/Vector.h" |
| 43 #include "wtf/text/WTFString.h" | 44 #include "wtf/text/WTFString.h" |
| 44 | 45 |
| 45 namespace blink { | 46 namespace blink { |
| 46 | 47 |
| 47 namespace { | 48 namespace { |
| 48 | 49 |
| 49 bool IsRedirectStatusCode(int statusCode) | 50 bool IsRedirectStatusCode(int statusCode) |
| 50 { | 51 { |
| 51 return (statusCode == 301 || statusCode == 302 || statusCode == 303 || statu
sCode == 307 || statusCode == 308); | 52 return (statusCode == 301 || statusCode == 302 || statusCode == 303 || statu
sCode == 307 || statusCode == 308); |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 void performHTTPFetch(bool corsFlag, bool corsPreflightFlag); | 161 void performHTTPFetch(bool corsFlag, bool corsPreflightFlag); |
| 161 void performDataFetch(); | 162 void performDataFetch(); |
| 162 void failed(const String& message); | 163 void failed(const String& message); |
| 163 void notifyFinished(); | 164 void notifyFinished(); |
| 164 Document* document() const; | 165 Document* document() const; |
| 165 void loadSucceeded(); | 166 void loadSucceeded(); |
| 166 | 167 |
| 167 Member<FetchManager> m_fetchManager; | 168 Member<FetchManager> m_fetchManager; |
| 168 Member<ScriptPromiseResolver> m_resolver; | 169 Member<ScriptPromiseResolver> m_resolver; |
| 169 Member<FetchRequestData> m_request; | 170 Member<FetchRequestData> m_request; |
| 170 RefPtr<ThreadableLoader> m_loader; | 171 OwnPtr<ThreadableLoader> m_loader; |
| 171 bool m_failed; | 172 bool m_failed; |
| 172 bool m_finished; | 173 bool m_finished; |
| 173 int m_responseHttpStatusCode; | 174 int m_responseHttpStatusCode; |
| 174 Member<SRIVerifier> m_integrityVerifier; | 175 Member<SRIVerifier> m_integrityVerifier; |
| 175 bool m_didFinishLoading; | 176 bool m_didFinishLoading; |
| 176 bool m_isIsolatedWorld; | 177 bool m_isIsolatedWorld; |
| 177 RawPtrWillBeMember<ExecutionContext> m_executionContext; | 178 RawPtrWillBeMember<ExecutionContext> m_executionContext; |
| 178 }; | 179 }; |
| 179 | 180 |
| 180 FetchManager::Loader::Loader(ExecutionContext* executionContext, FetchManager* f
etchManager, ScriptPromiseResolver* resolver, FetchRequestData* request, bool is
IsolatedWorld) | 181 FetchManager::Loader::Loader(ExecutionContext* executionContext, FetchManager* f
etchManager, ScriptPromiseResolver* resolver, FetchRequestData* request, bool is
IsolatedWorld) |
| (...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 721 loader->dispose(); | 722 loader->dispose(); |
| 722 } | 723 } |
| 723 | 724 |
| 724 DEFINE_TRACE(FetchManager) | 725 DEFINE_TRACE(FetchManager) |
| 725 { | 726 { |
| 726 visitor->trace(m_loaders); | 727 visitor->trace(m_loaders); |
| 727 ContextLifecycleObserver::trace(visitor); | 728 ContextLifecycleObserver::trace(visitor); |
| 728 } | 729 } |
| 729 | 730 |
| 730 } // namespace blink | 731 } // namespace blink |
| OLD | NEW |