Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(211)

Side by Side Diff: chrome/browser/bookmarks/bookmark_model.cc

Issue 8919: Adds the ability for ObserverList to not notify observers added during... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« base/observer_list.h ('K') | « base/observer_list_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/bookmarks/bookmark_model.h" 5 #include "chrome/browser/bookmarks/bookmark_model.h"
6 6
7 #include "base/gfx/png_decoder.h" 7 #include "base/gfx/png_decoder.h"
8 #include "chrome/browser/bookmarks/bookmark_storage.h" 8 #include "chrome/browser/bookmarks/bookmark_storage.h"
9 #include "chrome/browser/history/query_parser.h" 9 #include "chrome/browser/history/query_parser.h"
10 #include "chrome/browser/profile.h" 10 #include "chrome/browser/profile.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 70
71 // BookmarkModel -------------------------------------------------------------- 71 // BookmarkModel --------------------------------------------------------------
72 72
73 BookmarkModel::BookmarkModel(Profile* profile) 73 BookmarkModel::BookmarkModel(Profile* profile)
74 : profile_(profile), 74 : profile_(profile),
75 loaded_(false), 75 loaded_(false),
76 #pragma warning(suppress: 4355) // Okay to pass "this" here. 76 #pragma warning(suppress: 4355) // Okay to pass "this" here.
77 root_(this, GURL()), 77 root_(this, GURL()),
78 bookmark_bar_node_(NULL), 78 bookmark_bar_node_(NULL),
79 other_node_(NULL), 79 other_node_(NULL),
80 observers_(ObserverList<BookmarkModelObserver>::NOTIFY_EXISTING_ONLY),
80 waiting_for_history_load_(false), 81 waiting_for_history_load_(false),
81 loaded_signal_(CreateEvent(NULL, TRUE, FALSE, NULL)) { 82 loaded_signal_(CreateEvent(NULL, TRUE, FALSE, NULL)) {
82 // Create the bookmark bar and other bookmarks folders. These always exist. 83 // Create the bookmark bar and other bookmarks folders. These always exist.
83 CreateBookmarkNode(); 84 CreateBookmarkNode();
84 CreateOtherBookmarksNode(); 85 CreateOtherBookmarksNode();
85 86
86 // And add them to the root. 87 // And add them to the root.
87 // 88 //
88 // WARNING: order is important here, various places assume bookmark bar then 89 // WARNING: order is important here, various places assume bookmark bar then
89 // other node. 90 // other node.
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after
771 } 772 }
772 773
773 void BookmarkModel::PopulateNodesByURL(BookmarkNode* node) { 774 void BookmarkModel::PopulateNodesByURL(BookmarkNode* node) {
774 // NOTE: this is called with url_lock_ already held. As such, this doesn't 775 // NOTE: this is called with url_lock_ already held. As such, this doesn't
775 // explicitly grab the lock. 776 // explicitly grab the lock.
776 if (node->is_url()) 777 if (node->is_url())
777 nodes_ordered_by_url_set_.insert(node); 778 nodes_ordered_by_url_set_.insert(node);
778 for (int i = 0; i < node->GetChildCount(); ++i) 779 for (int i = 0; i < node->GetChildCount(); ++i)
779 PopulateNodesByURL(node->GetChild(i)); 780 PopulateNodesByURL(node->GetChild(i));
780 } 781 }
OLDNEW
« base/observer_list.h ('K') | « base/observer_list_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698