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

Unified Diff: Source/modules/serviceworkers/Headers.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.cpp ('k') | Source/modules/serviceworkers/Request.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/serviceworkers/Headers.cpp
diff --git a/Source/modules/serviceworkers/Headers.cpp b/Source/modules/serviceworkers/Headers.cpp
index a3a17a949c6f90fd12800a77befa351ce94c834a..0493a4cd859f4b12aae4263e09e138d5d5cfd2ba 100644
--- a/Source/modules/serviceworkers/Headers.cpp
+++ b/Source/modules/serviceworkers/Headers.cpp
@@ -7,7 +7,7 @@
#include "bindings/core/v8/Dictionary.h"
#include "bindings/core/v8/ExceptionState.h"
-#include "core/fetch/CrossOriginAccessControl.h"
+#include "core/fetch/FetchUtils.h"
#include "core/xml/XMLHttpRequest.h"
#include "modules/serviceworkers/HeadersForEachCallback.h"
#include "wtf/NotFound.h"
@@ -90,15 +90,15 @@ void Headers::append(const String& name, const String& value, ExceptionState& ex
}
// "3. Otherwise, if guard is |request| and |name| is a forbidden header
// name, return."
- if (m_guard == RequestGuard && FetchHeaderList::isForbiddenHeaderName(name))
+ if (m_guard == RequestGuard && FetchUtils::isForbiddenHeaderName(name))
return;
// "4. Otherwise, if guard is |request-no-CORS| and |name|/|value| is not a
// simple header, return."
- if (m_guard == RequestNoCORSGuard && !FetchHeaderList::isSimpleHeader(name, value))
+ if (m_guard == RequestNoCORSGuard && !FetchUtils::isSimpleHeader(AtomicString(name), AtomicString(value)))
return;
// "5. Otherwise, if guard is |response| and |name| is a forbidden response
// header name, return."
- if (m_guard == ResponseGuard && FetchHeaderList::isForbiddenResponseHeaderName(name))
+ if (m_guard == ResponseGuard && FetchUtils::isForbiddenResponseHeaderName(name))
return;
// "6. Append |name|/|value| to header list."
m_headerList->append(name, value);
@@ -119,15 +119,15 @@ void Headers::remove(const String& name, ExceptionState& exceptionState)
}
// "3. Otherwise, if guard is |request| and |name| is a forbidden header
// name, return."
- if (m_guard == RequestGuard && FetchHeaderList::isForbiddenHeaderName(name))
+ if (m_guard == RequestGuard && FetchUtils::isForbiddenHeaderName(name))
return;
// "4. Otherwise, if guard is |request-no-CORS| and |name|/`invalid` is not
// a simple header, return."
- if (m_guard == RequestNoCORSGuard && !FetchHeaderList::isSimpleHeader(name, "invalid"))
+ if (m_guard == RequestNoCORSGuard && !FetchUtils::isSimpleHeader(AtomicString(name), "invalid"))
return;
// "5. Otherwise, if guard is |response| and |name| is a forbidden response
// header name, return."
- if (m_guard == ResponseGuard && FetchHeaderList::isForbiddenResponseHeaderName(name))
+ if (m_guard == ResponseGuard && FetchUtils::isForbiddenResponseHeaderName(name))
return;
// "6. Delete |name| from header list."
m_headerList->remove(name);
@@ -196,15 +196,15 @@ void Headers::set(const String& name, const String& value, ExceptionState& excep
}
// "3. Otherwise, if guard is |request| and |name| is a forbidden header
// name, return."
- if (m_guard == RequestGuard && FetchHeaderList::isForbiddenHeaderName(name))
+ if (m_guard == RequestGuard && FetchUtils::isForbiddenHeaderName(name))
return;
// "4. Otherwise, if guard is |request-no-CORS| and |name|/|value| is not a
// simple header, return."
- if (m_guard == RequestNoCORSGuard && !FetchHeaderList::isSimpleHeader(name, value))
+ if (m_guard == RequestNoCORSGuard && !FetchUtils::isSimpleHeader(AtomicString(name), AtomicString(value)))
return;
// "5. Otherwise, if guard is |response| and |name| is a forbidden response
// header name, return."
- if (m_guard == ResponseGuard && FetchHeaderList::isForbiddenResponseHeaderName(name))
+ if (m_guard == ResponseGuard && FetchUtils::isForbiddenResponseHeaderName(name))
return;
// "6. Set |name|/|value| in header list."
m_headerList->set(name, value);
« no previous file with comments | « Source/modules/serviceworkers/FetchManager.cpp ('k') | Source/modules/serviceworkers/Request.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698