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

Side by Side Diff: chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc

Issue 2776493005: Convert SupervisedUserResourceThrottle to a NavigationThrottle. (Closed)
Patch Set: Response to comments Created 3 years, 8 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 #include "chrome/browser/loader/chrome_resource_dispatcher_host_delegate.h" 5 #include "chrome/browser/loader/chrome_resource_dispatcher_host_delegate.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 #include "chrome/browser/renderer_host/chrome_navigation_ui_data.h" 90 #include "chrome/browser/renderer_host/chrome_navigation_ui_data.h"
91 #include "extensions/browser/extension_throttle_manager.h" 91 #include "extensions/browser/extension_throttle_manager.h"
92 #include "extensions/browser/guest_view/web_view/web_view_renderer_state.h" 92 #include "extensions/browser/guest_view/web_view/web_view_renderer_state.h"
93 #include "extensions/browser/info_map.h" 93 #include "extensions/browser/info_map.h"
94 #include "extensions/common/constants.h" 94 #include "extensions/common/constants.h"
95 #include "extensions/common/extension_urls.h" 95 #include "extensions/common/extension_urls.h"
96 #include "extensions/common/manifest_handlers/mime_types_handler.h" 96 #include "extensions/common/manifest_handlers/mime_types_handler.h"
97 #include "extensions/common/user_script.h" 97 #include "extensions/common/user_script.h"
98 #endif 98 #endif
99 99
100 #if BUILDFLAG(ENABLE_SUPERVISED_USERS)
101 #include "chrome/browser/supervised_user/supervised_user_resource_throttle.h"
102 #endif
103
104 #if defined(USE_SYSTEM_PROTOBUF) 100 #if defined(USE_SYSTEM_PROTOBUF)
105 #include <google/protobuf/repeated_field.h> 101 #include <google/protobuf/repeated_field.h>
106 #else 102 #else
107 #include "third_party/protobuf/src/google/protobuf/repeated_field.h" 103 #include "third_party/protobuf/src/google/protobuf/repeated_field.h"
108 #endif 104 #endif
109 105
110 #if defined(OS_ANDROID) 106 #if defined(OS_ANDROID)
111 #include "chrome/browser/android/download/intercept_download_resource_throttle.h " 107 #include "chrome/browser/android/download/intercept_download_resource_throttle.h "
112 #include "chrome/browser/android/offline_pages/background_loader_offliner.h" 108 #include "chrome/browser/android/offline_pages/background_loader_offliner.h"
113 #include "chrome/browser/android/offline_pages/downloads/resource_throttle.h" 109 #include "chrome/browser/android/offline_pages/downloads/resource_throttle.h"
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after
653 #if defined(SAFE_BROWSING_DB_LOCAL) || defined(SAFE_BROWSING_DB_REMOTE) 649 #if defined(SAFE_BROWSING_DB_LOCAL) || defined(SAFE_BROWSING_DB_REMOTE)
654 if (!first_throttle && io_data->safe_browsing_enabled()->GetValue()) { 650 if (!first_throttle && io_data->safe_browsing_enabled()->GetValue()) {
655 first_throttle = SafeBrowsingResourceThrottle::MaybeCreate( 651 first_throttle = SafeBrowsingResourceThrottle::MaybeCreate(
656 request, resource_type, safe_browsing_.get()); 652 request, resource_type, safe_browsing_.get());
657 } 653 }
658 #endif // defined(SAFE_BROWSING_DB_LOCAL) || defined(SAFE_BROWSING_DB_REMOTE) 654 #endif // defined(SAFE_BROWSING_DB_LOCAL) || defined(SAFE_BROWSING_DB_REMOTE)
659 655
660 if (first_throttle) 656 if (first_throttle)
661 throttles->push_back(base::WrapUnique(first_throttle)); 657 throttles->push_back(base::WrapUnique(first_throttle));
662 658
663 #if BUILDFLAG(ENABLE_SUPERVISED_USERS)
664 std::unique_ptr<content::ResourceThrottle> supervised_user_throttle =
665 SupervisedUserResourceThrottle::MaybeCreate(
666 request, resource_type, io_data->supervised_user_url_filter());
667 if (supervised_user_throttle)
668 throttles->push_back(std::move(supervised_user_throttle));
669 #endif
670
671 #if BUILDFLAG(ENABLE_EXTENSIONS) 659 #if BUILDFLAG(ENABLE_EXTENSIONS)
672 content::ResourceThrottle* wait_for_extensions_init_throttle = 660 content::ResourceThrottle* wait_for_extensions_init_throttle =
673 user_script_listener_->CreateResourceThrottle(request->url(), 661 user_script_listener_->CreateResourceThrottle(request->url(),
674 resource_type); 662 resource_type);
675 if (wait_for_extensions_init_throttle) 663 if (wait_for_extensions_init_throttle)
676 throttles->push_back(base::WrapUnique(wait_for_extensions_init_throttle)); 664 throttles->push_back(base::WrapUnique(wait_for_extensions_init_throttle));
677 665
678 extensions::ExtensionThrottleManager* extension_throttle_manager = 666 extensions::ExtensionThrottleManager* extension_throttle_manager =
679 io_data->GetExtensionThrottleManager(); 667 io_data->GetExtensionThrottleManager();
680 if (extension_throttle_manager) { 668 if (extension_throttle_manager) {
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
950 base::Bind(&ChromeResourceDispatcherHostDelegate::OnAbortedFrameLoad, 938 base::Bind(&ChromeResourceDispatcherHostDelegate::OnAbortedFrameLoad,
951 base::Unretained(this), url, request_loading_time)); 939 base::Unretained(this), url, request_loading_time));
952 return; 940 return;
953 } 941 }
954 942
955 std::string metric_name = (request_loading_time.InMilliseconds() < 100 ? 943 std::string metric_name = (request_loading_time.InMilliseconds() < 100 ?
956 "Net.ErrAborted.Fast" : "Net.ErrAborted.Slow"); 944 "Net.ErrAborted.Fast" : "Net.ErrAborted.Slow");
957 rappor::SampleDomainAndRegistryFromGURL( 945 rappor::SampleDomainAndRegistryFromGURL(
958 g_browser_process->rappor_service(), metric_name, url); 946 g_browser_process->rappor_service(), metric_name, url);
959 } 947 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698