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

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

Issue 688473005: Make sure to update the BookmarkIndex on a URL Change (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
« no previous file with comments | « components/bookmarks/browser/bookmark_index_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 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 #include "components/bookmarks/browser/bookmark_model.h" 5 #include "components/bookmarks/browser/bookmark_model.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <functional> 8 #include <functional>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 364
365 BookmarkNode* mutable_node = AsMutable(node); 365 BookmarkNode* mutable_node = AsMutable(node);
366 mutable_node->InvalidateFavicon(); 366 mutable_node->InvalidateFavicon();
367 CancelPendingFaviconLoadRequests(mutable_node); 367 CancelPendingFaviconLoadRequests(mutable_node);
368 368
369 FOR_EACH_OBSERVER(BookmarkModelObserver, observers_, 369 FOR_EACH_OBSERVER(BookmarkModelObserver, observers_,
370 OnWillChangeBookmarkNode(this, node)); 370 OnWillChangeBookmarkNode(this, node));
371 371
372 { 372 {
373 base::AutoLock url_lock(url_lock_); 373 base::AutoLock url_lock(url_lock_);
374 RemoveNodeFromURLSet(mutable_node); 374 RemoveNodeFromURLSet(mutable_node);
sky 2014/11/03 20:44:46 I think it would be less error prone if RemoveNode
375 index_->Remove(node);
375 mutable_node->set_url(url); 376 mutable_node->set_url(url);
377 index_->Add(node);
376 nodes_ordered_by_url_set_.insert(mutable_node); 378 nodes_ordered_by_url_set_.insert(mutable_node);
377 } 379 }
378 380
379 if (store_.get()) 381 if (store_.get())
380 store_->ScheduleSave(); 382 store_->ScheduleSave();
381 383
382 FOR_EACH_OBSERVER(BookmarkModelObserver, observers_, 384 FOR_EACH_OBSERVER(BookmarkModelObserver, observers_,
383 BookmarkNodeChanged(this, node)); 385 BookmarkNodeChanged(this, node));
384 } 386 }
385 387
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after
1004 BookmarkPermanentNode* mobile_node = 1006 BookmarkPermanentNode* mobile_node =
1005 CreatePermanentNode(BookmarkNode::MOBILE); 1007 CreatePermanentNode(BookmarkNode::MOBILE);
1006 return scoped_ptr<BookmarkLoadDetails>(new BookmarkLoadDetails( 1008 return scoped_ptr<BookmarkLoadDetails>(new BookmarkLoadDetails(
1007 bb_node, 1009 bb_node,
1008 other_node, 1010 other_node,
1009 mobile_node, 1011 mobile_node,
1010 client_->GetLoadExtraNodesCallback(), 1012 client_->GetLoadExtraNodesCallback(),
1011 new BookmarkIndex(client_, accept_languages), 1013 new BookmarkIndex(client_, accept_languages),
1012 next_node_id_)); 1014 next_node_id_));
1013 } 1015 }
OLDNEW
« no previous file with comments | « components/bookmarks/browser/bookmark_index_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698