| 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 "FetchManager.h" | 6 #include "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" |
| 11 #include "bindings/core/v8/V8ThrowException.h" | 11 #include "bindings/core/v8/V8ThrowException.h" |
| 12 #include "core/dom/ExceptionCode.h" | 12 #include "core/dom/ExceptionCode.h" |
| 13 #include "core/fileapi/Blob.h" | 13 #include "core/fileapi/Blob.h" |
| 14 #include "core/loader/ThreadableLoader.h" | 14 #include "core/loader/ThreadableLoader.h" |
| 15 #include "core/loader/ThreadableLoaderClient.h" | 15 #include "core/loader/ThreadableLoaderClient.h" |
| 16 #include "core/xml/XMLHttpRequest.h" | 16 #include "core/xml/XMLHttpRequest.h" |
| 17 #include "modules/serviceworkers/Response.h" | 17 #include "modules/serviceworkers/Response.h" |
| 18 #include "modules/serviceworkers/ResponseInit.h" | 18 #include "modules/serviceworkers/ResponseInit.h" |
| 19 #include "platform/network/ResourceRequest.h" | 19 #include "platform/network/ResourceRequest.h" |
| 20 #include "wtf/HashSet.h" | 20 #include "wtf/HashSet.h" |
| 21 | 21 |
| 22 namespace WebCore { | 22 namespace blink { |
| 23 | 23 |
| 24 class FetchManager::Loader : public ThreadableLoaderClient { | 24 class FetchManager::Loader : public ThreadableLoaderClient { |
| 25 public: | 25 public: |
| 26 Loader(ExecutionContext*, FetchManager*, PassRefPtr<ScriptPromiseResolver>,
PassOwnPtr<ResourceRequest>); | 26 Loader(ExecutionContext*, FetchManager*, PassRefPtr<ScriptPromiseResolver>,
PassOwnPtr<ResourceRequest>); |
| 27 ~Loader(); | 27 ~Loader(); |
| 28 virtual void didReceiveResponse(unsigned long, const ResourceResponse&); | 28 virtual void didReceiveResponse(unsigned long, const ResourceResponse&); |
| 29 virtual void didFinishLoading(unsigned long, double); | 29 virtual void didFinishLoading(unsigned long, double); |
| 30 virtual void didFail(const ResourceError&); | 30 virtual void didFail(const ResourceError&); |
| 31 virtual void didFailAccessControlCheck(const ResourceError&); | 31 virtual void didFailAccessControlCheck(const ResourceError&); |
| 32 virtual void didFailRedirectCheck(); | 32 virtual void didFailRedirectCheck(); |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 return !XMLHttpRequest::isAllowedHTTPMethod(method); | 189 return !XMLHttpRequest::isAllowedHTTPMethod(method); |
| 190 } | 190 } |
| 191 | 191 |
| 192 bool FetchManager::isUsefulMethod(const String& method) | 192 bool FetchManager::isUsefulMethod(const String& method) |
| 193 { | 193 { |
| 194 // "A useful method is a method that is not a forbidden method." | 194 // "A useful method is a method that is not a forbidden method." |
| 195 // "A forbidden method is a method that is a byte case-insensitive match for
one of `CONNECT`, `TRACE`, and `TRACK`." | 195 // "A forbidden method is a method that is a byte case-insensitive match for
one of `CONNECT`, `TRACE`, and `TRACK`." |
| 196 return XMLHttpRequest::isAllowedHTTPMethod(method); | 196 return XMLHttpRequest::isAllowedHTTPMethod(method); |
| 197 } | 197 } |
| 198 | 198 |
| 199 } // namespace WebCore | 199 } // namespace blink |
| OLD | NEW |