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

Unified Diff: chrome/browser/sync/glue/bookmark_change_processor.cc

Issue 661883002: Sync: Optimize FavIcon callbacks from bookmark model. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Limit the change to the FavIcon check in BookmarkChangeProcessor::BookmarkNodeFaviconChanged 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/glue/bookmark_change_processor.cc
diff --git a/chrome/browser/sync/glue/bookmark_change_processor.cc b/chrome/browser/sync/glue/bookmark_change_processor.cc
index ae0e854ab6b1481d461a8162089cf931aa7765a1..e706a5aebc16f1b909a46bfb7392c6b9733f7506 100644
--- a/chrome/browser/sync/glue/bookmark_change_processor.cc
+++ b/chrome/browser/sync/glue/bookmark_change_processor.cc
@@ -409,6 +409,23 @@ void BookmarkChangeProcessor::BookmarkNodeMoved(BookmarkModel* model,
void BookmarkChangeProcessor::BookmarkNodeFaviconChanged(
BookmarkModel* model,
const BookmarkNode* node) {
+ if (!CanSyncNode(node)) {
+ return;
+ }
+
+ // We shouldn't see changes to the top-level nodes.
+ if (model->is_permanent_node(node)) {
+ NOTREACHED() << "Saw Favicon update to permanent node!";
+ return;
+ }
+
+ // Ignore changes with empty images. This can happen if the favicon is
+ // still being loaded.
+ const gfx::Image& favicon = model->GetFavicon(node);
+ if (favicon.IsEmpty()) {
+ return;
+ }
+
BookmarkNodeChanged(model, node);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698