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

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

Issue 1390943003: Bypass ServiceWorker when the request originates from isolated world. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 1 month 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 | « third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/fetch/FetchManager.cpp
diff --git a/third_party/WebKit/Source/modules/fetch/FetchManager.cpp b/third_party/WebKit/Source/modules/fetch/FetchManager.cpp
index 5c309bf192aac36b29354f6efb09a1189941cfcc..9014e6a8ba487f4fbbbaf8147574123c149b3cf7 100644
--- a/third_party/WebKit/Source/modules/fetch/FetchManager.cpp
+++ b/third_party/WebKit/Source/modules/fetch/FetchManager.cpp
@@ -56,9 +56,9 @@ bool IsRedirectStatusCode(int statusCode)
class FetchManager::Loader final : public GarbageCollectedFinalized<FetchManager::Loader>, public ThreadableLoaderClient, public ContextLifecycleObserver {
WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(FetchManager::Loader);
public:
- static Loader* create(ExecutionContext* executionContext, FetchManager* fetchManager, ScriptPromiseResolver* resolver, FetchRequestData* request)
+ static Loader* create(ExecutionContext* executionContext, FetchManager* fetchManager, ScriptPromiseResolver* resolver, FetchRequestData* request, bool isIsolatedWorld)
{
- return new Loader(executionContext, fetchManager, resolver, request);
+ return new Loader(executionContext, fetchManager, resolver, request, isIsolatedWorld);
}
~Loader() override;
@@ -151,7 +151,7 @@ public:
};
private:
- Loader(ExecutionContext*, FetchManager*, ScriptPromiseResolver*, FetchRequestData*);
+ Loader(ExecutionContext*, FetchManager*, ScriptPromiseResolver*, FetchRequestData*, bool isIsolatedWorld);
void performBasicFetch();
void performNetworkError(const String& message);
@@ -171,9 +171,10 @@ private:
int m_responseHttpStatusCode;
Member<SRIVerifier> m_integrityVerifier;
bool m_didFinishLoading;
+ bool m_isIsolatedWorld;
};
-FetchManager::Loader::Loader(ExecutionContext* executionContext, FetchManager* fetchManager, ScriptPromiseResolver* resolver, FetchRequestData* request)
+FetchManager::Loader::Loader(ExecutionContext* executionContext, FetchManager* fetchManager, ScriptPromiseResolver* resolver, FetchRequestData* request, bool isIsolatedWorld)
: ContextLifecycleObserver(executionContext)
, m_fetchManager(fetchManager)
, m_resolver(resolver)
@@ -183,6 +184,7 @@ FetchManager::Loader::Loader(ExecutionContext* executionContext, FetchManager* f
, m_responseHttpStatusCode(0)
, m_integrityVerifier(nullptr)
, m_didFinishLoading(false)
+ , m_isIsolatedWorld(isIsolatedWorld)
{
}
@@ -561,6 +563,7 @@ void FetchManager::Loader::performHTTPFetch(bool corsFlag, bool corsPreflightFla
// referrer string (i.e. String()).
request.setHTTPReferrer(SecurityPolicy::generateReferrer(policy, m_request->url(), m_request->referrerString()));
}
+ request.setSkipServiceWorker(m_isIsolatedWorld);
// "3. Append `Host`, ..."
// FIXME: Implement this when the spec is fixed.
@@ -691,7 +694,7 @@ ScriptPromise FetchManager::fetch(ScriptState* scriptState, FetchRequestData* re
request->setContext(WebURLRequest::RequestContextFetch);
- Loader* loader = Loader::create(m_executionContext, this, resolver, request);
+ Loader* loader = Loader::create(m_executionContext, this, resolver, request, scriptState->world().isIsolatedWorld());
m_loaders.add(loader);
loader->start();
return promise;
« no previous file with comments | « third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698