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

Side by Side Diff: chrome/browser/browser_process_impl.cc

Issue 2731283009: Swap ownership of RulesetService and the content delegate (Closed)
Patch Set: engedy review Created 3 years, 9 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/browser_process_impl.h" 5 #include "chrome/browser/browser_process_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <map> 10 #include <map>
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 #include "components/physical_web/data_source/physical_web_data_source.h" 97 #include "components/physical_web/data_source/physical_web_data_source.h"
98 #include "components/policy/core/browser/browser_policy_connector.h" 98 #include "components/policy/core/browser/browser_policy_connector.h"
99 #include "components/policy/core/common/policy_service.h" 99 #include "components/policy/core/common/policy_service.h"
100 #include "components/prefs/json_pref_store.h" 100 #include "components/prefs/json_pref_store.h"
101 #include "components/prefs/pref_registry_simple.h" 101 #include "components/prefs/pref_registry_simple.h"
102 #include "components/prefs/pref_service.h" 102 #include "components/prefs/pref_service.h"
103 #include "components/rappor/public/rappor_utils.h" 103 #include "components/rappor/public/rappor_utils.h"
104 #include "components/rappor/rappor_service_impl.h" 104 #include "components/rappor/rappor_service_impl.h"
105 #include "components/safe_json/safe_json_parser.h" 105 #include "components/safe_json/safe_json_parser.h"
106 #include "components/signin/core/common/profile_management_switches.h" 106 #include "components/signin/core/common/profile_management_switches.h"
107 #include "components/subresource_filter/content/browser/content_ruleset_service_ delegate.h" 107 #include "components/subresource_filter/content/browser/content_ruleset_service. h"
108 #include "components/subresource_filter/core/browser/ruleset_service.h" 108 #include "components/subresource_filter/core/browser/ruleset_service.h"
109 #include "components/subresource_filter/core/browser/subresource_filter_constant s.h" 109 #include "components/subresource_filter/core/browser/subresource_filter_constant s.h"
110 #include "components/subresource_filter/core/browser/subresource_filter_features .h" 110 #include "components/subresource_filter/core/browser/subresource_filter_features .h"
111 #include "components/translate/core/browser/translate_download_manager.h" 111 #include "components/translate/core/browser/translate_download_manager.h"
112 #include "components/update_client/update_query_params.h" 112 #include "components/update_client/update_query_params.h"
113 #include "components/web_resource/web_resource_pref_names.h" 113 #include "components/web_resource/web_resource_pref_names.h"
114 #include "content/public/browser/browser_thread.h" 114 #include "content/public/browser/browser_thread.h"
115 #include "content/public/browser/child_process_security_policy.h" 115 #include "content/public/browser/child_process_security_policy.h"
116 #include "content/public/browser/notification_details.h" 116 #include "content/public/browser/notification_details.h"
117 #include "content/public/browser/plugin_service.h" 117 #include "content/public/browser/plugin_service.h"
(...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after
896 } 896 }
897 897
898 safe_browsing::ClientSideDetectionService* 898 safe_browsing::ClientSideDetectionService*
899 BrowserProcessImpl::safe_browsing_detection_service() { 899 BrowserProcessImpl::safe_browsing_detection_service() {
900 DCHECK(CalledOnValidThread()); 900 DCHECK(CalledOnValidThread());
901 if (safe_browsing_service()) 901 if (safe_browsing_service())
902 return safe_browsing_service()->safe_browsing_detection_service(); 902 return safe_browsing_service()->safe_browsing_detection_service();
903 return NULL; 903 return NULL;
904 } 904 }
905 905
906 subresource_filter::RulesetService* 906 subresource_filter::ContentRulesetService*
907 BrowserProcessImpl::subresource_filter_ruleset_service() { 907 BrowserProcessImpl::subresource_filter_ruleset_service() {
908 DCHECK(CalledOnValidThread()); 908 DCHECK(CalledOnValidThread());
909 if (!created_subresource_filter_ruleset_service_) 909 if (!created_subresource_filter_ruleset_service_)
910 CreateSubresourceFilterRulesetService(); 910 CreateSubresourceFilterRulesetService();
911 return subresource_filter_ruleset_service_.get(); 911 return subresource_filter_ruleset_service_.get();
912 } 912 }
913 913
914 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) 914 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS)
915 void BrowserProcessImpl::StartAutoupdateTimer() { 915 void BrowserProcessImpl::StartAutoupdateTimer() {
916 autoupdate_timer_.Start(FROM_HERE, 916 autoupdate_timer_.Start(FROM_HERE,
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
1217 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner( 1217 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner(
1218 blocking_pool->GetSequencedTaskRunnerWithShutdownBehavior( 1218 blocking_pool->GetSequencedTaskRunnerWithShutdownBehavior(
1219 blocking_pool->GetSequenceToken(), 1219 blocking_pool->GetSequenceToken(),
1220 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)); 1220 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN));
1221 1221
1222 base::FilePath user_data_dir; 1222 base::FilePath user_data_dir;
1223 PathService::Get(chrome::DIR_USER_DATA, &user_data_dir); 1223 PathService::Get(chrome::DIR_USER_DATA, &user_data_dir);
1224 base::FilePath indexed_ruleset_base_dir = 1224 base::FilePath indexed_ruleset_base_dir =
1225 user_data_dir.Append(subresource_filter::kTopLevelDirectoryName) 1225 user_data_dir.Append(subresource_filter::kTopLevelDirectoryName)
1226 .Append(subresource_filter::kIndexedRulesetBaseDirectoryName); 1226 .Append(subresource_filter::kIndexedRulesetBaseDirectoryName);
1227 subresource_filter_ruleset_service_.reset( 1227 subresource_filter_ruleset_service_ =
1228 new subresource_filter::RulesetService( 1228 base::MakeUnique<subresource_filter::ContentRulesetService>();
1229 subresource_filter_ruleset_service_->set_ruleset_service(
1230 base::MakeUnique<subresource_filter::RulesetService>(
1229 local_state(), blocking_task_runner, 1231 local_state(), blocking_task_runner,
1230 base::MakeUnique<subresource_filter::ContentRulesetServiceDelegate>(), 1232 subresource_filter_ruleset_service_.get(), indexed_ruleset_base_dir));
1231 indexed_ruleset_base_dir));
1232 } 1233 }
1233 1234
1234 void BrowserProcessImpl::CreateGCMDriver() { 1235 void BrowserProcessImpl::CreateGCMDriver() {
1235 DCHECK(!gcm_driver_); 1236 DCHECK(!gcm_driver_);
1236 1237
1237 #if defined(OS_ANDROID) 1238 #if defined(OS_ANDROID)
1238 // Android's GCMDriver currently makes the assumption that it's a singleton. 1239 // Android's GCMDriver currently makes the assumption that it's a singleton.
1239 // Until this gets fixed, instantiating multiple Java GCMDrivers will throw 1240 // Until this gets fixed, instantiating multiple Java GCMDrivers will throw
1240 // an exception, but because they're only initialized on demand these crashes 1241 // an exception, but because they're only initialized on demand these crashes
1241 // would be very difficult to triage. See http://crbug.com/437827. 1242 // would be very difficult to triage. See http://crbug.com/437827.
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
1413 } 1414 }
1414 1415
1415 void BrowserProcessImpl::OnAutoupdateTimer() { 1416 void BrowserProcessImpl::OnAutoupdateTimer() {
1416 if (CanAutorestartForUpdate()) { 1417 if (CanAutorestartForUpdate()) {
1417 DLOG(WARNING) << "Detected update. Restarting browser."; 1418 DLOG(WARNING) << "Detected update. Restarting browser.";
1418 RestartBackgroundInstance(); 1419 RestartBackgroundInstance();
1419 } 1420 }
1420 } 1421 }
1421 1422
1422 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) 1423 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS)
OLDNEW
« no previous file with comments | « chrome/browser/browser_process_impl.h ('k') | chrome/browser/component_updater/subresource_filter_component_installer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698