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

Side by Side Diff: chrome/browser/sync/test/integration/bookmarks_helper.cc

Issue 2883523002: Reduce the memory usage of bookmarks storage (Closed)
Patch Set: address comments and fixes. Created 3 years, 6 months 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/sync/test/integration/bookmarks_helper.h" 5 #include "chrome/browser/sync/test/integration/bookmarks_helper.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <set> 10 #include <set>
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 urls_with_favicons_->find(node->url()) == urls_with_favicons_->end()) { 226 urls_with_favicons_->find(node->url()) == urls_with_favicons_->end()) {
227 return FaviconData(); 227 return FaviconData();
228 } 228 }
229 // If a favicon was explicitly set, we may need to wait for it to be loaded 229 // If a favicon was explicitly set, we may need to wait for it to be loaded
230 // via BookmarkModel::GetFavicon(), which is an asynchronous operation. 230 // via BookmarkModel::GetFavicon(), which is an asynchronous operation.
231 if (!node->is_favicon_loaded()) { 231 if (!node->is_favicon_loaded()) {
232 FaviconChangeObserver observer(model, node); 232 FaviconChangeObserver observer(model, node);
233 model->GetFavicon(node); 233 model->GetFavicon(node);
234 observer.WaitForGetFavicon(); 234 observer.WaitForGetFavicon();
235 } 235 }
236 return FaviconData(model->GetFavicon(node), node->icon_url()); 236 return FaviconData(model->GetFavicon(node),
237 node->icon_url() ? *node->icon_url() : GURL());
237 } 238 }
238 239
239 // Sets the favicon for |profile| and |node|. |profile| may be 240 // Sets the favicon for |profile| and |node|. |profile| may be
240 // |test()->verifier()|. 241 // |test()->verifier()|.
241 void SetFaviconImpl(Profile* profile, 242 void SetFaviconImpl(Profile* profile,
242 const BookmarkNode* node, 243 const BookmarkNode* node,
243 const GURL& icon_url, 244 const GURL& icon_url,
244 const gfx::Image& image, 245 const gfx::Image& image,
245 bookmarks_helper::FaviconSource favicon_source) { 246 bookmarks_helper::FaviconSource favicon_source) {
246 BookmarkModel* model = BookmarkModelFactory::GetForBrowserContext(profile); 247 BookmarkModel* model = BookmarkModelFactory::GetForBrowserContext(profile);
(...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after
953 } // namespace 954 } // namespace
954 955
955 BookmarksUrlChecker::BookmarksUrlChecker(int profile, 956 BookmarksUrlChecker::BookmarksUrlChecker(int profile,
956 const GURL& url, 957 const GURL& url,
957 int expected_count) 958 int expected_count)
958 : AwaitMatchStatusChangeChecker(base::Bind(BookmarkCountsByUrlMatch, 959 : AwaitMatchStatusChangeChecker(base::Bind(BookmarkCountsByUrlMatch,
959 profile, 960 profile,
960 base::ConstRef(url), 961 base::ConstRef(url),
961 expected_count), 962 expected_count),
962 "Bookmark URL counts match.") {} 963 "Bookmark URL counts match.") {}
OLDNEW
« no previous file with comments | « no previous file | components/bookmarks/browser/bookmark_codec.h » ('j') | components/bookmarks/browser/bookmark_storage.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698