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

Unified Diff: Source/core/fetch/ResourceFetcher.cpp

Issue 655373003: [ServiceWorker] Fix ResourceFetcher::isControlledByServiceWorker to support HTMLImports. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: change assert Created 6 years, 2 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 | Source/core/fetch/ResourceLoader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/fetch/ResourceFetcher.cpp
diff --git a/Source/core/fetch/ResourceFetcher.cpp b/Source/core/fetch/ResourceFetcher.cpp
index ae2f7d328460eee28afc29c6c7c9ed0439ebad0c..efc69a7dbbcacc36fcf2f134c6780c8e59d6ffa5 100644
--- a/Source/core/fetch/ResourceFetcher.cpp
+++ b/Source/core/fetch/ResourceFetcher.cpp
@@ -619,9 +619,13 @@ bool ResourceFetcher::isControlledByServiceWorker() const
LocalFrame* localFrame = frame();
if (!localFrame)
return false;
- if (!m_documentLoader)
- return false;
- return localFrame->loader().client()->isControlledByServiceWorker(*m_documentLoader);
+ ASSERT(m_documentLoader || localFrame->loader().documentLoader());
+ if (m_documentLoader)
+ return localFrame->loader().client()->isControlledByServiceWorker(*m_documentLoader);
+ // m_documentLoader is null while loading resources from the imported HTML.
+ // In such cases whether the request is controlled by ServiceWorker or not
+ // is determined by the document loader of the frame.
+ return localFrame->loader().client()->isControlledByServiceWorker(*localFrame->loader().documentLoader());
}
bool ResourceFetcher::shouldLoadNewResource(Resource::Type type) const
« no previous file with comments | « no previous file | Source/core/fetch/ResourceLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698