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 #ifndef COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_STORAGE_H_ | 5 #ifndef COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_STORAGE_H_ |
6 #define COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_STORAGE_H_ | 6 #define COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_STORAGE_H_ |
7 | 7 |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/files/important_file_writer.h" | 9 #include "base/files/important_file_writer.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "components/bookmarks/browser/bookmark_node.h" | 12 #include "components/bookmarks/browser/bookmark_node.h" |
13 | 13 |
14 class BookmarkIndex; | 14 class BookmarkIndex; |
15 class BookmarkModel; | 15 class BookmarkModel; |
16 | 16 |
17 namespace base { | 17 namespace base { |
18 class SequencedTaskRunner; | 18 class SequencedTaskRunner; |
19 } | 19 } |
20 | 20 |
| 21 namespace bookmarks { |
| 22 |
21 // BookmarkLoadDetails is used by BookmarkStorage when loading bookmarks. | 23 // BookmarkLoadDetails is used by BookmarkStorage when loading bookmarks. |
22 // BookmarkModel creates a BookmarkLoadDetails and passes it (including | 24 // BookmarkModel creates a BookmarkLoadDetails and passes it (including |
23 // ownership) to BookmarkStorage. BookmarkStorage loads the bookmarks (and | 25 // ownership) to BookmarkStorage. BookmarkStorage loads the bookmarks (and |
24 // index) in the background thread, then calls back to the BookmarkModel (on | 26 // index) in the background thread, then calls back to the BookmarkModel (on |
25 // the main thread) when loading is done, passing ownership back to the | 27 // the main thread) when loading is done, passing ownership back to the |
26 // BookmarkModel. While loading BookmarkModel does not maintain references to | 28 // BookmarkModel. While loading BookmarkModel does not maintain references to |
27 // the contents of the BookmarkLoadDetails, this ensures we don't have any | 29 // the contents of the BookmarkLoadDetails, this ensures we don't have any |
28 // threading problems. | 30 // threading problems. |
29 class BookmarkLoadDetails { | 31 class BookmarkLoadDetails { |
30 public: | 32 public: |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 | 158 |
157 // See class description of BookmarkLoadDetails for details on this. | 159 // See class description of BookmarkLoadDetails for details on this. |
158 scoped_ptr<BookmarkLoadDetails> details_; | 160 scoped_ptr<BookmarkLoadDetails> details_; |
159 | 161 |
160 // Sequenced task runner where file I/O operations will be performed at. | 162 // Sequenced task runner where file I/O operations will be performed at. |
161 scoped_refptr<base::SequencedTaskRunner> sequenced_task_runner_; | 163 scoped_refptr<base::SequencedTaskRunner> sequenced_task_runner_; |
162 | 164 |
163 DISALLOW_COPY_AND_ASSIGN(BookmarkStorage); | 165 DISALLOW_COPY_AND_ASSIGN(BookmarkStorage); |
164 }; | 166 }; |
165 | 167 |
| 168 } // namespace bookmarks |
| 169 |
166 #endif // COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_STORAGE_H_ | 170 #endif // COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_STORAGE_H_ |
OLD | NEW |