| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 #include "content/browser/loader/redirect_to_file_resource_handler.h" | 57 #include "content/browser/loader/redirect_to_file_resource_handler.h" |
| 58 #include "content/browser/loader/resource_message_filter.h" | 58 #include "content/browser/loader/resource_message_filter.h" |
| 59 #include "content/browser/loader/resource_request_info_impl.h" | 59 #include "content/browser/loader/resource_request_info_impl.h" |
| 60 #include "content/browser/loader/stream_resource_handler.h" | 60 #include "content/browser/loader/stream_resource_handler.h" |
| 61 #include "content/browser/loader/sync_resource_handler.h" | 61 #include "content/browser/loader/sync_resource_handler.h" |
| 62 #include "content/browser/loader/throttling_resource_handler.h" | 62 #include "content/browser/loader/throttling_resource_handler.h" |
| 63 #include "content/browser/loader/upload_data_stream_builder.h" | 63 #include "content/browser/loader/upload_data_stream_builder.h" |
| 64 #include "content/browser/resource_context_impl.h" | 64 #include "content/browser/resource_context_impl.h" |
| 65 #include "content/browser/service_worker/foreign_fetch_request_handler.h" | 65 #include "content/browser/service_worker/foreign_fetch_request_handler.h" |
| 66 #include "content/browser/service_worker/link_header_support.h" | 66 #include "content/browser/service_worker/link_header_support.h" |
| 67 #include "content/browser/service_worker/service_worker_navigation_handle_core.h
" |
| 67 #include "content/browser/service_worker/service_worker_request_handler.h" | 68 #include "content/browser/service_worker/service_worker_request_handler.h" |
| 68 #include "content/browser/streams/stream.h" | 69 #include "content/browser/streams/stream.h" |
| 69 #include "content/browser/streams/stream_context.h" | 70 #include "content/browser/streams/stream_context.h" |
| 70 #include "content/browser/streams/stream_registry.h" | 71 #include "content/browser/streams/stream_registry.h" |
| 71 #include "content/common/navigation_params.h" | 72 #include "content/common/navigation_params.h" |
| 72 #include "content/common/net/url_request_service_worker_data.h" | 73 #include "content/common/net/url_request_service_worker_data.h" |
| 73 #include "content/common/resource_messages.h" | 74 #include "content/common/resource_messages.h" |
| 74 #include "content/common/resource_request.h" | 75 #include "content/common/resource_request.h" |
| 75 #include "content/common/resource_request_body_impl.h" | 76 #include "content/common/resource_request_body_impl.h" |
| 76 #include "content/common/resource_request_completion_status.h" | 77 #include "content/common/resource_request_completion_status.h" |
| (...skipping 2113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2190 // and clean this up. | 2191 // and clean this up. |
| 2191 std::string(), // original_headers | 2192 std::string(), // original_headers |
| 2192 info.common_params.post_data, | 2193 info.common_params.post_data, |
| 2193 // TODO(mek): Currently initiated_in_secure_context is only used for | 2194 // TODO(mek): Currently initiated_in_secure_context is only used for |
| 2194 // subresource requests, so it doesn't matter what value it gets here. | 2195 // subresource requests, so it doesn't matter what value it gets here. |
| 2195 // If in the future this changes this should be updated to somehow get a | 2196 // If in the future this changes this should be updated to somehow get a |
| 2196 // meaningful value. | 2197 // meaningful value. |
| 2197 false); // initiated_in_secure_context | 2198 false); // initiated_in_secure_context |
| 2198 extra_info->set_navigation_ui_data(std::move(navigation_ui_data)); | 2199 extra_info->set_navigation_ui_data(std::move(navigation_ui_data)); |
| 2199 | 2200 |
| 2201 if (service_worker_handle_core) { |
| 2202 extra_info->set_service_worker_context( |
| 2203 service_worker_handle_core->context_wrapper()); |
| 2204 } |
| 2205 |
| 2200 // Request takes ownership. | 2206 // Request takes ownership. |
| 2201 extra_info->AssociateWithRequest(new_request.get()); | 2207 extra_info->AssociateWithRequest(new_request.get()); |
| 2202 | 2208 |
| 2203 if (new_request->url().SchemeIs(url::kBlobScheme)) { | 2209 if (new_request->url().SchemeIs(url::kBlobScheme)) { |
| 2204 // Hang on to a reference to ensure the blob is not released prior | 2210 // Hang on to a reference to ensure the blob is not released prior |
| 2205 // to the job being started. | 2211 // to the job being started. |
| 2206 storage::BlobProtocolHandler::SetRequestedBlobDataHandle( | 2212 storage::BlobProtocolHandler::SetRequestedBlobDataHandle( |
| 2207 new_request.get(), | 2213 new_request.get(), |
| 2208 blob_context->GetBlobDataFromPublicURL(new_request->url())); | 2214 blob_context->GetBlobDataFromPublicURL(new_request->url())); |
| 2209 } | 2215 } |
| (...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2729 &throttles); | 2735 &throttles); |
| 2730 if (!throttles.empty()) { | 2736 if (!throttles.empty()) { |
| 2731 handler.reset(new ThrottlingResourceHandler(std::move(handler), request, | 2737 handler.reset(new ThrottlingResourceHandler(std::move(handler), request, |
| 2732 std::move(throttles))); | 2738 std::move(throttles))); |
| 2733 } | 2739 } |
| 2734 } | 2740 } |
| 2735 return handler; | 2741 return handler; |
| 2736 } | 2742 } |
| 2737 | 2743 |
| 2738 } // namespace content | 2744 } // namespace content |
| OLD | NEW |