diff options
-rw-r--r-- | chrome/browser/bookmarks/bookmark_model.cc | 21 | ||||
-rw-r--r-- | chrome/browser/bookmarks/bookmark_model.h | 11 |
2 files changed, 6 insertions, 26 deletions
diff --git a/chrome/browser/bookmarks/bookmark_model.cc b/chrome/browser/bookmarks/bookmark_model.cc index bedbac3..34e179f 100644 --- a/chrome/browser/bookmarks/bookmark_model.cc +++ b/chrome/browser/bookmarks/bookmark_model.cc @@ -95,10 +95,8 @@ BookmarkModel::BookmarkModel(Profile* profile) bookmark_bar_node_(NULL), other_node_(NULL), observers_(ObserverList<BookmarkModelObserver>::NOTIFY_EXISTING_ONLY), - waiting_for_history_load_(false) -#if defined(OS_WIN) - , loaded_signal_(CreateEvent(NULL, TRUE, FALSE, NULL)) -#endif + waiting_for_history_load_(false), + loaded_signal_(TRUE, FALSE) { // Create the bookmark bar and other bookmarks folders. These always exist. CreateBookmarkNode(); @@ -489,13 +487,7 @@ void BookmarkModel::DoneLoading() { loaded_ = true; -#if defined(OS_WIN) - if (loaded_signal_.Get()) - SetEvent(loaded_signal_.Get()); -#else - NOTIMPLEMENTED(); -#endif - + loaded_signal_.Signal(); // Notify our direct observers. FOR_EACH_OBSERVER(BookmarkModelObserver, observers_, Loaded(this)); @@ -583,12 +575,7 @@ BookmarkNode* BookmarkModel::AddNode(BookmarkNode* parent, } void BookmarkModel::BlockTillLoaded() { -#if defined(OS_WIN) - if (loaded_signal_.Get()) - WaitForSingleObject(loaded_signal_.Get(), INFINITE); -#else - NOTIMPLEMENTED(); -#endif + loaded_signal_.Wait(); } BookmarkNode* BookmarkModel::GetNodeByID(BookmarkNode* node, int id) { diff --git a/chrome/browser/bookmarks/bookmark_model.h b/chrome/browser/bookmarks/bookmark_model.h index 23517dd..bd94c12 100644 --- a/chrome/browser/bookmarks/bookmark_model.h +++ b/chrome/browser/bookmarks/bookmark_model.h @@ -9,9 +9,7 @@ #include "base/lock.h" #include "base/observer_list.h" -#if defined(OS_WIN) -#include "base/scoped_handle.h" -#endif // defined(OS_WIN) +#include "base/waitable_event.h" #include "chrome/browser/bookmarks/bookmark_service.h" #include "chrome/browser/bookmarks/bookmark_storage.h" #include "chrome/browser/cancelable_request.h" @@ -430,12 +428,7 @@ class BookmarkModel : public NotificationObserver, public BookmarkService { // doesn't exist and the history service hasn't finished loading. bool waiting_for_history_load_; -#if defined(OS_WIN) - // TODO(port): Implement for other platforms. - - // Handle to event signaled when loading is done. - ScopedHandle loaded_signal_; -#endif + base::WaitableEvent loaded_signal_; DISALLOW_COPY_AND_ASSIGN(BookmarkModel); }; |