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 19 matching lines...) Expand all Loading... |
30 #include "base/metrics/sparse_histogram.h" | 30 #include "base/metrics/sparse_histogram.h" |
31 #include "base/profiler/scoped_tracker.h" | 31 #include "base/profiler/scoped_tracker.h" |
32 #include "base/stl_util.h" | 32 #include "base/stl_util.h" |
33 #include "base/strings/string_util.h" | 33 #include "base/strings/string_util.h" |
34 #include "base/third_party/dynamic_annotations/dynamic_annotations.h" | 34 #include "base/third_party/dynamic_annotations/dynamic_annotations.h" |
35 #include "base/time/time.h" | 35 #include "base/time/time.h" |
36 #include "content/browser/appcache/appcache_interceptor.h" | 36 #include "content/browser/appcache/appcache_interceptor.h" |
37 #include "content/browser/appcache/chrome_appcache_service.h" | 37 #include "content/browser/appcache/chrome_appcache_service.h" |
38 #include "content/browser/bad_message.h" | 38 #include "content/browser/bad_message.h" |
39 #include "content/browser/blob_storage/chrome_blob_storage_context.h" | 39 #include "content/browser/blob_storage/chrome_blob_storage_context.h" |
| 40 #include "content/browser/browsing_data/clear_site_data_throttle.h" |
40 #include "content/browser/child_process_security_policy_impl.h" | 41 #include "content/browser/child_process_security_policy_impl.h" |
41 #include "content/browser/frame_host/frame_tree.h" | 42 #include "content/browser/frame_host/frame_tree.h" |
42 #include "content/browser/frame_host/navigation_handle_impl.h" | 43 #include "content/browser/frame_host/navigation_handle_impl.h" |
43 #include "content/browser/frame_host/navigation_request_info.h" | 44 #include "content/browser/frame_host/navigation_request_info.h" |
44 #include "content/browser/frame_host/navigator.h" | 45 #include "content/browser/frame_host/navigator.h" |
45 #include "content/browser/loader/async_resource_handler.h" | 46 #include "content/browser/loader/async_resource_handler.h" |
46 #include "content/browser/loader/async_revalidation_manager.h" | 47 #include "content/browser/loader/async_revalidation_manager.h" |
47 #include "content/browser/loader/detachable_resource_handler.h" | 48 #include "content/browser/loader/detachable_resource_handler.h" |
48 #include "content/browser/loader/intercepting_resource_handler.h" | 49 #include "content/browser/loader/intercepting_resource_handler.h" |
49 #include "content/browser/loader/loader_delegate.h" | 50 #include "content/browser/loader/loader_delegate.h" |
(...skipping 1607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1657 } | 1658 } |
1658 | 1659 |
1659 if (request->has_upload()) { | 1660 if (request->has_upload()) { |
1660 // Block power save while uploading data. | 1661 // Block power save while uploading data. |
1661 throttles.push_back(new PowerSaveBlockResourceThrottle( | 1662 throttles.push_back(new PowerSaveBlockResourceThrottle( |
1662 request->url().host(), | 1663 request->url().host(), |
1663 BrowserThread::GetTaskRunnerForThread(BrowserThread::UI), | 1664 BrowserThread::GetTaskRunnerForThread(BrowserThread::UI), |
1664 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE))); | 1665 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE))); |
1665 } | 1666 } |
1666 | 1667 |
| 1668 // The experimental Clear-Site-Data throttle. |
| 1669 std::unique_ptr<ResourceThrottle> clear_site_data_throttle = |
| 1670 ClearSiteDataThrottle::CreateThrottleForRequest(request); |
| 1671 if (clear_site_data_throttle) |
| 1672 throttles.push_back(clear_site_data_throttle.release()); |
| 1673 |
1667 // TODO(ricea): Stop looking this up so much. | 1674 // TODO(ricea): Stop looking this up so much. |
1668 ResourceRequestInfoImpl* info = ResourceRequestInfoImpl::ForRequest(request); | 1675 ResourceRequestInfoImpl* info = ResourceRequestInfoImpl::ForRequest(request); |
1669 throttles.push_back(scheduler_->ScheduleRequest(child_id, route_id, | 1676 throttles.push_back(scheduler_->ScheduleRequest(child_id, route_id, |
1670 info->IsAsync(), request)); | 1677 info->IsAsync(), request)); |
1671 | 1678 |
1672 // Split the handler in two groups: the ones that need to execute | 1679 // Split the handler in two groups: the ones that need to execute |
1673 // WillProcessResponse before mime sniffing and the others. | 1680 // WillProcessResponse before mime sniffing and the others. |
1674 // TODO(clamy): ScopedVector is deprecated. The interface should be changed | 1681 // TODO(clamy): ScopedVector is deprecated. The interface should be changed |
1675 // to use vectors instead. | 1682 // to use vectors instead. |
1676 ScopedVector<ResourceThrottle> pre_mime_sniffing_throttles; | 1683 ScopedVector<ResourceThrottle> pre_mime_sniffing_throttles; |
(...skipping 1058 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2735 &throttles); | 2742 &throttles); |
2736 if (!throttles.empty()) { | 2743 if (!throttles.empty()) { |
2737 handler.reset(new ThrottlingResourceHandler(std::move(handler), request, | 2744 handler.reset(new ThrottlingResourceHandler(std::move(handler), request, |
2738 std::move(throttles))); | 2745 std::move(throttles))); |
2739 } | 2746 } |
2740 } | 2747 } |
2741 return handler; | 2748 return handler; |
2742 } | 2749 } |
2743 | 2750 |
2744 } // namespace content | 2751 } // namespace content |
OLD | NEW |