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 <algorithm> | 9 #include <algorithm> |
10 #include <set> | 10 #include <set> |
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
532 VLOG(1) << "Download request for unsupported protocol: " | 532 VLOG(1) << "Download request for unsupported protocol: " |
533 << url.possibly_invalid_spec(); | 533 << url.possibly_invalid_spec(); |
534 return CallbackAndReturn(started_callback, | 534 return CallbackAndReturn(started_callback, |
535 DOWNLOAD_INTERRUPT_REASON_NETWORK_INVALID_REQUEST); | 535 DOWNLOAD_INTERRUPT_REASON_NETWORK_INVALID_REQUEST); |
536 } | 536 } |
537 | 537 |
538 ResourceRequestInfoImpl* extra_info = | 538 ResourceRequestInfoImpl* extra_info = |
539 CreateRequestInfo(child_id, route_id, true, context); | 539 CreateRequestInfo(child_id, route_id, true, context); |
540 extra_info->AssociateWithRequest(request.get()); // Request takes ownership. | 540 extra_info->AssociateWithRequest(request.get()); // Request takes ownership. |
541 | 541 |
542 if (request->url().SchemeIs(kBlobScheme)) { | 542 if (request->url().SchemeIs(url::kBlobScheme)) { |
543 ChromeBlobStorageContext* blob_context = | 543 ChromeBlobStorageContext* blob_context = |
544 GetChromeBlobStorageContextForResourceContext(context); | 544 GetChromeBlobStorageContextForResourceContext(context); |
545 webkit_blob::BlobProtocolHandler::SetRequestedBlobDataHandle( | 545 webkit_blob::BlobProtocolHandler::SetRequestedBlobDataHandle( |
546 request.get(), | 546 request.get(), |
547 blob_context->context()->GetBlobDataFromPublicURL(request->url())); | 547 blob_context->context()->GetBlobDataFromPublicURL(request->url())); |
548 } | 548 } |
549 | 549 |
550 // From this point forward, the |DownloadResourceHandler| is responsible for | 550 // From this point forward, the |DownloadResourceHandler| is responsible for |
551 // |started_callback|. | 551 // |started_callback|. |
552 scoped_ptr<ResourceHandler> handler( | 552 scoped_ptr<ResourceHandler> handler( |
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1119 allow_download, | 1119 allow_download, |
1120 request_data.has_user_gesture, | 1120 request_data.has_user_gesture, |
1121 request_data.referrer_policy, | 1121 request_data.referrer_policy, |
1122 request_data.visiblity_state, | 1122 request_data.visiblity_state, |
1123 resource_context, | 1123 resource_context, |
1124 filter_->GetWeakPtr(), | 1124 filter_->GetWeakPtr(), |
1125 !is_sync_load); | 1125 !is_sync_load); |
1126 // Request takes ownership. | 1126 // Request takes ownership. |
1127 extra_info->AssociateWithRequest(new_request.get()); | 1127 extra_info->AssociateWithRequest(new_request.get()); |
1128 | 1128 |
1129 if (new_request->url().SchemeIs(kBlobScheme)) { | 1129 if (new_request->url().SchemeIs(url::kBlobScheme)) { |
1130 // Hang on to a reference to ensure the blob is not released prior | 1130 // Hang on to a reference to ensure the blob is not released prior |
1131 // to the job being started. | 1131 // to the job being started. |
1132 webkit_blob::BlobProtocolHandler::SetRequestedBlobDataHandle( | 1132 webkit_blob::BlobProtocolHandler::SetRequestedBlobDataHandle( |
1133 new_request.get(), | 1133 new_request.get(), |
1134 filter_->blob_storage_context()->context()-> | 1134 filter_->blob_storage_context()->context()-> |
1135 GetBlobDataFromPublicURL(new_request->url())); | 1135 GetBlobDataFromPublicURL(new_request->url())); |
1136 } | 1136 } |
1137 | 1137 |
1138 // Initialize the service worker handler for the request. | 1138 // Initialize the service worker handler for the request. |
1139 ServiceWorkerRequestHandler::InitializeHandler( | 1139 ServiceWorkerRequestHandler::InitializeHandler( |
(...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2034 if ((load_flags & net::LOAD_REPORT_RAW_HEADERS) | 2034 if ((load_flags & net::LOAD_REPORT_RAW_HEADERS) |
2035 && !policy->CanReadRawCookies(child_id)) { | 2035 && !policy->CanReadRawCookies(child_id)) { |
2036 VLOG(1) << "Denied unauthorized request for raw headers"; | 2036 VLOG(1) << "Denied unauthorized request for raw headers"; |
2037 load_flags &= ~net::LOAD_REPORT_RAW_HEADERS; | 2037 load_flags &= ~net::LOAD_REPORT_RAW_HEADERS; |
2038 } | 2038 } |
2039 | 2039 |
2040 return load_flags; | 2040 return load_flags; |
2041 } | 2041 } |
2042 | 2042 |
2043 } // namespace content | 2043 } // namespace content |
OLD | NEW |