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

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

Issue 7234014: Move code to clear web databases on shutdown to the database tracker (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 9 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/profiles/profile.cc ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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.h" 5 #include "chrome/browser/profiles/profile_impl.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/environment.h" 9 #include "base/environment.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after
595 pref_change_registrar_.RemoveAll(); 595 pref_change_registrar_.RemoveAll();
596 596
597 ProfileDependencyManager::GetInstance()->DestroyProfileServices(this); 597 ProfileDependencyManager::GetInstance()->DestroyProfileServices(this);
598 598
599 if (clear_local_state_on_exit_) { 599 if (clear_local_state_on_exit_) {
600 BrowserThread::PostTask( 600 BrowserThread::PostTask(
601 BrowserThread::FILE, FROM_HERE, 601 BrowserThread::FILE, FROM_HERE,
602 NewRunnableFunction(&BrowsingDataRemover::ClearGearsData, path_)); 602 NewRunnableFunction(&BrowsingDataRemover::ClearGearsData, path_));
603 } 603 }
604 604
605 if (db_tracker_) {
606 BrowserThread::PostTask(
607 BrowserThread::FILE, FROM_HERE,
608 NewRunnableMethod(
609 db_tracker_.get(),
610 &webkit_database::DatabaseTracker::Shutdown));
611 }
612
605 // DownloadManager is lazily created, so check before accessing it. 613 // DownloadManager is lazily created, so check before accessing it.
606 if (download_manager_.get()) { 614 if (download_manager_.get()) {
607 // The download manager queries the history system and should be shut down 615 // The download manager queries the history system and should be shut down
608 // before the history is shut down so it can properly cancel all requests. 616 // before the history is shut down so it can properly cancel all requests.
609 download_manager_->Shutdown(); 617 download_manager_->Shutdown();
610 download_manager_ = NULL; 618 download_manager_ = NULL;
611 } 619 }
612 620
613 // The sync service needs to be deleted before the services it calls. 621 // The sync service needs to be deleted before the services it calls.
614 sync_service_.reset(); 622 sync_service_.reset();
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after
1299 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB), 1307 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB),
1300 GetExtensionSpecialStoragePolicy()); 1308 GetExtensionSpecialStoragePolicy());
1301 1309
1302 // Each consumer is responsible for registering its QuotaClient during 1310 // Each consumer is responsible for registering its QuotaClient during
1303 // its construction. 1311 // its construction.
1304 file_system_context_ = CreateFileSystemContext( 1312 file_system_context_ = CreateFileSystemContext(
1305 GetPath(), IsOffTheRecord(), 1313 GetPath(), IsOffTheRecord(),
1306 GetExtensionSpecialStoragePolicy(), 1314 GetExtensionSpecialStoragePolicy(),
1307 quota_manager_->proxy()); 1315 quota_manager_->proxy());
1308 db_tracker_ = new webkit_database::DatabaseTracker( 1316 db_tracker_ = new webkit_database::DatabaseTracker(
1309 GetPath(), IsOffTheRecord(), GetExtensionSpecialStoragePolicy(), 1317 GetPath(), IsOffTheRecord(), clear_local_state_on_exit_,
1318 GetExtensionSpecialStoragePolicy(),
1310 quota_manager_->proxy(), 1319 quota_manager_->proxy(),
1311 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE)); 1320 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE));
1312 webkit_context_ = new WebKitContext( 1321 webkit_context_ = new WebKitContext(
1313 IsOffTheRecord(), GetPath(), GetExtensionSpecialStoragePolicy(), 1322 IsOffTheRecord(), GetPath(), GetExtensionSpecialStoragePolicy(),
1314 clear_local_state_on_exit_, quota_manager_->proxy(), 1323 clear_local_state_on_exit_, quota_manager_->proxy(),
1315 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::WEBKIT)); 1324 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::WEBKIT));
1316 appcache_service_ = new ChromeAppCacheService(quota_manager_->proxy()); 1325 appcache_service_ = new ChromeAppCacheService(quota_manager_->proxy());
1317 BrowserThread::PostTask( 1326 BrowserThread::PostTask(
1318 BrowserThread::IO, FROM_HERE, 1327 BrowserThread::IO, FROM_HERE,
1319 NewRunnableMethod( 1328 NewRunnableMethod(
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
1374 clear_local_state_on_exit_ = 1383 clear_local_state_on_exit_ =
1375 prefs->GetBoolean(prefs::kClearSiteDataOnExit); 1384 prefs->GetBoolean(prefs::kClearSiteDataOnExit);
1376 if (webkit_context_) { 1385 if (webkit_context_) {
1377 webkit_context_->set_clear_local_state_on_exit( 1386 webkit_context_->set_clear_local_state_on_exit(
1378 clear_local_state_on_exit_); 1387 clear_local_state_on_exit_);
1379 } 1388 }
1380 if (appcache_service_) { 1389 if (appcache_service_) {
1381 appcache_service_->SetClearLocalStateOnExit( 1390 appcache_service_->SetClearLocalStateOnExit(
1382 clear_local_state_on_exit_); 1391 clear_local_state_on_exit_);
1383 } 1392 }
1393 if (db_tracker_) {
1394 db_tracker_->SetClearLocalStateOnExit(
1395 clear_local_state_on_exit_);
1396 }
1384 } else if (*pref_name_in == prefs::kGoogleServicesUsername) { 1397 } else if (*pref_name_in == prefs::kGoogleServicesUsername) {
1385 ProfileManager* profile_manager = g_browser_process->profile_manager(); 1398 ProfileManager* profile_manager = g_browser_process->profile_manager();
1386 profile_manager->RegisterProfileName(this); 1399 profile_manager->RegisterProfileName(this);
1387 } else if (*pref_name_in == prefs::kDefaultZoomLevel) { 1400 } else if (*pref_name_in == prefs::kDefaultZoomLevel) {
1388 GetHostZoomMap()->set_default_zoom_level( 1401 GetHostZoomMap()->set_default_zoom_level(
1389 prefs->GetDouble(prefs::kDefaultZoomLevel)); 1402 prefs->GetDouble(prefs::kDefaultZoomLevel));
1390 } 1403 }
1391 break; 1404 break;
1392 } 1405 }
1393 case NotificationType::BOOKMARK_MODEL_LOADED: 1406 case NotificationType::BOOKMARK_MODEL_LOADED:
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
1632 if (!prerender::PrerenderManager::IsPrerenderingPossible()) 1645 if (!prerender::PrerenderManager::IsPrerenderingPossible())
1633 return NULL; 1646 return NULL;
1634 if (!prerender_manager_.get()) { 1647 if (!prerender_manager_.get()) {
1635 CHECK(g_browser_process->prerender_tracker()); 1648 CHECK(g_browser_process->prerender_tracker());
1636 prerender_manager_.reset( 1649 prerender_manager_.reset(
1637 new prerender::PrerenderManager( 1650 new prerender::PrerenderManager(
1638 this, g_browser_process->prerender_tracker())); 1651 this, g_browser_process->prerender_tracker()));
1639 } 1652 }
1640 return prerender_manager_.get(); 1653 return prerender_manager_.get();
1641 } 1654 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile.cc ('k') | chrome/test/testing_profile.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698