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

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

Issue 1313733006: Allowing registering arbitrary schemes as supporting the fetch API. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: SupportingFetchAPI Created 5 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
Index: Source/modules/fetch/FetchManager.cpp
diff --git a/Source/modules/fetch/FetchManager.cpp b/Source/modules/fetch/FetchManager.cpp
index 3bc85626789af65ff5d3f21a72cbd496518ea0c4..dcc1c1afd8301f59f7a5caad2688d6a20faa68ec 100644
--- a/Source/modules/fetch/FetchManager.cpp
+++ b/Source/modules/fetch/FetchManager.cpp
@@ -34,6 +34,7 @@
#include "platform/network/ResourceError.h"
#include "platform/network/ResourceRequest.h"
#include "platform/network/ResourceResponse.h"
+#include "platform/weborigin/SchemeRegistry.h"
#include "platform/weborigin/SecurityOrigin.h"
#include "public/platform/WebURLRequest.h"
#include "wtf/HashSet.h"
@@ -440,7 +441,7 @@ void FetchManager::Loader::performBasicFetch()
{
// "To perform a basic fetch using |request|, switch on |request|'s url's
// scheme, and run the associated steps:"
- if (m_request->url().protocolIsInHTTPFamily()) {
+ if (SchemeRegistry::shouldTreatURLSchemeAsSupportingFetchAPI(m_request->url().protocol())) {
pdr. 2015/08/25 21:25:09 This code is in the critical path but has to wait
not at google - send to devlin 2015/08/25 22:04:45 (I will defer to fetch owner to answer this)
tyoshino (SeeGerritForStatus) 2015/08/26 07:24:48 We already have one in DocumentThreadableLoader. A
// "Return the result of performing an HTTP fetch using |request|."
performHTTPFetch(false, false);
} else {
@@ -456,7 +457,7 @@ void FetchManager::Loader::performNetworkError(const String& message)
void FetchManager::Loader::performHTTPFetch(bool corsFlag, bool corsPreflightFlag)
{
- ASSERT(m_request->url().protocolIsInHTTPFamily());
+ ASSERT(SchemeRegistry::shouldTreatURLSchemeAsSupportingFetchAPI(m_request->url().protocol()));
// CORS preflight fetch procedure is implemented inside DocumentThreadableLoader.
// "1. Let |HTTPRequest| be a copy of |request|, except that |HTTPRequest|'s
« no previous file with comments | « no previous file | Source/platform/weborigin/SchemeRegistry.h » ('j') | Source/platform/weborigin/SchemeRegistry.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698