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

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

Issue 2102783003: Add enterprise policy to exempt hosts from Certificate Transparency (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@enterprise_ct
Patch Set: Feedback Created 4 years, 5 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/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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 #include "chrome/browser/profiles/profile_manager.h" 51 #include "chrome/browser/profiles/profile_manager.h"
52 #include "chrome/browser/ssl/chrome_expect_ct_reporter.h" 52 #include "chrome/browser/ssl/chrome_expect_ct_reporter.h"
53 #include "chrome/browser/ui/search/new_tab_page_interceptor_service.h" 53 #include "chrome/browser/ui/search/new_tab_page_interceptor_service.h"
54 #include "chrome/browser/ui/search/new_tab_page_interceptor_service_factory.h" 54 #include "chrome/browser/ui/search/new_tab_page_interceptor_service_factory.h"
55 #include "chrome/common/chrome_paths.h" 55 #include "chrome/common/chrome_paths.h"
56 #include "chrome/common/chrome_switches.h" 56 #include "chrome/common/chrome_switches.h"
57 #include "chrome/common/features.h" 57 #include "chrome/common/features.h"
58 #include "chrome/common/pref_names.h" 58 #include "chrome/common/pref_names.h"
59 #include "chrome/common/url_constants.h" 59 #include "chrome/common/url_constants.h"
60 #include "components/about_handler/about_protocol_handler.h" 60 #include "components/about_handler/about_protocol_handler.h"
61 #include "components/certificate_transparency/ct_policy_manager.h"
61 #include "components/certificate_transparency/tree_state_tracker.h" 62 #include "components/certificate_transparency/tree_state_tracker.h"
62 #include "components/content_settings/core/browser/content_settings_provider.h" 63 #include "components/content_settings/core/browser/content_settings_provider.h"
63 #include "components/content_settings/core/browser/cookie_settings.h" 64 #include "components/content_settings/core/browser/cookie_settings.h"
64 #include "components/content_settings/core/browser/host_content_settings_map.h" 65 #include "components/content_settings/core/browser/host_content_settings_map.h"
65 #include "components/cookie_config/cookie_store_util.h" 66 #include "components/cookie_config/cookie_store_util.h"
66 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_d ata.h" 67 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_d ata.h"
67 #include "components/dom_distiller/core/url_constants.h" 68 #include "components/dom_distiller/core/url_constants.h"
68 #include "components/metrics/metrics_pref_names.h" 69 #include "components/metrics/metrics_pref_names.h"
69 #include "components/metrics/metrics_service.h" 70 #include "components/metrics/metrics_service.h"
70 #include "components/net_log/chrome_net_log.h" 71 #include "components/net_log/chrome_net_log.h"
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 policy::URLBlacklist::SegmentURLCallback callback = 522 policy::URLBlacklist::SegmentURLCallback callback =
522 static_cast<policy::URLBlacklist::SegmentURLCallback>( 523 static_cast<policy::URLBlacklist::SegmentURLCallback>(
523 url_formatter::SegmentURL); 524 url_formatter::SegmentURL);
524 base::SequencedWorkerPool* pool = BrowserThread::GetBlockingPool(); 525 base::SequencedWorkerPool* pool = BrowserThread::GetBlockingPool();
525 scoped_refptr<base::SequencedTaskRunner> background_task_runner = 526 scoped_refptr<base::SequencedTaskRunner> background_task_runner =
526 pool->GetSequencedTaskRunner(pool->GetSequenceToken()); 527 pool->GetSequencedTaskRunner(pool->GetSequenceToken());
527 url_blacklist_manager_.reset(new policy::URLBlacklistManager( 528 url_blacklist_manager_.reset(new policy::URLBlacklistManager(
528 pref_service, background_task_runner, io_task_runner, callback, 529 pref_service, background_task_runner, io_task_runner, callback,
529 base::Bind(policy::OverrideBlacklistForURL))); 530 base::Bind(policy::OverrideBlacklistForURL)));
530 531
532 // The CTPolicyManager shares the same constraints of needing to be cleaned
533 // up on the UI thread.
534 ct_policy_manager_.reset(new certificate_transparency::CTPolicyManager(
535 pref_service, io_task_runner));
536
531 if (!IsOffTheRecord()) { 537 if (!IsOffTheRecord()) {
532 // Add policy headers for non-incognito requests. 538 // Add policy headers for non-incognito requests.
533 policy::PolicyHeaderService* policy_header_service = 539 policy::PolicyHeaderService* policy_header_service =
534 policy::PolicyHeaderServiceFactory::GetForBrowserContext(profile); 540 policy::PolicyHeaderServiceFactory::GetForBrowserContext(profile);
535 if (policy_header_service) { 541 if (policy_header_service) {
536 policy_header_helper_ = 542 policy_header_helper_ =
537 policy_header_service->CreatePolicyHeaderIOHelper(io_task_runner); 543 policy_header_service->CreatePolicyHeaderIOHelper(io_task_runner);
538 } 544 }
539 } 545 }
540 546
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 // Destroy certificate_report_sender_ before main_request_context_, 673 // Destroy certificate_report_sender_ before main_request_context_,
668 // since the former has a reference to the latter. 674 // since the former has a reference to the latter.
669 if (transport_security_state_) 675 if (transport_security_state_)
670 transport_security_state_->SetReportSender(nullptr); 676 transport_security_state_->SetReportSender(nullptr);
671 certificate_report_sender_.reset(); 677 certificate_report_sender_.reset();
672 678
673 if (transport_security_state_) 679 if (transport_security_state_)
674 transport_security_state_->SetExpectCTReporter(nullptr); 680 transport_security_state_->SetExpectCTReporter(nullptr);
675 expect_ct_reporter_.reset(); 681 expect_ct_reporter_.reset();
676 682
683 if (transport_security_state_)
684 transport_security_state_->SetRequireCTDelegate(nullptr);
685
677 // TODO(ajwong): These AssertNoURLRequests() calls are unnecessary since they 686 // TODO(ajwong): These AssertNoURLRequests() calls are unnecessary since they
678 // are already done in the URLRequestContext destructor. 687 // are already done in the URLRequestContext destructor.
679 if (main_request_context_) 688 if (main_request_context_)
680 main_request_context_->AssertNoURLRequests(); 689 main_request_context_->AssertNoURLRequests();
681 if (extensions_request_context_) 690 if (extensions_request_context_)
682 extensions_request_context_->AssertNoURLRequests(); 691 extensions_request_context_->AssertNoURLRequests();
683 692
684 current_context = 0; 693 current_context = 0;
685 for (URLRequestContextMap::iterator it = app_request_context_map_.begin(); 694 for (URLRequestContextMap::iterator it = app_request_context_map_.begin();
686 it != app_request_context_map_.end(); ++it) { 695 it != app_request_context_map_.end(); ++it) {
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
1078 IsOffTheRecord())); 1087 IsOffTheRecord()));
1079 1088
1080 certificate_report_sender_.reset(new net::ReportSender( 1089 certificate_report_sender_.reset(new net::ReportSender(
1081 main_request_context_.get(), net::ReportSender::DO_NOT_SEND_COOKIES)); 1090 main_request_context_.get(), net::ReportSender::DO_NOT_SEND_COOKIES));
1082 transport_security_state_->SetReportSender(certificate_report_sender_.get()); 1091 transport_security_state_->SetReportSender(certificate_report_sender_.get());
1083 1092
1084 expect_ct_reporter_.reset( 1093 expect_ct_reporter_.reset(
1085 new ChromeExpectCTReporter(main_request_context_.get())); 1094 new ChromeExpectCTReporter(main_request_context_.get()));
1086 transport_security_state_->SetExpectCTReporter(expect_ct_reporter_.get()); 1095 transport_security_state_->SetExpectCTReporter(expect_ct_reporter_.get());
1087 1096
1097 transport_security_state_->SetRequireCTDelegate(
1098 ct_policy_manager_->GetDelegate());
1099
1088 // Take ownership over these parameters. 1100 // Take ownership over these parameters.
1089 cookie_settings_ = profile_params_->cookie_settings; 1101 cookie_settings_ = profile_params_->cookie_settings;
1090 host_content_settings_map_ = profile_params_->host_content_settings_map; 1102 host_content_settings_map_ = profile_params_->host_content_settings_map;
1091 #if defined(ENABLE_EXTENSIONS) 1103 #if defined(ENABLE_EXTENSIONS)
1092 extension_info_map_ = profile_params_->extension_info_map; 1104 extension_info_map_ = profile_params_->extension_info_map;
1093 #endif 1105 #endif
1094 1106
1095 resource_context_->host_resolver_ = io_thread_globals->host_resolver.get(); 1107 resource_context_->host_resolver_ = io_thread_globals->host_resolver.get();
1096 resource_context_->request_context_ = main_request_context_.get(); 1108 resource_context_->request_context_ = main_request_context_.get();
1097 1109
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
1272 enable_metrics_.Destroy(); 1284 enable_metrics_.Destroy();
1273 safe_browsing_enabled_.Destroy(); 1285 safe_browsing_enabled_.Destroy();
1274 sync_disabled_.Destroy(); 1286 sync_disabled_.Destroy();
1275 signin_allowed_.Destroy(); 1287 signin_allowed_.Destroy();
1276 network_prediction_options_.Destroy(); 1288 network_prediction_options_.Destroy();
1277 if (media_device_id_salt_.get()) 1289 if (media_device_id_salt_.get())
1278 media_device_id_salt_->ShutdownOnUIThread(); 1290 media_device_id_salt_->ShutdownOnUIThread();
1279 session_startup_pref_.Destroy(); 1291 session_startup_pref_.Destroy();
1280 if (url_blacklist_manager_) 1292 if (url_blacklist_manager_)
1281 url_blacklist_manager_->ShutdownOnUIThread(); 1293 url_blacklist_manager_->ShutdownOnUIThread();
1294 if (ct_policy_manager_)
1295 ct_policy_manager_->Shutdown();
1282 if (chrome_http_user_agent_settings_) 1296 if (chrome_http_user_agent_settings_)
1283 chrome_http_user_agent_settings_->CleanupOnUIThread(); 1297 chrome_http_user_agent_settings_->CleanupOnUIThread();
1284 incognito_availibility_pref_.Destroy(); 1298 incognito_availibility_pref_.Destroy();
1285 1299
1286 if (!context_getters->empty()) { 1300 if (!context_getters->empty()) {
1287 if (BrowserThread::IsMessageLoopValid(BrowserThread::IO)) { 1301 if (BrowserThread::IsMessageLoopValid(BrowserThread::IO)) {
1288 BrowserThread::PostTask( 1302 BrowserThread::PostTask(
1289 BrowserThread::IO, FROM_HERE, 1303 BrowserThread::IO, FROM_HERE,
1290 base::Bind(&NotifyContextGettersOfShutdownOnIO, 1304 base::Bind(&NotifyContextGettersOfShutdownOnIO,
1291 base::Passed(&context_getters))); 1305 base::Passed(&context_getters)));
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
1355 void ProfileIOData::SetCookieSettingsForTesting( 1369 void ProfileIOData::SetCookieSettingsForTesting(
1356 content_settings::CookieSettings* cookie_settings) { 1370 content_settings::CookieSettings* cookie_settings) {
1357 DCHECK(!cookie_settings_.get()); 1371 DCHECK(!cookie_settings_.get());
1358 cookie_settings_ = cookie_settings; 1372 cookie_settings_ = cookie_settings;
1359 } 1373 }
1360 1374
1361 policy::URLBlacklist::URLBlacklistState ProfileIOData::GetURLBlacklistState( 1375 policy::URLBlacklist::URLBlacklistState ProfileIOData::GetURLBlacklistState(
1362 const GURL& url) const { 1376 const GURL& url) const {
1363 return url_blacklist_manager_->GetURLBlacklistState(url); 1377 return url_blacklist_manager_->GetURLBlacklistState(url);
1364 } 1378 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698