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

Unified Diff: content/browser/loader/resource_dispatcher_host_impl.cc

Issue 2501343003: PlzNavigate: AppCache support. (Closed)
Patch Set: Address review comments Created 4 years 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/loader/resource_dispatcher_host_impl.cc
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc
index fad7d214783f44ff611a9918f0859c664bbd2166..f537b21be4af4cc3eb5ba3c9e597b9743826a20b 100644
--- a/content/browser/loader/resource_dispatcher_host_impl.cc
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -34,6 +34,7 @@
#include "base/third_party/dynamic_annotations/dynamic_annotations.h"
#include "base/timer/timer.h"
#include "content/browser/appcache/appcache_interceptor.h"
+#include "content/browser/appcache/appcache_navigation_handle_core.h"
#include "content/browser/appcache/chrome_appcache_service.h"
#include "content/browser/bad_message.h"
#include "content/browser/blob_storage/chrome_blob_storage_context.h"
@@ -2112,7 +2113,8 @@ void ResourceDispatcherHostImpl::BeginNavigationRequest(
const NavigationRequestInfo& info,
std::unique_ptr<NavigationUIData> navigation_ui_data,
NavigationURLLoaderImplCore* loader,
- ServiceWorkerNavigationHandleCore* service_worker_handle_core) {
+ ServiceWorkerNavigationHandleCore* service_worker_handle_core,
+ AppCacheNavigationHandleCore* appcache_handle_core) {
// PlzNavigate: BeginNavigationRequest currently should only be used for the
// browser-side navigations project.
CHECK(IsBrowserSideNavigationEnabled());
@@ -2268,21 +2270,25 @@ void ResourceDispatcherHostImpl::BeginNavigationRequest(
info.begin_params.request_context_type, frame_type,
info.are_ancestors_secure, info.common_params.post_data);
- // TODO(davidben): Attach AppCacheInterceptor.
+ // Have the appcache associate its extra info with the request.
+ if (appcache_handle_core) {
+ AppCacheInterceptor::SetExtraRequestInfoForHost(
+ new_request.get(), appcache_handle_core->host(), resource_type, false);
+ }
std::unique_ptr<ResourceHandler> handler(
new NavigationResourceHandler(new_request.get(), loader, delegate()));
- // TODO(davidben): Pass in the appropriate appcache_service. Also fix the
- // dependency on child_id/route_id. Those are used by the ResourceScheduler;
- // currently it's a no-op.
- handler =
- AddStandardHandlers(new_request.get(), resource_type, resource_context,
- info.begin_params.request_context_type,
- nullptr, // appcache_service
- -1, // child_id
- -1, // route_id
- std::move(handler));
+ // TODO(davidben): Fix the dependency on child_id/route_id. Those are used
+ // by the ResourceScheduler. currently it's a no-op.
+ handler = AddStandardHandlers(
+ new_request.get(), resource_type, resource_context,
+ info.begin_params.request_context_type,
+ appcache_handle_core ? appcache_handle_core->GetAppCacheService()
+ : nullptr,
+ -1, // child_id
+ -1, // route_id
+ std::move(handler));
BeginRequestInternal(std::move(new_request), std::move(handler));
}
« no previous file with comments | « content/browser/loader/resource_dispatcher_host_impl.h ('k') | content/browser/loader/resource_dispatcher_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698