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

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

Issue 5359005: Moved deleting the indexed db context to the WebKitContext destructor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Niptucked. Created 10 years 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
« no previous file with comments | « chrome/browser/profile_impl.h ('k') | chrome/test/testing_profile.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/profile_impl.h" 5 #include "chrome/browser/profile_impl.h"
6 6
7 #include "app/resource_bundle.h" 7 #include "app/resource_bundle.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/environment.h" 9 #include "base/environment.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 "profile files to the root directory!"; 266 "profile files to the root directory!";
267 create_session_service_timer_.Start( 267 create_session_service_timer_.Start(
268 TimeDelta::FromMilliseconds(kCreateSessionServiceDelayMS), this, 268 TimeDelta::FromMilliseconds(kCreateSessionServiceDelayMS), this,
269 &ProfileImpl::EnsureSessionServiceCreated); 269 &ProfileImpl::EnsureSessionServiceCreated);
270 270
271 PrefService* prefs = GetPrefs(); 271 PrefService* prefs = GetPrefs();
272 pref_change_registrar_.Init(prefs); 272 pref_change_registrar_.Init(prefs);
273 pref_change_registrar_.Add(prefs::kSpellCheckDictionary, this); 273 pref_change_registrar_.Add(prefs::kSpellCheckDictionary, this);
274 pref_change_registrar_.Add(prefs::kEnableSpellCheck, this); 274 pref_change_registrar_.Add(prefs::kEnableSpellCheck, this);
275 pref_change_registrar_.Add(prefs::kEnableAutoSpellCorrect, this); 275 pref_change_registrar_.Add(prefs::kEnableAutoSpellCorrect, this);
276 pref_change_registrar_.Add(prefs::kClearSiteDataOnExit, this);
276 277
277 // Convert active labs into switches. Modifies the current command line. 278 // Convert active labs into switches. Modifies the current command line.
278 about_flags::ConvertFlagsToSwitches(prefs, CommandLine::ForCurrentProcess()); 279 about_flags::ConvertFlagsToSwitches(prefs, CommandLine::ForCurrentProcess());
279 280
280 // It would be nice to use PathService for fetching this directory, but 281 // It would be nice to use PathService for fetching this directory, but
281 // the cache directory depends on the profile directory, which isn't available 282 // the cache directory depends on the profile directory, which isn't available
282 // to PathService. 283 // to PathService.
283 chrome::GetUserCacheDirectory(path_, &base_cache_path_); 284 chrome::GetUserCacheDirectory(path_, &base_cache_path_);
284 file_util::CreateDirectory(base_cache_path_); 285 file_util::CreateDirectory(base_cache_path_);
285 286
(...skipping 25 matching lines...) Expand all
311 CommandLine::ForCurrentProcess())); 312 CommandLine::ForCurrentProcess()));
312 #endif 313 #endif
313 314
314 background_contents_service_.reset( 315 background_contents_service_.reset(
315 new BackgroundContentsService(this, CommandLine::ForCurrentProcess())); 316 new BackgroundContentsService(this, CommandLine::ForCurrentProcess()));
316 317
317 extension_info_map_ = new ExtensionInfoMap(); 318 extension_info_map_ = new ExtensionInfoMap();
318 319
319 GetPolicyContext()->Initialize(); 320 GetPolicyContext()->Initialize();
320 321
322 clear_local_state_on_exit_ = prefs->GetBoolean(prefs::kClearSiteDataOnExit);
323
321 // Log the profile size after a reasonable startup delay. 324 // Log the profile size after a reasonable startup delay.
322 BrowserThread::PostDelayedTask(BrowserThread::FILE, FROM_HERE, 325 BrowserThread::PostDelayedTask(BrowserThread::FILE, FROM_HERE,
323 new ProfileSizeTask(path_), 112000); 326 new ProfileSizeTask(path_), 112000);
324 327
325 InstantController::RecordMetrics(this); 328 InstantController::RecordMetrics(this);
326 } 329 }
327 330
328 void ProfileImpl::InitExtensions() { 331 void ProfileImpl::InitExtensions() {
329 if (user_script_master_ || extensions_service_) 332 if (user_script_master_ || extensions_service_)
330 return; // Already initialized. 333 return; // Already initialized.
(...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after
1159 spellcheck_host_ready_ = spellcheck_host_ && 1162 spellcheck_host_ready_ = spellcheck_host_ &&
1160 (spellcheck_host_->bdict_file() != base::kInvalidPlatformFileValue || 1163 (spellcheck_host_->bdict_file() != base::kInvalidPlatformFileValue ||
1161 spellcheck_host_->use_platform_spellchecker()); 1164 spellcheck_host_->use_platform_spellchecker());
1162 NotificationService::current()->Notify( 1165 NotificationService::current()->Notify(
1163 NotificationType::SPELLCHECK_HOST_REINITIALIZED, 1166 NotificationType::SPELLCHECK_HOST_REINITIALIZED,
1164 Source<Profile>(this), NotificationService::NoDetails()); 1167 Source<Profile>(this), NotificationService::NoDetails());
1165 } 1168 }
1166 1169
1167 WebKitContext* ProfileImpl::GetWebKitContext() { 1170 WebKitContext* ProfileImpl::GetWebKitContext() {
1168 if (!webkit_context_.get()) 1171 if (!webkit_context_.get())
1169 webkit_context_ = new WebKitContext(this); 1172 webkit_context_ = new WebKitContext(this, clear_local_state_on_exit_);
1170 DCHECK(webkit_context_.get()); 1173 DCHECK(webkit_context_.get());
1171 return webkit_context_.get(); 1174 return webkit_context_.get();
1172 } 1175 }
1173 1176
1174 DesktopNotificationService* ProfileImpl::GetDesktopNotificationService() { 1177 DesktopNotificationService* ProfileImpl::GetDesktopNotificationService() {
1175 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 1178 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
1176 if (!desktop_notification_service_.get()) { 1179 if (!desktop_notification_service_.get()) {
1177 desktop_notification_service_.reset(new DesktopNotificationService( 1180 desktop_notification_service_.reset(new DesktopNotificationService(
1178 this, g_browser_process->notification_ui_manager())); 1181 this, g_browser_process->notification_ui_manager()));
1179 } 1182 }
(...skipping 18 matching lines...) Expand all
1198 std::string* pref_name_in = Details<std::string>(details).ptr(); 1201 std::string* pref_name_in = Details<std::string>(details).ptr();
1199 PrefService* prefs = Source<PrefService>(source).ptr(); 1202 PrefService* prefs = Source<PrefService>(source).ptr();
1200 DCHECK(pref_name_in && prefs); 1203 DCHECK(pref_name_in && prefs);
1201 if (*pref_name_in == prefs::kSpellCheckDictionary || 1204 if (*pref_name_in == prefs::kSpellCheckDictionary ||
1202 *pref_name_in == prefs::kEnableSpellCheck) { 1205 *pref_name_in == prefs::kEnableSpellCheck) {
1203 ReinitializeSpellCheckHost(true); 1206 ReinitializeSpellCheckHost(true);
1204 } else if (*pref_name_in == prefs::kEnableAutoSpellCorrect) { 1207 } else if (*pref_name_in == prefs::kEnableAutoSpellCorrect) {
1205 NotificationService::current()->Notify( 1208 NotificationService::current()->Notify(
1206 NotificationType::SPELLCHECK_AUTOSPELL_TOGGLED, 1209 NotificationType::SPELLCHECK_AUTOSPELL_TOGGLED,
1207 Source<Profile>(this), NotificationService::NoDetails()); 1210 Source<Profile>(this), NotificationService::NoDetails());
1211 } else if (*pref_name_in == prefs::kClearSiteDataOnExit) {
1212 clear_local_state_on_exit_ =
1213 prefs->GetBoolean(prefs::kClearSiteDataOnExit);
1214 if (webkit_context_)
1215 webkit_context_->set_clear_local_state_on_exit(
1216 clear_local_state_on_exit_);
1208 } 1217 }
1209 } else if (NotificationType::THEME_INSTALLED == type) { 1218 } else if (NotificationType::THEME_INSTALLED == type) {
1210 DCHECK_EQ(Source<Profile>(source).ptr(), GetOriginalProfile()); 1219 DCHECK_EQ(Source<Profile>(source).ptr(), GetOriginalProfile());
1211 const Extension* extension = Details<const Extension>(details).ptr(); 1220 const Extension* extension = Details<const Extension>(details).ptr();
1212 SetTheme(extension); 1221 SetTheme(extension);
1213 } else if (NotificationType::BOOKMARK_MODEL_LOADED == type) { 1222 } else if (NotificationType::BOOKMARK_MODEL_LOADED == type) {
1214 GetProfileSyncService(); // Causes lazy-load if sync is enabled. 1223 GetProfileSyncService(); // Causes lazy-load if sync is enabled.
1215 registrar_.Remove(this, NotificationType::BOOKMARK_MODEL_LOADED, 1224 registrar_.Remove(this, NotificationType::BOOKMARK_MODEL_LOADED,
1216 Source<Profile>(this)); 1225 Source<Profile>(this));
1217 } 1226 }
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
1322 return chromeos_proxy_config_service_impl_; 1331 return chromeos_proxy_config_service_impl_;
1323 } 1332 }
1324 #endif // defined(OS_CHROMEOS) 1333 #endif // defined(OS_CHROMEOS)
1325 1334
1326 PrefProxyConfigTracker* ProfileImpl::GetProxyConfigTracker() { 1335 PrefProxyConfigTracker* ProfileImpl::GetProxyConfigTracker() {
1327 if (!pref_proxy_config_tracker_) 1336 if (!pref_proxy_config_tracker_)
1328 pref_proxy_config_tracker_ = new PrefProxyConfigTracker(GetPrefs()); 1337 pref_proxy_config_tracker_ = new PrefProxyConfigTracker(GetPrefs());
1329 1338
1330 return pref_proxy_config_tracker_; 1339 return pref_proxy_config_tracker_;
1331 } 1340 }
OLDNEW
« no previous file with comments | « chrome/browser/profile_impl.h ('k') | chrome/test/testing_profile.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698