| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_BOOKMARKS_BOOKMARK_MODEL_H_ | 5 #ifndef CHROME_BROWSER_BOOKMARKS_BOOKMARK_MODEL_H_ |
| 6 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_MODEL_H_ | 6 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_MODEL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 | 10 |
| 11 #include <set> | 11 #include <set> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "app/tree_node_model.h" | 14 #include "app/tree_node_model.h" |
| 15 #include "base/lock.h" | |
| 16 #include "base/observer_list.h" | 15 #include "base/observer_list.h" |
| 17 #include "base/string16.h" | 16 #include "base/string16.h" |
| 17 #include "base/synchronization/lock.h" |
| 18 #include "base/synchronization/waitable_event.h" | 18 #include "base/synchronization/waitable_event.h" |
| 19 #include "chrome/browser/bookmarks/bookmark_model_observer.h" | 19 #include "chrome/browser/bookmarks/bookmark_model_observer.h" |
| 20 #include "chrome/browser/bookmarks/bookmark_service.h" | 20 #include "chrome/browser/bookmarks/bookmark_service.h" |
| 21 #include "chrome/browser/cancelable_request.h" | 21 #include "chrome/browser/cancelable_request.h" |
| 22 #include "chrome/browser/favicon_service.h" | 22 #include "chrome/browser/favicon_service.h" |
| 23 #include "chrome/browser/history/history.h" | 23 #include "chrome/browser/history/history.h" |
| 24 #include "chrome/browser/history/history_types.h" | 24 #include "chrome/browser/history/history_types.h" |
| 25 #include "chrome/common/notification_registrar.h" | 25 #include "chrome/common/notification_registrar.h" |
| 26 #include "googleurl/src/gurl.h" | 26 #include "googleurl/src/gurl.h" |
| 27 #include "third_party/skia/include/core/SkBitmap.h" | 27 #include "third_party/skia/include/core/SkBitmap.h" |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 | 448 |
| 449 // The observers. | 449 // The observers. |
| 450 ObserverList<BookmarkModelObserver> observers_; | 450 ObserverList<BookmarkModelObserver> observers_; |
| 451 | 451 |
| 452 // Set of nodes ordered by URL. This is not a map to avoid copying the | 452 // Set of nodes ordered by URL. This is not a map to avoid copying the |
| 453 // urls. | 453 // urls. |
| 454 // WARNING: nodes_ordered_by_url_set_ is accessed on multiple threads. As | 454 // WARNING: nodes_ordered_by_url_set_ is accessed on multiple threads. As |
| 455 // such, be sure and wrap all usage of it around url_lock_. | 455 // such, be sure and wrap all usage of it around url_lock_. |
| 456 typedef std::multiset<BookmarkNode*, NodeURLComparator> NodesOrderedByURLSet; | 456 typedef std::multiset<BookmarkNode*, NodeURLComparator> NodesOrderedByURLSet; |
| 457 NodesOrderedByURLSet nodes_ordered_by_url_set_; | 457 NodesOrderedByURLSet nodes_ordered_by_url_set_; |
| 458 Lock url_lock_; | 458 base::Lock url_lock_; |
| 459 | 459 |
| 460 // Used for loading favicons and the empty history request. | 460 // Used for loading favicons and the empty history request. |
| 461 CancelableRequestConsumerTSimple<BookmarkNode*> load_consumer_; | 461 CancelableRequestConsumerTSimple<BookmarkNode*> load_consumer_; |
| 462 | 462 |
| 463 // Reads/writes bookmarks to disk. | 463 // Reads/writes bookmarks to disk. |
| 464 scoped_refptr<BookmarkStorage> store_; | 464 scoped_refptr<BookmarkStorage> store_; |
| 465 | 465 |
| 466 scoped_ptr<BookmarkIndex> index_; | 466 scoped_ptr<BookmarkIndex> index_; |
| 467 | 467 |
| 468 base::WaitableEvent loaded_signal_; | 468 base::WaitableEvent loaded_signal_; |
| 469 | 469 |
| 470 DISALLOW_COPY_AND_ASSIGN(BookmarkModel); | 470 DISALLOW_COPY_AND_ASSIGN(BookmarkModel); |
| 471 }; | 471 }; |
| 472 | 472 |
| 473 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_MODEL_H_ | 473 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_MODEL_H_ |
| OLD | NEW |