OLD | NEW |
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 1521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1532 // Hang on to a reference to ensure the blob is not released prior | 1532 // Hang on to a reference to ensure the blob is not released prior |
1533 // to the job being started. | 1533 // to the job being started. |
1534 storage::BlobProtocolHandler::SetRequestedBlobDataHandle( | 1534 storage::BlobProtocolHandler::SetRequestedBlobDataHandle( |
1535 new_request.get(), requester_info->blob_storage_context() | 1535 new_request.get(), requester_info->blob_storage_context() |
1536 ->context() | 1536 ->context() |
1537 ->GetBlobDataFromPublicURL(new_request->url())); | 1537 ->GetBlobDataFromPublicURL(new_request->url())); |
1538 } | 1538 } |
1539 | 1539 |
1540 // Initialize the service worker handler for the request. We don't use | 1540 // Initialize the service worker handler for the request. We don't use |
1541 // ServiceWorker for synchronous loads to avoid renderer deadlocks. | 1541 // ServiceWorker for synchronous loads to avoid renderer deadlocks. |
1542 const SkipServiceWorker should_skip_service_worker = | 1542 const ServiceWorkerMode service_worker_mode = |
1543 is_sync_load ? SkipServiceWorker::ALL : request_data.skip_service_worker; | 1543 is_sync_load ? ServiceWorkerMode::NONE : request_data.service_worker_mode; |
1544 ServiceWorkerRequestHandler::InitializeHandler( | 1544 ServiceWorkerRequestHandler::InitializeHandler( |
1545 new_request.get(), requester_info->service_worker_context(), blob_context, | 1545 new_request.get(), requester_info->service_worker_context(), blob_context, |
1546 child_id, request_data.service_worker_provider_id, | 1546 child_id, request_data.service_worker_provider_id, |
1547 should_skip_service_worker != SkipServiceWorker::NONE, | 1547 service_worker_mode != ServiceWorkerMode::ALL, |
1548 request_data.fetch_request_mode, request_data.fetch_credentials_mode, | 1548 request_data.fetch_request_mode, request_data.fetch_credentials_mode, |
1549 request_data.fetch_redirect_mode, request_data.resource_type, | 1549 request_data.fetch_redirect_mode, request_data.resource_type, |
1550 request_data.fetch_request_context_type, request_data.fetch_frame_type, | 1550 request_data.fetch_request_context_type, request_data.fetch_frame_type, |
1551 request_data.request_body); | 1551 request_data.request_body); |
1552 | 1552 |
1553 ForeignFetchRequestHandler::InitializeHandler( | 1553 ForeignFetchRequestHandler::InitializeHandler( |
1554 new_request.get(), requester_info->service_worker_context(), blob_context, | 1554 new_request.get(), requester_info->service_worker_context(), blob_context, |
1555 child_id, request_data.service_worker_provider_id, | 1555 child_id, request_data.service_worker_provider_id, service_worker_mode, |
1556 should_skip_service_worker, request_data.fetch_request_mode, | 1556 request_data.fetch_request_mode, request_data.fetch_credentials_mode, |
1557 request_data.fetch_credentials_mode, request_data.fetch_redirect_mode, | 1557 request_data.fetch_redirect_mode, request_data.resource_type, |
1558 request_data.resource_type, request_data.fetch_request_context_type, | 1558 request_data.fetch_request_context_type, request_data.fetch_frame_type, |
1559 request_data.fetch_frame_type, request_data.request_body, | 1559 request_data.request_body, request_data.initiated_in_secure_context); |
1560 request_data.initiated_in_secure_context); | |
1561 | 1560 |
1562 // Have the appcache associate its extra info with the request. | 1561 // Have the appcache associate its extra info with the request. |
1563 AppCacheInterceptor::SetExtraRequestInfo( | 1562 AppCacheInterceptor::SetExtraRequestInfo( |
1564 new_request.get(), requester_info->appcache_service(), child_id, | 1563 new_request.get(), requester_info->appcache_service(), child_id, |
1565 request_data.appcache_host_id, request_data.resource_type, | 1564 request_data.appcache_host_id, request_data.resource_type, |
1566 request_data.should_reset_appcache); | 1565 request_data.should_reset_appcache); |
1567 | 1566 |
1568 std::unique_ptr<ResourceHandler> handler(CreateResourceHandler( | 1567 std::unique_ptr<ResourceHandler> handler(CreateResourceHandler( |
1569 requester_info.get(), new_request.get(), request_data, | 1568 requester_info.get(), new_request.get(), request_data, |
1570 sync_result_handler, route_id, child_id, resource_context, | 1569 sync_result_handler, route_id, child_id, resource_context, |
(...skipping 1225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2796 &throttles); | 2795 &throttles); |
2797 if (!throttles.empty()) { | 2796 if (!throttles.empty()) { |
2798 handler.reset(new ThrottlingResourceHandler(std::move(handler), request, | 2797 handler.reset(new ThrottlingResourceHandler(std::move(handler), request, |
2799 std::move(throttles))); | 2798 std::move(throttles))); |
2800 } | 2799 } |
2801 } | 2800 } |
2802 return handler; | 2801 return handler; |
2803 } | 2802 } |
2804 | 2803 |
2805 } // namespace content | 2804 } // namespace content |
OLD | NEW |