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 "config.h" | 5 #include "config.h" |
6 #include "modules/fetch/FetchManager.h" | 6 #include "modules/fetch/FetchManager.h" |
7 | 7 |
8 #include "bindings/core/v8/ExceptionState.h" | 8 #include "bindings/core/v8/ExceptionState.h" |
9 #include "bindings/core/v8/ScriptPromiseResolver.h" | 9 #include "bindings/core/v8/ScriptPromiseResolver.h" |
10 #include "bindings/core/v8/ScriptState.h" | 10 #include "bindings/core/v8/ScriptState.h" |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 failed("Fetch API cannot load " + error.failingURL() + ". " + error.localize
dDescription()); | 163 failed("Fetch API cannot load " + error.failingURL() + ". " + error.localize
dDescription()); |
164 } | 164 } |
165 | 165 |
166 void FetchManager::Loader::didFailRedirectCheck() | 166 void FetchManager::Loader::didFailRedirectCheck() |
167 { | 167 { |
168 failed("Fetch API cannot load " + m_request->url().string() + ". Redirect fa
iled."); | 168 failed("Fetch API cannot load " + m_request->url().string() + ". Redirect fa
iled."); |
169 } | 169 } |
170 | 170 |
171 void FetchManager::Loader::start() | 171 void FetchManager::Loader::start() |
172 { | 172 { |
| 173 if (!executionContext()->isServiceWorkerGlobalScope() |
| 174 && m_request->mode() == WebURLRequest::FetchRequestModeNoCORS) { |
| 175 performNetworkError("no-cors is disabled for non-serviceworker."); |
| 176 return; |
| 177 } |
| 178 |
173 // "1. If |request|'s url contains a Known HSTS Host, modify it per the | 179 // "1. If |request|'s url contains a Known HSTS Host, modify it per the |
174 // requirements of the 'URI [sic] Loading and Port Mapping' chapter of HTTP | 180 // requirements of the 'URI [sic] Loading and Port Mapping' chapter of HTTP |
175 // Strict Transport Security." | 181 // Strict Transport Security." |
176 // FIXME: Implement this. | 182 // FIXME: Implement this. |
177 | 183 |
178 // "2. If |request|'s referrer is not none, set |request|'s referrer to the | 184 // "2. If |request|'s referrer is not none, set |request|'s referrer to the |
179 // result of invoking determine |request|'s referrer." | 185 // result of invoking determine |request|'s referrer." |
180 // We set the referrer using workerGlobalScope's URL in | 186 // We set the referrer using workerGlobalScope's URL in |
181 // WorkerThreadableLoader. | 187 // WorkerThreadableLoader. |
182 | 188 |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 | 436 |
431 DEFINE_TRACE(FetchManager) | 437 DEFINE_TRACE(FetchManager) |
432 { | 438 { |
433 #if ENABLE(OILPAN) | 439 #if ENABLE(OILPAN) |
434 visitor->trace(m_executionContext); | 440 visitor->trace(m_executionContext); |
435 visitor->trace(m_loaders); | 441 visitor->trace(m_loaders); |
436 #endif | 442 #endif |
437 } | 443 } |
438 | 444 |
439 } // namespace blink | 445 } // namespace blink |
OLD | NEW |