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

Side by Side Diff: chrome/browser/profiles/profile_io_data.cc

Issue 2887133003: predictors: Refactor resource_prefetch_predictor triggering. (Closed)
Patch Set: . 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
« no previous file with comments | « chrome/browser/profiles/profile_io_data.h ('k') | chrome/test/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/profiles/profile_io_data.h" 5 #include "chrome/browser/profiles/profile_io_data.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 20 matching lines...) Expand all
31 #include "chrome/browser/content_settings/cookie_settings_factory.h" 31 #include "chrome/browser/content_settings/cookie_settings_factory.h"
32 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" 32 #include "chrome/browser/content_settings/host_content_settings_map_factory.h"
33 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" 33 #include "chrome/browser/custom_handlers/protocol_handler_registry.h"
34 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" 34 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h"
35 #include "chrome/browser/devtools/devtools_network_controller.h" 35 #include "chrome/browser/devtools/devtools_network_controller.h"
36 #include "chrome/browser/devtools/devtools_network_transaction_factory.h" 36 #include "chrome/browser/devtools/devtools_network_transaction_factory.h"
37 #include "chrome/browser/io_thread.h" 37 #include "chrome/browser/io_thread.h"
38 #include "chrome/browser/net/chrome_http_user_agent_settings.h" 38 #include "chrome/browser/net/chrome_http_user_agent_settings.h"
39 #include "chrome/browser/net/chrome_network_delegate.h" 39 #include "chrome/browser/net/chrome_network_delegate.h"
40 #include "chrome/browser/net/chrome_url_request_context_getter.h" 40 #include "chrome/browser/net/chrome_url_request_context_getter.h"
41 #include "chrome/browser/net/loading_predictor_observer.h"
41 #include "chrome/browser/net/proxy_service_factory.h" 42 #include "chrome/browser/net/proxy_service_factory.h"
42 #include "chrome/browser/net/resource_prefetch_predictor_observer.h"
43 #include "chrome/browser/policy/cloud/policy_header_service_factory.h" 43 #include "chrome/browser/policy/cloud/policy_header_service_factory.h"
44 #include "chrome/browser/policy/policy_helpers.h" 44 #include "chrome/browser/policy/policy_helpers.h"
45 #include "chrome/browser/predictors/loading_predictor.h" 45 #include "chrome/browser/predictors/loading_predictor.h"
46 #include "chrome/browser/predictors/loading_predictor_factory.h" 46 #include "chrome/browser/predictors/loading_predictor_factory.h"
47 #include "chrome/browser/profiles/net_http_session_params_observer.h" 47 #include "chrome/browser/profiles/net_http_session_params_observer.h"
48 #include "chrome/browser/profiles/profile.h" 48 #include "chrome/browser/profiles/profile.h"
49 #include "chrome/browser/profiles/profile_manager.h" 49 #include "chrome/browser/profiles/profile_manager.h"
50 #include "chrome/browser/ssl/chrome_expect_ct_reporter.h" 50 #include "chrome/browser/ssl/chrome_expect_ct_reporter.h"
51 #include "chrome/browser/ui/search/new_tab_page_interceptor_service.h" 51 #include "chrome/browser/ui/search/new_tab_page_interceptor_service.h"
52 #include "chrome/browser/ui/search/new_tab_page_interceptor_service_factory.h" 52 #include "chrome/browser/ui/search/new_tab_page_interceptor_service_factory.h"
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 params->ssl_config_service = profile->GetSSLConfigService(); 384 params->ssl_config_service = profile->GetSSLConfigService();
385 385
386 #if BUILDFLAG(ENABLE_EXTENSIONS) 386 #if BUILDFLAG(ENABLE_EXTENSIONS)
387 params->extension_info_map = 387 params->extension_info_map =
388 extensions::ExtensionSystem::Get(profile)->info_map(); 388 extensions::ExtensionSystem::Get(profile)->info_map();
389 params->cookie_monster_delegate = new ExtensionCookieMonsterDelegate(profile); 389 params->cookie_monster_delegate = new ExtensionCookieMonsterDelegate(profile);
390 #endif 390 #endif
391 391
392 if (auto* loading_predictor = 392 if (auto* loading_predictor =
393 predictors::LoadingPredictorFactory::GetForProfile(profile)) { 393 predictors::LoadingPredictorFactory::GetForProfile(profile)) {
394 resource_prefetch_predictor_observer_.reset( 394 loading_predictor_observer_ =
395 new chrome_browser_net::ResourcePrefetchPredictorObserver( 395 base::MakeUnique<chrome_browser_net::LoadingPredictorObserver>(
396 loading_predictor->resource_prefetch_predictor())); 396 loading_predictor);
397 } 397 }
398 398
399 ProtocolHandlerRegistry* protocol_handler_registry = 399 ProtocolHandlerRegistry* protocol_handler_registry =
400 ProtocolHandlerRegistryFactory::GetForBrowserContext(profile); 400 ProtocolHandlerRegistryFactory::GetForBrowserContext(profile);
401 DCHECK(protocol_handler_registry); 401 DCHECK(protocol_handler_registry);
402 402
403 // The profile instance is only available here in the InitializeOnUIThread 403 // The profile instance is only available here in the InitializeOnUIThread
404 // method, so we create the url job factory here, then save it for 404 // method, so we create the url job factory here, then save it for
405 // later delivery to the job factory in Init(). 405 // later delivery to the job factory in Init().
406 params->protocol_handler_interceptor = 406 params->protocol_handler_interceptor =
(...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after
1093 // Take ownership over these parameters. 1093 // Take ownership over these parameters.
1094 cookie_settings_ = profile_params_->cookie_settings; 1094 cookie_settings_ = profile_params_->cookie_settings;
1095 host_content_settings_map_ = profile_params_->host_content_settings_map; 1095 host_content_settings_map_ = profile_params_->host_content_settings_map;
1096 #if BUILDFLAG(ENABLE_EXTENSIONS) 1096 #if BUILDFLAG(ENABLE_EXTENSIONS)
1097 extension_info_map_ = profile_params_->extension_info_map; 1097 extension_info_map_ = profile_params_->extension_info_map;
1098 #endif 1098 #endif
1099 1099
1100 resource_context_->host_resolver_ = io_thread_globals->host_resolver.get(); 1100 resource_context_->host_resolver_ = io_thread_globals->host_resolver.get();
1101 resource_context_->request_context_ = main_request_context_.get(); 1101 resource_context_->request_context_ = main_request_context_.get();
1102 1102
1103 if (profile_params_->resource_prefetch_predictor_observer_) { 1103 if (profile_params_->loading_predictor_observer_) {
1104 resource_prefetch_predictor_observer_.reset( 1104 loading_predictor_observer_ =
1105 profile_params_->resource_prefetch_predictor_observer_.release()); 1105 std::move(profile_params_->loading_predictor_observer_);
1106 } 1106 }
1107 1107
1108 #if defined(OS_CHROMEOS) 1108 #if defined(OS_CHROMEOS)
1109 username_hash_ = profile_params_->username_hash; 1109 username_hash_ = profile_params_->username_hash;
1110 use_system_key_slot_ = profile_params_->use_system_key_slot; 1110 use_system_key_slot_ = profile_params_->use_system_key_slot;
1111 if (use_system_key_slot_) 1111 if (use_system_key_slot_)
1112 EnableNSSSystemKeySlotForResourceContext(resource_context_.get()); 1112 EnableNSSSystemKeySlotForResourceContext(resource_context_.get());
1113 1113
1114 certificate_provider_ = std::move(profile_params_->certificate_provider); 1114 certificate_provider_ = std::move(profile_params_->certificate_provider);
1115 #endif 1115 #endif
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
1354 void ProfileIOData::SetCookieSettingsForTesting( 1354 void ProfileIOData::SetCookieSettingsForTesting(
1355 content_settings::CookieSettings* cookie_settings) { 1355 content_settings::CookieSettings* cookie_settings) {
1356 DCHECK(!cookie_settings_.get()); 1356 DCHECK(!cookie_settings_.get());
1357 cookie_settings_ = cookie_settings; 1357 cookie_settings_ = cookie_settings;
1358 } 1358 }
1359 1359
1360 policy::URLBlacklist::URLBlacklistState ProfileIOData::GetURLBlacklistState( 1360 policy::URLBlacklist::URLBlacklistState ProfileIOData::GetURLBlacklistState(
1361 const GURL& url) const { 1361 const GURL& url) const {
1362 return url_blacklist_manager_->GetURLBlacklistState(url); 1362 return url_blacklist_manager_->GetURLBlacklistState(url);
1363 } 1363 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_io_data.h ('k') | chrome/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698