Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1332)

Side by Side Diff: content/browser/loader/resource_dispatcher_host_impl.cc

Issue 2368923003: Support the Clear-Site-Data header on resource requests (Closed)
Patch Set: Rebase. Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 21 matching lines...) Expand all
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/threading/thread_task_runner_handle.h" 35 #include "base/threading/thread_task_runner_handle.h"
36 #include "base/timer/timer.h" 36 #include "base/timer/timer.h"
37 #include "content/browser/appcache/appcache_interceptor.h" 37 #include "content/browser/appcache/appcache_interceptor.h"
38 #include "content/browser/appcache/appcache_navigation_handle_core.h" 38 #include "content/browser/appcache/appcache_navigation_handle_core.h"
39 #include "content/browser/appcache/chrome_appcache_service.h" 39 #include "content/browser/appcache/chrome_appcache_service.h"
40 #include "content/browser/bad_message.h" 40 #include "content/browser/bad_message.h"
41 #include "content/browser/blob_storage/chrome_blob_storage_context.h" 41 #include "content/browser/blob_storage/chrome_blob_storage_context.h"
42 #include "content/browser/browsing_data/clear_site_data_throttle.h"
42 #include "content/browser/child_process_security_policy_impl.h" 43 #include "content/browser/child_process_security_policy_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/loader/async_resource_handler.h" 45 #include "content/browser/loader/async_resource_handler.h"
45 #include "content/browser/loader/detachable_resource_handler.h" 46 #include "content/browser/loader/detachable_resource_handler.h"
46 #include "content/browser/loader/intercepting_resource_handler.h" 47 #include "content/browser/loader/intercepting_resource_handler.h"
47 #include "content/browser/loader/loader_delegate.h" 48 #include "content/browser/loader/loader_delegate.h"
48 #include "content/browser/loader/mime_sniffing_resource_handler.h" 49 #include "content/browser/loader/mime_sniffing_resource_handler.h"
49 #include "content/browser/loader/mojo_async_resource_handler.h" 50 #include "content/browser/loader/mojo_async_resource_handler.h"
50 #include "content/browser/loader/navigation_resource_handler.h" 51 #include "content/browser/loader/navigation_resource_handler.h"
51 #include "content/browser/loader/navigation_resource_throttle.h" 52 #include "content/browser/loader/navigation_resource_throttle.h"
(...skipping 1496 matching lines...) Expand 10 before | Expand all | Expand 10 after
1548 resource_type, 1549 resource_type,
1549 &throttles); 1550 &throttles);
1550 } 1551 }
1551 1552
1552 if (request->has_upload()) { 1553 if (request->has_upload()) {
1553 // Request wake lock while uploading data. 1554 // Request wake lock while uploading data.
1554 throttles.push_back( 1555 throttles.push_back(
1555 base::MakeUnique<WakeLockResourceThrottle>(request->url().host())); 1556 base::MakeUnique<WakeLockResourceThrottle>(request->url().host()));
1556 } 1557 }
1557 1558
1559 // The experimental Clear-Site-Data throttle.
1560 std::unique_ptr<ResourceThrottle> clear_site_data_throttle =
1561 ClearSiteDataThrottle::MaybeCreateThrottleForRequest(request);
1562 if (clear_site_data_throttle)
1563 throttles.push_back(std::move(clear_site_data_throttle));
1564
1558 // TODO(ricea): Stop looking this up so much. 1565 // TODO(ricea): Stop looking this up so much.
1559 ResourceRequestInfoImpl* info = ResourceRequestInfoImpl::ForRequest(request); 1566 ResourceRequestInfoImpl* info = ResourceRequestInfoImpl::ForRequest(request);
1560 throttles.push_back(scheduler_->ScheduleRequest(child_id, route_id, 1567 throttles.push_back(scheduler_->ScheduleRequest(child_id, route_id,
1561 info->IsAsync(), request)); 1568 info->IsAsync(), request));
1562 1569
1563 // Split the handler in two groups: the ones that need to execute 1570 // Split the handler in two groups: the ones that need to execute
1564 // WillProcessResponse before mime sniffing and the others. 1571 // WillProcessResponse before mime sniffing and the others.
1565 std::vector<std::unique_ptr<ResourceThrottle>> pre_mime_sniffing_throttles; 1572 std::vector<std::unique_ptr<ResourceThrottle>> pre_mime_sniffing_throttles;
1566 std::vector<std::unique_ptr<ResourceThrottle>> post_mime_sniffing_throttles; 1573 std::vector<std::unique_ptr<ResourceThrottle>> post_mime_sniffing_throttles;
1567 for (auto& throttle : throttles) { 1574 for (auto& throttle : throttles) {
(...skipping 1102 matching lines...) Expand 10 before | Expand all | Expand 10 after
2670 &throttles); 2677 &throttles);
2671 if (!throttles.empty()) { 2678 if (!throttles.empty()) {
2672 handler.reset(new ThrottlingResourceHandler(std::move(handler), request, 2679 handler.reset(new ThrottlingResourceHandler(std::move(handler), request,
2673 std::move(throttles))); 2680 std::move(throttles)));
2674 } 2681 }
2675 } 2682 }
2676 return handler; 2683 return handler;
2677 } 2684 }
2678 2685
2679 } // namespace content 2686 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698