Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Unified Diff: Source/modules/serviceworkers/FetchManager.cpp

Issue 379113002: Move fetch-related predicates to core/fetch. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/serviceworkers/FetchManager.h ('k') | Source/modules/serviceworkers/Headers.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/serviceworkers/FetchManager.cpp
diff --git a/Source/modules/serviceworkers/FetchManager.cpp b/Source/modules/serviceworkers/FetchManager.cpp
index 80345e880eaa8b02276a7d8f5185fa7370947d74..a8abb9d86f27b2dc18fe93f90a43796ec7413ca8 100644
--- a/Source/modules/serviceworkers/FetchManager.cpp
+++ b/Source/modules/serviceworkers/FetchManager.cpp
@@ -10,10 +10,10 @@
#include "bindings/core/v8/ScriptState.h"
#include "bindings/core/v8/V8ThrowException.h"
#include "core/dom/ExceptionCode.h"
+#include "core/fetch/FetchUtils.h"
#include "core/fileapi/Blob.h"
#include "core/loader/ThreadableLoader.h"
#include "core/loader/ThreadableLoaderClient.h"
-#include "core/xml/XMLHttpRequest.h"
#include "modules/serviceworkers/FetchRequestData.h"
#include "modules/serviceworkers/Response.h"
#include "modules/serviceworkers/ResponseInit.h"
@@ -200,7 +200,7 @@ void FetchManager::Loader::start()
// simple header"
if (m_request->mode() == FetchRequestData::CORSWithForcedPreflight
|| (m_request->unsafeRequestFlag()
- && (!isSimpleMethod(m_request->method())
+ && (!FetchUtils::isSimpleMethod(m_request->method())
|| m_request->headerList()->containsNonSimpleHeader()))) {
// "Set |request|'s response tainting to |CORS|."
m_request->setResponseTainting(FetchRequestData::CORSTainting);
@@ -352,25 +352,4 @@ void FetchManager::onLoaderFinished(Loader* loader)
m_loaders.remove(loader);
}
-bool FetchManager::isSimpleMethod(const String& method)
-{
- // "A simple method is a method that is `GET`, `HEAD`, or `POST`."
- return isOnAccessControlSimpleRequestMethodWhitelist(method);
-}
-
-bool FetchManager::isForbiddenMethod(const String& method)
-{
- // "A forbidden method is a method that is a byte case-insensitive match for
- // one of `CONNECT`, `TRACE`, and `TRACK`."
- return !XMLHttpRequest::isAllowedHTTPMethod(method);
-}
-
-bool FetchManager::isUsefulMethod(const String& method)
-{
- // "A useful method is a method that is not a forbidden method."
- // "A forbidden method is a method that is a byte case-insensitive match for
- // one of `CONNECT`, `TRACE`, and `TRACK`."
- return XMLHttpRequest::isAllowedHTTPMethod(method);
-}
-
} // namespace blink
« no previous file with comments | « Source/modules/serviceworkers/FetchManager.h ('k') | Source/modules/serviceworkers/Headers.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698