| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 #include "content/browser/loader/async_resource_handler.h" | 44 #include "content/browser/loader/async_resource_handler.h" |
| 45 #include "content/browser/loader/detachable_resource_handler.h" | 45 #include "content/browser/loader/detachable_resource_handler.h" |
| 46 #include "content/browser/loader/intercepting_resource_handler.h" | 46 #include "content/browser/loader/intercepting_resource_handler.h" |
| 47 #include "content/browser/loader/loader_delegate.h" | 47 #include "content/browser/loader/loader_delegate.h" |
| 48 #include "content/browser/loader/mime_sniffing_resource_handler.h" | 48 #include "content/browser/loader/mime_sniffing_resource_handler.h" |
| 49 #include "content/browser/loader/mojo_async_resource_handler.h" | 49 #include "content/browser/loader/mojo_async_resource_handler.h" |
| 50 #include "content/browser/loader/navigation_resource_handler.h" | 50 #include "content/browser/loader/navigation_resource_handler.h" |
| 51 #include "content/browser/loader/navigation_resource_throttle.h" | 51 #include "content/browser/loader/navigation_resource_throttle.h" |
| 52 #include "content/browser/loader/navigation_url_loader_impl_core.h" | 52 #include "content/browser/loader/navigation_url_loader_impl_core.h" |
| 53 #include "content/browser/loader/null_resource_controller.h" | 53 #include "content/browser/loader/null_resource_controller.h" |
| 54 #include "content/browser/loader/power_save_block_resource_throttle.h" | |
| 55 #include "content/browser/loader/redirect_to_file_resource_handler.h" | 54 #include "content/browser/loader/redirect_to_file_resource_handler.h" |
| 56 #include "content/browser/loader/resource_loader.h" | 55 #include "content/browser/loader/resource_loader.h" |
| 57 #include "content/browser/loader/resource_message_filter.h" | 56 #include "content/browser/loader/resource_message_filter.h" |
| 58 #include "content/browser/loader/resource_request_info_impl.h" | 57 #include "content/browser/loader/resource_request_info_impl.h" |
| 59 #include "content/browser/loader/resource_requester_info.h" | 58 #include "content/browser/loader/resource_requester_info.h" |
| 60 #include "content/browser/loader/resource_scheduler.h" | 59 #include "content/browser/loader/resource_scheduler.h" |
| 61 #include "content/browser/loader/stream_resource_handler.h" | 60 #include "content/browser/loader/stream_resource_handler.h" |
| 62 #include "content/browser/loader/sync_resource_handler.h" | 61 #include "content/browser/loader/sync_resource_handler.h" |
| 63 #include "content/browser/loader/throttling_resource_handler.h" | 62 #include "content/browser/loader/throttling_resource_handler.h" |
| 64 #include "content/browser/loader/upload_data_stream_builder.h" | 63 #include "content/browser/loader/upload_data_stream_builder.h" |
| 64 #include "content/browser/loader/wake_lock_resource_throttle.h" |
| 65 #include "content/browser/resource_context_impl.h" | 65 #include "content/browser/resource_context_impl.h" |
| 66 #include "content/browser/service_worker/foreign_fetch_request_handler.h" | 66 #include "content/browser/service_worker/foreign_fetch_request_handler.h" |
| 67 #include "content/browser/service_worker/link_header_support.h" | 67 #include "content/browser/service_worker/link_header_support.h" |
| 68 #include "content/browser/service_worker/service_worker_context_wrapper.h" | 68 #include "content/browser/service_worker/service_worker_context_wrapper.h" |
| 69 #include "content/browser/service_worker/service_worker_navigation_handle_core.h
" | 69 #include "content/browser/service_worker/service_worker_navigation_handle_core.h
" |
| 70 #include "content/browser/service_worker/service_worker_request_handler.h" | 70 #include "content/browser/service_worker/service_worker_request_handler.h" |
| 71 #include "content/browser/streams/stream.h" | 71 #include "content/browser/streams/stream.h" |
| 72 #include "content/browser/streams/stream_context.h" | 72 #include "content/browser/streams/stream_context.h" |
| 73 #include "content/browser/streams/stream_registry.h" | 73 #include "content/browser/streams/stream_registry.h" |
| 74 #include "content/common/net/url_request_service_worker_data.h" | 74 #include "content/common/net/url_request_service_worker_data.h" |
| (...skipping 1468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1543 | 1543 |
| 1544 if (delegate_) { | 1544 if (delegate_) { |
| 1545 delegate_->RequestBeginning(request, | 1545 delegate_->RequestBeginning(request, |
| 1546 resource_context, | 1546 resource_context, |
| 1547 appcache_service, | 1547 appcache_service, |
| 1548 resource_type, | 1548 resource_type, |
| 1549 &throttles); | 1549 &throttles); |
| 1550 } | 1550 } |
| 1551 | 1551 |
| 1552 if (request->has_upload()) { | 1552 if (request->has_upload()) { |
| 1553 // Block power save while uploading data. | 1553 // Request wake lock while uploading data. |
| 1554 throttles.push_back(base::MakeUnique<PowerSaveBlockResourceThrottle>( | 1554 throttles.push_back( |
| 1555 request->url().host(), main_thread_task_runner_, | 1555 base::MakeUnique<WakeLockResourceThrottle>(request->url().host())); |
| 1556 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE))); | |
| 1557 } | 1556 } |
| 1558 | 1557 |
| 1559 // TODO(ricea): Stop looking this up so much. | 1558 // TODO(ricea): Stop looking this up so much. |
| 1560 ResourceRequestInfoImpl* info = ResourceRequestInfoImpl::ForRequest(request); | 1559 ResourceRequestInfoImpl* info = ResourceRequestInfoImpl::ForRequest(request); |
| 1561 throttles.push_back(scheduler_->ScheduleRequest(child_id, route_id, | 1560 throttles.push_back(scheduler_->ScheduleRequest(child_id, route_id, |
| 1562 info->IsAsync(), request)); | 1561 info->IsAsync(), request)); |
| 1563 | 1562 |
| 1564 // Split the handler in two groups: the ones that need to execute | 1563 // Split the handler in two groups: the ones that need to execute |
| 1565 // WillProcessResponse before mime sniffing and the others. | 1564 // WillProcessResponse before mime sniffing and the others. |
| 1566 std::vector<std::unique_ptr<ResourceThrottle>> pre_mime_sniffing_throttles; | 1565 std::vector<std::unique_ptr<ResourceThrottle>> pre_mime_sniffing_throttles; |
| (...skipping 1104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2671 &throttles); | 2670 &throttles); |
| 2672 if (!throttles.empty()) { | 2671 if (!throttles.empty()) { |
| 2673 handler.reset(new ThrottlingResourceHandler(std::move(handler), request, | 2672 handler.reset(new ThrottlingResourceHandler(std::move(handler), request, |
| 2674 std::move(throttles))); | 2673 std::move(throttles))); |
| 2675 } | 2674 } |
| 2676 } | 2675 } |
| 2677 return handler; | 2676 return handler; |
| 2678 } | 2677 } |
| 2679 | 2678 |
| 2680 } // namespace content | 2679 } // namespace content |
| OLD | NEW |