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

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

Issue 24153012: Fix cyclic dependency between ProfilePolicyConnector and PrefService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments. 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 unified diff | Download patch | Annotate | Revision Log
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_impl_io_data.h" 5 #include "chrome/browser/profiles/profile_impl_io_data.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/metrics/field_trial.h" 10 #include "base/metrics/field_trial.h"
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 279
280 BrowserThread::PostTask( 280 BrowserThread::PostTask(
281 BrowserThread::IO, FROM_HERE, 281 BrowserThread::IO, FROM_HERE,
282 base::Bind( 282 base::Bind(
283 &ProfileImplIOData::ClearNetworkingHistorySinceOnIOThread, 283 &ProfileImplIOData::ClearNetworkingHistorySinceOnIOThread,
284 base::Unretained(io_data_), 284 base::Unretained(io_data_),
285 time, 285 time,
286 completion)); 286 completion));
287 } 287 }
288 288
289 void ProfileImplIOData::Handle::ReleaseFromBrowserContextServices(
290 Profile* profile) const {
291 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
292 if (!initialized_)
293 return;
294
295 io_data_->ReleaseFromBrowserContextServices(profile);
296 }
297
289 void ProfileImplIOData::Handle::LazyInitialize() const { 298 void ProfileImplIOData::Handle::LazyInitialize() const {
290 if (initialized_) 299 if (initialized_)
291 return; 300 return;
292 301
293 // Set initialized_ to true at the beginning in case any of the objects 302 // Set initialized_ to true at the beginning in case any of the objects
294 // below try to get the ResourceContext pointer. 303 // below try to get the ResourceContext pointer.
295 initialized_ = true; 304 initialized_ = true;
296 PrefService* pref_service = profile_->GetPrefs(); 305 PrefService* pref_service = profile_->GetPrefs();
297 io_data_->http_server_properties_manager_ = 306 io_data_->http_server_properties_manager_ =
298 new chrome_browser_net::HttpServerPropertiesManager(pref_service); 307 new chrome_browser_net::HttpServerPropertiesManager(pref_service);
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 const base::Closure& completion) { 704 const base::Closure& completion) {
696 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 705 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
697 DCHECK(initialized()); 706 DCHECK(initialized());
698 707
699 DCHECK(transport_security_state()); 708 DCHECK(transport_security_state());
700 // Completes synchronously. 709 // Completes synchronously.
701 transport_security_state()->DeleteAllDynamicDataSince(time); 710 transport_security_state()->DeleteAllDynamicDataSince(time);
702 DCHECK(http_server_properties_manager_); 711 DCHECK(http_server_properties_manager_);
703 http_server_properties_manager_->Clear(completion); 712 http_server_properties_manager_->Clear(completion);
704 } 713 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698