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 786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
797 top_sites_->Shutdown(); | 797 top_sites_->Shutdown(); |
798 | 798 |
799 if (history_service_.get()) | 799 if (history_service_.get()) |
800 history_service_->Cleanup(); | 800 history_service_->Cleanup(); |
801 | 801 |
802 if (io_data_.HasMainRequestContext() && | 802 if (io_data_.HasMainRequestContext() && |
803 default_request_context_ == GetRequestContext()) { | 803 default_request_context_ == GetRequestContext()) { |
804 default_request_context_ = NULL; | 804 default_request_context_ = NULL; |
805 } | 805 } |
806 | 806 |
| 807 if (bookmark_bar_model_.get()) { |
| 808 // It's possible that bookmarks haven't loaded and history is waiting for |
| 809 // bookmarks to complete loading. In such a situation history can't |
| 810 // shutdown. To break the deadlock we tell BookmarkModel it's about to be |
| 811 // deleted so that it can release the signal history is waiting on, allowing |
| 812 // history to shutdown. In such a scenario history sees an incorrect view of |
| 813 // bookmarks, but it's better than a deadlock. |
| 814 bookmark_bar_model_->Cleanup(); |
| 815 } |
807 // HistoryService may call into the BookmarkModel, as such we need to | 816 // HistoryService may call into the BookmarkModel, as such we need to |
808 // delete HistoryService before the BookmarkModel. The destructor for | 817 // delete HistoryService before the BookmarkModel. The destructor for |
809 // HistoryService will join with HistoryService's backend thread so that | 818 // HistoryService will join with HistoryService's backend thread so that |
810 // by the time the destructor has finished we're sure it will no longer call | 819 // by the time the destructor has finished we're sure it will no longer call |
811 // into the BookmarkModel. | 820 // into the BookmarkModel. |
812 history_service_ = NULL; | 821 history_service_ = NULL; |
813 bookmark_bar_model_.reset(); | 822 bookmark_bar_model_.reset(); |
814 | 823 |
815 // FaviconService depends on HistoryServce so make sure we delete | 824 // FaviconService depends on HistoryServce so make sure we delete |
816 // HistoryService first. | 825 // HistoryService first. |
(...skipping 991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1808 | 1817 |
1809 chrome_browser_net::Predictor* ProfileImpl::GetNetworkPredictor() { | 1818 chrome_browser_net::Predictor* ProfileImpl::GetNetworkPredictor() { |
1810 return predictor_; | 1819 return predictor_; |
1811 } | 1820 } |
1812 | 1821 |
1813 SpellCheckProfile* ProfileImpl::GetSpellCheckProfile() { | 1822 SpellCheckProfile* ProfileImpl::GetSpellCheckProfile() { |
1814 if (!spellcheck_profile_.get()) | 1823 if (!spellcheck_profile_.get()) |
1815 spellcheck_profile_.reset(new SpellCheckProfile()); | 1824 spellcheck_profile_.reset(new SpellCheckProfile()); |
1816 return spellcheck_profile_.get(); | 1825 return spellcheck_profile_.get(); |
1817 } | 1826 } |
OLD | NEW |