| 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 820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 831 threadableLoaderOptions.crossOriginRequestPolicy = UseAccessControl; | 831 threadableLoaderOptions.crossOriginRequestPolicy = UseAccessControl; |
| 832 break; | 832 break; |
| 833 case WebURLRequest::FetchRequestModeNavigate: | 833 case WebURLRequest::FetchRequestModeNavigate: |
| 834 // Using DenyCrossOriginRequests here to reduce the security risk. | 834 // Using DenyCrossOriginRequests here to reduce the security risk. |
| 835 // "navigate" request is only available in ServiceWorker. | 835 // "navigate" request is only available in ServiceWorker. |
| 836 threadableLoaderOptions.crossOriginRequestPolicy = | 836 threadableLoaderOptions.crossOriginRequestPolicy = |
| 837 DenyCrossOriginRequests; | 837 DenyCrossOriginRequests; |
| 838 break; | 838 break; |
| 839 } | 839 } |
| 840 InspectorInstrumentation::willStartFetch(m_executionContext, this); | 840 InspectorInstrumentation::willStartFetch(m_executionContext, this); |
| 841 // TODO(yhirano): Remove this CHECK once https://crbug.com/667254 is fixed. |
| 842 CHECK(!m_loader); |
| 841 m_loader = | 843 m_loader = |
| 842 ThreadableLoader::create(*m_executionContext, this, | 844 ThreadableLoader::create(*m_executionContext, this, |
| 843 threadableLoaderOptions, resourceLoaderOptions); | 845 threadableLoaderOptions, resourceLoaderOptions); |
| 844 m_loader->start(request); | 846 m_loader->start(request); |
| 845 } | 847 } |
| 846 | 848 |
| 847 // performDataFetch() is almost the same as performHTTPFetch(), except for: | 849 // performDataFetch() is almost the same as performHTTPFetch(), except for: |
| 848 // - We set AllowCrossOriginRequests to allow requests to data: URLs in | 850 // - We set AllowCrossOriginRequests to allow requests to data: URLs in |
| 849 // 'same-origin' mode. | 851 // 'same-origin' mode. |
| 850 // - We reject non-GET method. | 852 // - We reject non-GET method. |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 932 m_loaders.remove(loader); | 934 m_loaders.remove(loader); |
| 933 loader->dispose(); | 935 loader->dispose(); |
| 934 } | 936 } |
| 935 | 937 |
| 936 DEFINE_TRACE(FetchManager) { | 938 DEFINE_TRACE(FetchManager) { |
| 937 visitor->trace(m_loaders); | 939 visitor->trace(m_loaders); |
| 938 ContextLifecycleObserver::trace(visitor); | 940 ContextLifecycleObserver::trace(visitor); |
| 939 } | 941 } |
| 940 | 942 |
| 941 } // namespace blink | 943 } // namespace blink |
| OLD | NEW |