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

Unified Diff: content/browser/appcache/appcache_service_impl.cc

Issue 2642733002: Prerender: Disable prefetch if there's an appcache. (Closed)
Patch Set: comments Created 3 years, 10 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: content/browser/appcache/appcache_service_impl.cc
diff --git a/content/browser/appcache/appcache_service_impl.cc b/content/browser/appcache/appcache_service_impl.cc
index 2978f4993077ccc99260e720f3c1b8c38749d117..854c6bd845c7cd77dce5dd7c1e1bf2dda01ef229 100644
--- a/content/browser/appcache/appcache_service_impl.cc
+++ b/content/browser/appcache/appcache_service_impl.cc
@@ -20,8 +20,10 @@
#include "content/browser/appcache/appcache_entry.h"
#include "content/browser/appcache/appcache_executable_handler.h"
#include "content/browser/appcache/appcache_histograms.h"
+#include "content/browser/appcache/appcache_interceptor.h"
#include "content/browser/appcache/appcache_policy.h"
#include "content/browser/appcache/appcache_quota_client.h"
+#include "content/browser/appcache/appcache_request_handler.h"
#include "content/browser/appcache/appcache_response.h"
#include "content/browser/appcache/appcache_service_impl.h"
#include "content/browser/appcache/appcache_storage_impl.h"
@@ -527,4 +529,20 @@ void AppCacheServiceImpl::UnregisterBackend(
backends_.erase(backend_impl->process_id());
}
+// Static AppCacheService methods -------
+
+// static
+bool AppCacheService::URLRequestHasActiveAppCache(net::URLRequest* request) {
+ AppCacheRequestHandler* appcache_handle =
+ AppCacheInterceptor::GetHandler(request);
+ if (appcache_handle) {
+ int64_t appcache_id;
+ GURL unused_manifest_url;
+ appcache_handle->GetExtraResponseInfo(&appcache_id, &unused_manifest_url);
+ if (appcache_id != kAppCacheNoCacheId)
+ return true;
+ }
+ return false;
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698