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

Unified Diff: Source/core/loader/DocumentThreadableLoader.cpp

Issue 1243353002: Skip the Service Worker CORS fallback for same origin requests. [1/2 blink] (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: incorporated tyoshino's comment Created 5 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/DocumentThreadableLoader.cpp
diff --git a/Source/core/loader/DocumentThreadableLoader.cpp b/Source/core/loader/DocumentThreadableLoader.cpp
index 8b84b7147cada891d7ace3393be6bb007a543489..2516ff941788ef145fc92e332eda17a3f1fe2017 100644
--- a/Source/core/loader/DocumentThreadableLoader.cpp
+++ b/Source/core/loader/DocumentThreadableLoader.cpp
@@ -452,7 +452,17 @@ void DocumentThreadableLoader::handleResponse(unsigned long identifier, const Re
return;
}
- ASSERT(!m_fallbackRequestForServiceWorker);
+ // Even if the request met the conditions to get handled by a Service Worker
+ // in the constructor of this class (and therefore
+ // |m_fallbackRequestForServiceWorker| is set), the Service Worker may skip
+ // processing the request. Only if the request is same origin, the skipped
+ // response may come here (wasFetchedViaServiceWorker() returns false) since
+ // such a request doesn't have to go through the CORS algorithm by calling
+ // loadFallbackRequestForServiceWorker().
+ // FIXME: We should use |m_sameOriginRequest| when we will support
+ // Suborigins for Service Worker.
falken 2015/07/22 22:05:56 Can you link to a bug or make it more clear to fut
horo 2015/07/23 03:33:56 Done.
+ ASSERT(!m_fallbackRequestForServiceWorker || securityOrigin()->canRequest(m_fallbackRequestForServiceWorker->url()));
+ m_fallbackRequestForServiceWorker = nullptr;
if (!m_sameOriginRequest && m_options.crossOriginRequestPolicy == UseAccessControl) {
String accessControlErrorDescription;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698