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

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

Issue 615083004: Use ThreadChecker rather than DCHECK_CURRENTLY_ON. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 6 years, 2 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/off_the_record_profile_impl.h" 5 #include "chrome/browser/profiles/off_the_record_profile_impl.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/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 102
103 OffTheRecordProfileImpl::OffTheRecordProfileImpl(Profile* real_profile) 103 OffTheRecordProfileImpl::OffTheRecordProfileImpl(Profile* real_profile)
104 : profile_(real_profile), 104 : profile_(real_profile),
105 prefs_(PrefServiceSyncable::IncognitoFromProfile(real_profile)), 105 prefs_(PrefServiceSyncable::IncognitoFromProfile(real_profile)),
106 start_time_(Time::Now()) { 106 start_time_(Time::Now()) {
107 // Register on BrowserContext. 107 // Register on BrowserContext.
108 user_prefs::UserPrefs::Set(this, prefs_); 108 user_prefs::UserPrefs::Set(this, prefs_);
109 } 109 }
110 110
111 void OffTheRecordProfileImpl::Init() { 111 void OffTheRecordProfileImpl::Init() {
112 DCHECK_CURRENTLY_ON(BrowserThread::UI);
113
112 // The construction of OffTheRecordProfileIOData::Handle needs the profile 114 // The construction of OffTheRecordProfileIOData::Handle needs the profile
113 // type returned by this->GetProfileType(). Since GetProfileType() is a 115 // type returned by this->GetProfileType(). Since GetProfileType() is a
114 // virtual member function, we cannot call the function defined in the most 116 // virtual member function, we cannot call the function defined in the most
115 // derived class (e.g. GuestSessionProfile) until a ctor finishes. Thus, 117 // derived class (e.g. GuestSessionProfile) until a ctor finishes. Thus,
116 // we have to instantiate OffTheRecordProfileIOData::Handle here after a ctor. 118 // we have to instantiate OffTheRecordProfileIOData::Handle here after a ctor.
117 InitIoData(); 119 InitIoData();
118 120
119 #if defined(ENABLE_CONFIGURATION_POLICY) && !defined(OS_CHROMEOS) 121 #if defined(ENABLE_CONFIGURATION_POLICY) && !defined(OS_CHROMEOS)
120 // Because UserCloudPolicyManager is in a component, it cannot access 122 // Because UserCloudPolicyManager is in a component, it cannot access
121 // GetOriginalProfile. Instead, we have to inject this relation here. 123 // GetOriginalProfile. Instead, we have to inject this relation here.
(...skipping 16 matching lines...) Expand all
138 // TODO(oshima): Remove the need to eagerly initialize the request context 140 // TODO(oshima): Remove the need to eagerly initialize the request context
139 // getter. chromeos::OnlineAttempt is illegally trying to access this 141 // getter. chromeos::OnlineAttempt is illegally trying to access this
140 // Profile member from a thread other than the UI thread, so we need to 142 // Profile member from a thread other than the UI thread, so we need to
141 // prevent a race. 143 // prevent a race.
142 #if defined(OS_CHROMEOS) 144 #if defined(OS_CHROMEOS)
143 GetRequestContext(); 145 GetRequestContext();
144 #endif // defined(OS_CHROMEOS) 146 #endif // defined(OS_CHROMEOS)
145 147
146 InitHostZoomMap(); 148 InitHostZoomMap();
147 149
150 // Make sure HostContentSettingsMap is created on the UI thread.
151 GetHostContentSettingsMap();
152
148 #if defined(ENABLE_PLUGINS) 153 #if defined(ENABLE_PLUGINS)
149 ChromePluginServiceFilter::GetInstance()->RegisterResourceContext( 154 ChromePluginServiceFilter::GetInstance()->RegisterResourceContext(
150 PluginPrefs::GetForProfile(this).get(), 155 PluginPrefs::GetForProfile(this).get(),
151 io_data_->GetResourceContextNoInit()); 156 io_data_->GetResourceContextNoInit());
152 #endif 157 #endif
153 158
154 #if defined(ENABLE_EXTENSIONS) 159 #if defined(ENABLE_EXTENSIONS)
155 // Make the chrome//extension-icon/ resource available. 160 // Make the chrome//extension-icon/ resource available.
156 extensions::ExtensionIconSource* icon_source = 161 extensions::ExtensionIconSource* icon_source =
157 new extensions::ExtensionIconSource(profile_); 162 new extensions::ExtensionIconSource(profile_);
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 PrefProxyConfigTracker* OffTheRecordProfileImpl::CreateProxyConfigTracker() { 546 PrefProxyConfigTracker* OffTheRecordProfileImpl::CreateProxyConfigTracker() {
542 #if defined(OS_CHROMEOS) 547 #if defined(OS_CHROMEOS)
543 if (chromeos::ProfileHelper::IsSigninProfile(this)) { 548 if (chromeos::ProfileHelper::IsSigninProfile(this)) {
544 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( 549 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState(
545 g_browser_process->local_state()); 550 g_browser_process->local_state());
546 } 551 }
547 #endif // defined(OS_CHROMEOS) 552 #endif // defined(OS_CHROMEOS)
548 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( 553 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile(
549 GetPrefs(), g_browser_process->local_state()); 554 GetPrefs(), g_browser_process->local_state());
550 } 555 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698