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

Unified Diff: chrome/browser/profiles/profile_io_data.cc

Issue 24153012: Fix cyclic dependency between ProfilePolicyConnector and PrefService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed. Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/profiles/profile_io_data.h ('k') | chrome/browser/ui/toolbar/toolbar_model_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile_io_data.cc
diff --git a/chrome/browser/profiles/profile_io_data.cc b/chrome/browser/profiles/profile_io_data.cc
index a5b848eedc766764037a3be5b03c708f411afb87..354d6a2ba67210b35ad4fbe0666c269e5e5951ad 100644
--- a/chrome/browser/profiles/profile_io_data.cc
+++ b/chrome/browser/profiles/profile_io_data.cc
@@ -63,7 +63,6 @@
#include "content/public/browser/resource_context.h"
#include "extensions/browser/info_map.h"
#include "extensions/common/constants.h"
-#include "net/cert/cert_verifier.h"
#include "net/cookies/canonical_cookie.h"
#include "net/cookies/cookie_monster.h"
#include "net/http/http_transaction_factory.h"
@@ -90,12 +89,10 @@
#if defined(OS_CHROMEOS)
#include "chrome/browser/chromeos/drive/drive_protocol_handler.h"
+#include "chrome/browser/chromeos/policy/policy_cert_service.h"
+#include "chrome/browser/chromeos/policy/policy_cert_service_factory.h"
#include "chrome/browser/chromeos/policy/policy_cert_verifier.h"
-#include "chrome/browser/chromeos/policy/user_network_configuration_updater.h"
-#include "chrome/browser/chromeos/policy/user_network_configuration_updater_factory.h"
#include "chrome/browser/chromeos/settings/cros_settings.h"
-#include "chrome/browser/policy/profile_policy_connector.h"
-#include "chrome/browser/policy/profile_policy_connector_factory.h"
#include "chromeos/settings/cros_settings_names.h"
#endif // defined(OS_CHROMEOS)
@@ -227,25 +224,6 @@ class DebugDevToolsInterceptor
};
#endif // defined(DEBUG_DEVTOOLS)
-#if defined(OS_CHROMEOS)
-scoped_ptr<policy::PolicyCertVerifier> CreatePolicyCertVerifier(
- Profile* profile) {
- policy::ProfilePolicyConnector* connector =
- policy::ProfilePolicyConnectorFactory::GetForProfile(profile);
- base::Closure policy_cert_trusted_callback =
- base::Bind(base::IgnoreResult(&content::BrowserThread::PostTask),
- content::BrowserThread::UI,
- FROM_HERE,
- connector->GetPolicyCertTrustedCallback());
- scoped_ptr<policy::PolicyCertVerifier> cert_verifier(
- new policy::PolicyCertVerifier(policy_cert_trusted_callback));
- policy::UserNetworkConfigurationUpdater* network_configuration_updater =
- policy::UserNetworkConfigurationUpdaterFactory::GetForProfile(profile);
- if (network_configuration_updater)
- network_configuration_updater->SetPolicyCertVerifier(cert_verifier.get());
- return cert_verifier.Pass();
-}
-#endif
} // namespace
void ProfileIOData::InitializeOnUIThread(Profile* profile) {
@@ -301,9 +279,6 @@ void ProfileIOData::InitializeOnUIThread(Profile* profile) {
params->managed_mode_url_filter =
managed_user_service->GetURLFilterForIOThread();
#endif
-#if defined(OS_CHROMEOS)
- params->cert_verifier = CreatePolicyCertVerifier(profile);
-#endif
params->profile = profile;
profile_params_.reset(params.release());
@@ -351,6 +326,9 @@ void ProfileIOData::InitializeOnUIThread(Profile* profile) {
signin_allowed_.MoveToThread(io_message_loop_proxy);
}
+#if defined(OS_CHROMEOS)
+ cert_verifier_ = policy::PolicyCertServiceFactory::CreateForProfile(profile);
+#endif
// The URLBlacklistManager has to be created on the UI thread to register
// observers of |pref_service|, and it also has to clean up on
// ShutdownOnUIThread to release these observers on the right thread.
@@ -847,9 +825,13 @@ void ProfileIOData::Init(content::ProtocolHandlerMap* protocol_handlers) const {
#endif
#if defined(OS_CHROMEOS)
- profile_params_->cert_verifier->InitializeOnIOThread();
- cert_verifier_ = profile_params_->cert_verifier.Pass();
- main_request_context_->set_cert_verifier(cert_verifier_.get());
+ if (cert_verifier_) {
+ cert_verifier_->InitializeOnIOThread();
+ main_request_context_->set_cert_verifier(cert_verifier_.get());
+ } else {
+ main_request_context_->set_cert_verifier(
+ io_thread_globals->cert_verifier.get());
+ }
#else
main_request_context_->set_cert_verifier(
io_thread_globals->cert_verifier.get());
« no previous file with comments | « chrome/browser/profiles/profile_io_data.h ('k') | chrome/browser/ui/toolbar/toolbar_model_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698