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

Side by Side Diff: content/browser/loader/resource_dispatcher_host_impl.cc

Issue 2501343003: PlzNavigate: AppCache support. (Closed)
Patch Set: Add DCHECKs for PlzNavigate and fix a double Release problem which caused one unit_test to fail wit… Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading 5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading
6 6
7 #include "content/browser/loader/resource_dispatcher_host_impl.h" 7 #include "content/browser/loader/resource_dispatcher_host_impl.h"
8 8
9 #include <stddef.h> 9 #include <stddef.h>
10 10
(...skipping 1553 matching lines...) Expand 10 before | Expand all | Expand 10 after
1564 new_request.get(), filter_->service_worker_context(), blob_context, 1564 new_request.get(), filter_->service_worker_context(), blob_context,
1565 child_id, request_data.service_worker_provider_id, 1565 child_id, request_data.service_worker_provider_id,
1566 should_skip_service_worker, request_data.fetch_request_mode, 1566 should_skip_service_worker, request_data.fetch_request_mode,
1567 request_data.fetch_credentials_mode, request_data.fetch_redirect_mode, 1567 request_data.fetch_credentials_mode, request_data.fetch_redirect_mode,
1568 request_data.resource_type, request_data.fetch_request_context_type, 1568 request_data.resource_type, request_data.fetch_request_context_type,
1569 request_data.fetch_frame_type, request_data.request_body, 1569 request_data.fetch_frame_type, request_data.request_body,
1570 request_data.initiated_in_secure_context); 1570 request_data.initiated_in_secure_context);
1571 1571
1572 // Have the appcache associate its extra info with the request. 1572 // Have the appcache associate its extra info with the request.
1573 AppCacheInterceptor::SetExtraRequestInfo( 1573 AppCacheInterceptor::SetExtraRequestInfo(
1574 new_request.get(), filter_->appcache_service(), child_id, 1574 new_request.get(), filter_->appcache_service(), child_id, -1,
1575 request_data.appcache_host_id, request_data.resource_type, 1575 request_data.appcache_host_id, request_data.resource_type,
1576 request_data.should_reset_appcache); 1576 request_data.should_reset_appcache);
1577 1577
1578 std::unique_ptr<ResourceHandler> handler(CreateResourceHandler( 1578 std::unique_ptr<ResourceHandler> handler(CreateResourceHandler(
1579 new_request.get(), request_data, sync_result_handler, route_id, 1579 new_request.get(), request_data, sync_result_handler, route_id,
1580 process_type, child_id, resource_context, std::move(mojo_request), 1580 process_type, child_id, resource_context, std::move(mojo_request),
1581 std::move(url_loader_client))); 1581 std::move(url_loader_client)));
1582 1582
1583 if (handler) 1583 if (handler)
1584 BeginRequestInternal(std::move(new_request), std::move(handler)); 1584 BeginRequestInternal(std::move(new_request), std::move(handler));
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after
2257 2257
2258 RequestContextFrameType frame_type = 2258 RequestContextFrameType frame_type =
2259 info.is_main_frame ? REQUEST_CONTEXT_FRAME_TYPE_TOP_LEVEL 2259 info.is_main_frame ? REQUEST_CONTEXT_FRAME_TYPE_TOP_LEVEL
2260 : REQUEST_CONTEXT_FRAME_TYPE_NESTED; 2260 : REQUEST_CONTEXT_FRAME_TYPE_NESTED;
2261 ServiceWorkerRequestHandler::InitializeForNavigation( 2261 ServiceWorkerRequestHandler::InitializeForNavigation(
2262 new_request.get(), service_worker_handle_core, blob_context, 2262 new_request.get(), service_worker_handle_core, blob_context,
2263 info.begin_params.skip_service_worker, resource_type, 2263 info.begin_params.skip_service_worker, resource_type,
2264 info.begin_params.request_context_type, frame_type, 2264 info.begin_params.request_context_type, frame_type,
2265 info.are_ancestors_secure, info.common_params.post_data); 2265 info.are_ancestors_secure, info.common_params.post_data);
2266 2266
2267 // TODO(davidben): Attach AppCacheInterceptor. 2267 // Have the appcache associate its extra info with the request.
2268 AppCacheInterceptor::SetExtraRequestInfo(
michaeln 2016/11/22 00:17:27 Can the techique we used for service worker work h
ananta 2016/11/23 04:05:14 Added a new function AppCacheInterceptor::SetExtra
2269 new_request.get(), info.appcache_service, -1, info.frame_tree_node_id,
2270 info.appcache_host_id, resource_type, false);
2268 2271
2269 std::unique_ptr<ResourceHandler> handler( 2272 std::unique_ptr<ResourceHandler> handler(
2270 new NavigationResourceHandler(new_request.get(), loader, delegate())); 2273 new NavigationResourceHandler(new_request.get(), loader, delegate()));
2271 2274
2272 // TODO(davidben): Pass in the appropriate appcache_service. Also fix the 2275 // TODO(davidben): Fix the dependency on child_id/route_id. Those are used
2273 // dependency on child_id/route_id. Those are used by the ResourceScheduler; 2276 // by the ResourceScheduler. currently it's a no-op.
2274 // currently it's a no-op. 2277 handler = AddStandardHandlers(
2275 handler = 2278 new_request.get(), resource_type, resource_context,
2276 AddStandardHandlers(new_request.get(), resource_type, resource_context, 2279 info.begin_params.request_context_type, info.appcache_service,
2277 info.begin_params.request_context_type, 2280 -1, // child_id
2278 nullptr, // appcache_service 2281 -1, // route_id
2279 -1, // child_id 2282 std::move(handler));
2280 -1, // route_id
2281 std::move(handler));
2282 2283
2283 BeginRequestInternal(std::move(new_request), std::move(handler)); 2284 BeginRequestInternal(std::move(new_request), std::move(handler));
2284 } 2285 }
2285 2286
2286 void ResourceDispatcherHostImpl::EnableStaleWhileRevalidateForTesting() { 2287 void ResourceDispatcherHostImpl::EnableStaleWhileRevalidateForTesting() {
2287 if (!async_revalidation_manager_) 2288 if (!async_revalidation_manager_)
2288 async_revalidation_manager_.reset(new AsyncRevalidationManager); 2289 async_revalidation_manager_.reset(new AsyncRevalidationManager);
2289 } 2290 }
2290 2291
2291 void ResourceDispatcherHostImpl::SetLoaderDelegate( 2292 void ResourceDispatcherHostImpl::SetLoaderDelegate(
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
2791 &throttles); 2792 &throttles);
2792 if (!throttles.empty()) { 2793 if (!throttles.empty()) {
2793 handler.reset(new ThrottlingResourceHandler(std::move(handler), request, 2794 handler.reset(new ThrottlingResourceHandler(std::move(handler), request,
2794 std::move(throttles))); 2795 std::move(throttles)));
2795 } 2796 }
2796 } 2797 }
2797 return handler; 2798 return handler;
2798 } 2799 }
2799 2800
2800 } // namespace content 2801 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698