OLD | NEW |
1 // Copyright (c) 2006-2008 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 #ifndef CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ |
6 #define CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ | 6 #define CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ |
7 | 7 |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
11 #include "base/scoped_ptr.h" | 11 #include "base/scoped_ptr.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 // This constructor is fast and does no I/O, so can be called at any time. | 92 // This constructor is fast and does no I/O, so can be called at any time. |
93 HistoryBackend(const FilePath& history_dir, | 93 HistoryBackend(const FilePath& history_dir, |
94 Delegate* delegate, | 94 Delegate* delegate, |
95 BookmarkService* bookmark_service); | 95 BookmarkService* bookmark_service); |
96 | 96 |
97 ~HistoryBackend(); | 97 ~HistoryBackend(); |
98 | 98 |
99 // Must be called after creation but before any objects are created. If this | 99 // Must be called after creation but before any objects are created. If this |
100 // fails, all other functions will fail as well. (Since this runs on another | 100 // fails, all other functions will fail as well. (Since this runs on another |
101 // thread, we don't bother returning failure.) | 101 // thread, we don't bother returning failure.) |
102 void Init(); | 102 // |
| 103 // |force_fail| can be set during unittests to unconditionally fail to init. |
| 104 void Init(bool force_fail); |
103 | 105 |
104 // Notification that the history system is shutting down. This will break | 106 // Notification that the history system is shutting down. This will break |
105 // the refs owned by the delegate and any pending transaction so it will | 107 // the refs owned by the delegate and any pending transaction so it will |
106 // actually be deleted. | 108 // actually be deleted. |
107 void Closing(); | 109 void Closing(); |
108 | 110 |
109 // See NotifyRenderProcessHostDestruction. | 111 // See NotifyRenderProcessHostDestruction. |
110 void NotifyRenderProcessHostDestruction(const void* host); | 112 void NotifyRenderProcessHostDestruction(const void* host); |
111 | 113 |
112 // Navigation ---------------------------------------------------------------- | 114 // Navigation ---------------------------------------------------------------- |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
510 // Publishes the history to all indexers which are registered to receive | 512 // Publishes the history to all indexers which are registered to receive |
511 // history data from us. Can be NULL if there are no listeners. | 513 // history data from us. Can be NULL if there are no listeners. |
512 scoped_ptr<HistoryPublisher> history_publisher_; | 514 scoped_ptr<HistoryPublisher> history_publisher_; |
513 | 515 |
514 DISALLOW_COPY_AND_ASSIGN(HistoryBackend); | 516 DISALLOW_COPY_AND_ASSIGN(HistoryBackend); |
515 }; | 517 }; |
516 | 518 |
517 } // namespace history | 519 } // namespace history |
518 | 520 |
519 #endif // CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ | 521 #endif // CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ |
OLD | NEW |