Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 664 } | 664 } |
| 665 | 665 |
| 666 if (webkit_context_.get()) | 666 if (webkit_context_.get()) |
| 667 webkit_context_->DeleteSessionOnlyData(); | 667 webkit_context_->DeleteSessionOnlyData(); |
| 668 | 668 |
| 669 StopCreateSessionServiceTimer(); | 669 StopCreateSessionServiceTimer(); |
| 670 | 670 |
| 671 // Remove pref observers | 671 // Remove pref observers |
| 672 pref_change_registrar_.RemoveAll(); | 672 pref_change_registrar_.RemoveAll(); |
| 673 | 673 |
| 674 // The sync service needs to be deleted before the services it calls. | |
| 675 // TODO(sync): Make ProfileSyncService into a PKS and let the PDM take care of | |
|
Sheridan Rawlins
2011/08/25 08:19:16
Shouldn't this be TODO(someone's ldap) ?
SteveT
2011/08/25 14:50:55
The issue was assigned to the Sync PM, tmccoy, for
| |
| 676 // the cleanup below. | |
| 677 sync_service_.reset(); | |
| 678 | |
| 674 ProfileDependencyManager::GetInstance()->DestroyProfileServices(this); | 679 ProfileDependencyManager::GetInstance()->DestroyProfileServices(this); |
| 675 | 680 |
| 676 if (db_tracker_) { | 681 if (db_tracker_) { |
| 677 BrowserThread::PostTask( | 682 BrowserThread::PostTask( |
| 678 BrowserThread::FILE, FROM_HERE, | 683 BrowserThread::FILE, FROM_HERE, |
| 679 NewRunnableMethod( | 684 NewRunnableMethod( |
| 680 db_tracker_.get(), | 685 db_tracker_.get(), |
| 681 &webkit_database::DatabaseTracker::Shutdown)); | 686 &webkit_database::DatabaseTracker::Shutdown)); |
| 682 } | 687 } |
| 683 | 688 |
| 684 // DownloadManager is lazily created, so check before accessing it. | 689 // DownloadManager is lazily created, so check before accessing it. |
| 685 if (download_manager_.get()) { | 690 if (download_manager_.get()) { |
| 686 // The download manager queries the history system and should be shut down | 691 // The download manager queries the history system and should be shut down |
| 687 // before the history is shut down so it can properly cancel all requests. | 692 // before the history is shut down so it can properly cancel all requests. |
| 688 download_manager_->Shutdown(); | 693 download_manager_->Shutdown(); |
| 689 download_manager_ = NULL; | 694 download_manager_ = NULL; |
| 690 } | 695 } |
| 691 | 696 |
| 692 // The sync service needs to be deleted before the services it calls. | |
| 693 sync_service_.reset(); | |
| 694 | |
| 695 // Password store uses WebDB, shut it down before the WebDB has been shutdown. | 697 // Password store uses WebDB, shut it down before the WebDB has been shutdown. |
| 696 if (password_store_.get()) | 698 if (password_store_.get()) |
| 697 password_store_->Shutdown(); | 699 password_store_->Shutdown(); |
| 698 | 700 |
| 699 // Both HistoryService and WebDataService maintain threads for background | 701 // Both HistoryService and WebDataService maintain threads for background |
| 700 // processing. Its possible each thread still has tasks on it that have | 702 // processing. Its possible each thread still has tasks on it that have |
| 701 // increased the ref count of the service. In such a situation, when we | 703 // increased the ref count of the service. In such a situation, when we |
| 702 // decrement the refcount, it won't be 0, and the threads/databases aren't | 704 // decrement the refcount, it won't be 0, and the threads/databases aren't |
| 703 // properly shut down. By explicitly calling Cleanup/Shutdown we ensure the | 705 // properly shut down. By explicitly calling Cleanup/Shutdown we ensure the |
| 704 // databases are properly closed. | 706 // databases are properly closed. |
| (...skipping 1016 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1721 #endif | 1723 #endif |
| 1722 } | 1724 } |
| 1723 return prerender_manager_.get(); | 1725 return prerender_manager_.get(); |
| 1724 } | 1726 } |
| 1725 | 1727 |
| 1726 SpellCheckProfile* ProfileImpl::GetSpellCheckProfile() { | 1728 SpellCheckProfile* ProfileImpl::GetSpellCheckProfile() { |
| 1727 if (!spellcheck_profile_.get()) | 1729 if (!spellcheck_profile_.get()) |
| 1728 spellcheck_profile_.reset(new SpellCheckProfile()); | 1730 spellcheck_profile_.reset(new SpellCheckProfile()); |
| 1729 return spellcheck_profile_.get(); | 1731 return spellcheck_profile_.get(); |
| 1730 } | 1732 } |
| OLD | NEW |