OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/history_backend.h" | 5 #include "chrome/browser/history/history_backend.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 text_database_.reset(); | 205 text_database_.reset(); |
206 } | 206 } |
207 | 207 |
208 if (backend_destroy_task_) { | 208 if (backend_destroy_task_) { |
209 // Notify an interested party (typically a unit test) that we're done. | 209 // Notify an interested party (typically a unit test) that we're done. |
210 DCHECK(backend_destroy_message_loop_); | 210 DCHECK(backend_destroy_message_loop_); |
211 backend_destroy_message_loop_->PostTask(FROM_HERE, backend_destroy_task_); | 211 backend_destroy_message_loop_->PostTask(FROM_HERE, backend_destroy_task_); |
212 } | 212 } |
213 } | 213 } |
214 | 214 |
215 void HistoryBackend::Init() { | 215 void HistoryBackend::Init(bool force_fail) { |
216 InitImpl(); | 216 if (!force_fail) |
| 217 InitImpl(); |
217 delegate_->DBLoaded(); | 218 delegate_->DBLoaded(); |
218 } | 219 } |
219 | 220 |
220 void HistoryBackend::SetOnBackendDestroyTask(MessageLoop* message_loop, | 221 void HistoryBackend::SetOnBackendDestroyTask(MessageLoop* message_loop, |
221 Task* task) { | 222 Task* task) { |
222 if (backend_destroy_task_) { | 223 if (backend_destroy_task_) { |
223 DLOG(WARNING) << "Setting more than one destroy task, overriding"; | 224 DLOG(WARNING) << "Setting more than one destroy task, overriding"; |
224 delete backend_destroy_task_; | 225 delete backend_destroy_task_; |
225 } | 226 } |
226 backend_destroy_message_loop_ = message_loop; | 227 backend_destroy_message_loop_ = message_loop; |
(...skipping 1752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1979 return true; | 1980 return true; |
1980 } | 1981 } |
1981 | 1982 |
1982 BookmarkService* HistoryBackend::GetBookmarkService() { | 1983 BookmarkService* HistoryBackend::GetBookmarkService() { |
1983 if (bookmark_service_) | 1984 if (bookmark_service_) |
1984 bookmark_service_->BlockTillLoaded(); | 1985 bookmark_service_->BlockTillLoaded(); |
1985 return bookmark_service_; | 1986 return bookmark_service_; |
1986 } | 1987 } |
1987 | 1988 |
1988 } // namespace history | 1989 } // namespace history |
OLD | NEW |