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

Unified Diff: third_party/WebKit/Source/core/loader/appcache/ApplicationCacheHost.cpp

Issue 2747203002: Make prepareRequest() a separate callback of FetchContext (Closed)
Patch Set: addressed comments Created 3 years, 9 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: third_party/WebKit/Source/core/loader/appcache/ApplicationCacheHost.cpp
diff --git a/third_party/WebKit/Source/core/loader/appcache/ApplicationCacheHost.cpp b/third_party/WebKit/Source/core/loader/appcache/ApplicationCacheHost.cpp
index b61b7363f2b44bef0bb6753103b14867c5b49f88..50e324b5732ff4d18e79fb0a34b1631e6035dddc 100644
--- a/third_party/WebKit/Source/core/loader/appcache/ApplicationCacheHost.cpp
+++ b/third_party/WebKit/Source/core/loader/appcache/ApplicationCacheHost.cpp
@@ -51,6 +51,7 @@
#include "platform/weborigin/SecurityOrigin.h"
#include "public/platform/WebURL.h"
#include "public/platform/WebURLError.h"
+#include "public/platform/WebURLRequest.h"
#include "public/platform/WebURLResponse.h"
#include "public/platform/WebVector.h"
@@ -72,14 +73,25 @@ ApplicationCacheHost::~ApplicationCacheHost() {
DCHECK(!m_host);
}
+void ApplicationCacheHost::willStartLoading(ResourceRequest& request) {
+ if (!isApplicationCacheEnabled())
+ return;
+
+ if (request.frameType() == WebURLRequest::FrameTypeTopLevel ||
+ request.frameType() == WebURLRequest::FrameTypeNested) {
+ willStartLoadingMainResource(request);
+ } else {
+ willStartLoadingResource(request);
+ }
+}
+
void ApplicationCacheHost::willStartLoadingMainResource(
ResourceRequest& request) {
// We defer creating the outer host object to avoid spurious
// creation/destruction around creating empty documents. At this point, we're
// initiating a main resource load for the document, so its for real.
- if (!isApplicationCacheEnabled())
- return;
+ DCHECK(isApplicationCacheEnabled());
DCHECK(m_documentLoader->frame());
LocalFrame& frame = *m_documentLoader->frame();

Powered by Google App Engine
This is Rietveld 408576698