OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/history/chrome_history_client.h" | 5 #include "chrome/browser/history/chrome_history_client.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "chrome/browser/ui/profile_error_dialog.h" | 8 #include "chrome/browser/ui/profile_error_dialog.h" |
9 #include "chrome/common/chrome_version_info.h" | 9 #include "chrome/common/chrome_version_info.h" |
| 10 #include "chrome/grit/chromium_strings.h" |
| 11 #include "chrome/grit/generated_resources.h" |
10 #include "components/bookmarks/browser/bookmark_model.h" | 12 #include "components/bookmarks/browser/bookmark_model.h" |
11 #include "grit/chromium_strings.h" | |
12 #include "grit/generated_resources.h" | |
13 | 13 |
14 ChromeHistoryClient::ChromeHistoryClient(BookmarkModel* bookmark_model) | 14 ChromeHistoryClient::ChromeHistoryClient(BookmarkModel* bookmark_model) |
15 : bookmark_model_(bookmark_model) { | 15 : bookmark_model_(bookmark_model) { |
16 DCHECK(bookmark_model_); | 16 DCHECK(bookmark_model_); |
17 } | 17 } |
18 | 18 |
19 void ChromeHistoryClient::BlockUntilBookmarksLoaded() { | 19 void ChromeHistoryClient::BlockUntilBookmarksLoaded() { |
20 bookmark_model_->BlockTillLoaded(); | 20 bookmark_model_->BlockTillLoaded(); |
21 } | 21 } |
22 | 22 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 void ChromeHistoryClient::Shutdown() { | 58 void ChromeHistoryClient::Shutdown() { |
59 // It's possible that bookmarks haven't loaded and history is waiting for | 59 // It's possible that bookmarks haven't loaded and history is waiting for |
60 // bookmarks to complete loading. In such a situation history can't shutdown | 60 // bookmarks to complete loading. In such a situation history can't shutdown |
61 // (meaning if we invoked HistoryService::Cleanup now, we would deadlock). To | 61 // (meaning if we invoked HistoryService::Cleanup now, we would deadlock). To |
62 // break the deadlock we tell BookmarkModel it's about to be deleted so that | 62 // break the deadlock we tell BookmarkModel it's about to be deleted so that |
63 // it can release the signal history is waiting on, allowing history to | 63 // it can release the signal history is waiting on, allowing history to |
64 // shutdown (HistoryService::Cleanup to complete). In such a scenario history | 64 // shutdown (HistoryService::Cleanup to complete). In such a scenario history |
65 // sees an incorrect view of bookmarks, but it's better than a deadlock. | 65 // sees an incorrect view of bookmarks, but it's better than a deadlock. |
66 bookmark_model_->Shutdown(); | 66 bookmark_model_->Shutdown(); |
67 } | 67 } |
OLD | NEW |