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

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

Issue 2883523002: Reduce the memory usage of bookmarks storage (Closed)
Patch Set: MakeUnique 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
« no previous file with comments | « no previous file | components/bookmarks/browser/bookmark_codec.cc » ('j') | 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) 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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 urls_with_favicons_->find(node->url()) == urls_with_favicons_->end()) { 228 urls_with_favicons_->find(node->url()) == urls_with_favicons_->end()) {
229 return FaviconData(); 229 return FaviconData();
230 } 230 }
231 // If a favicon was explicitly set, we may need to wait for it to be loaded 231 // If a favicon was explicitly set, we may need to wait for it to be loaded
232 // via BookmarkModel::GetFavicon(), which is an asynchronous operation. 232 // via BookmarkModel::GetFavicon(), which is an asynchronous operation.
233 if (!node->is_favicon_loaded()) { 233 if (!node->is_favicon_loaded()) {
234 FaviconChangeObserver observer(model, node); 234 FaviconChangeObserver observer(model, node);
235 model->GetFavicon(node); 235 model->GetFavicon(node);
236 observer.WaitForGetFavicon(); 236 observer.WaitForGetFavicon();
237 } 237 }
238 return FaviconData(model->GetFavicon(node), node->icon_url()); 238 return FaviconData(model->GetFavicon(node),
239 node->icon_url() ? *node->icon_url() : GURL());
239 } 240 }
240 241
241 // Sets the favicon for |profile| and |node|. |profile| may be 242 // Sets the favicon for |profile| and |node|. |profile| may be
242 // |test()->verifier()|. 243 // |test()->verifier()|.
243 void SetFaviconImpl(Profile* profile, 244 void SetFaviconImpl(Profile* profile,
244 const BookmarkNode* node, 245 const BookmarkNode* node,
245 const GURL& icon_url, 246 const GURL& icon_url,
246 const gfx::Image& image, 247 const gfx::Image& image,
247 bookmarks_helper::FaviconSource favicon_source) { 248 bookmarks_helper::FaviconSource favicon_source) {
248 BookmarkModel* model = BookmarkModelFactory::GetForBrowserContext(profile); 249 BookmarkModel* model = BookmarkModelFactory::GetForBrowserContext(profile);
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after
956 } // namespace 957 } // namespace
957 958
958 BookmarksUrlChecker::BookmarksUrlChecker(int profile, 959 BookmarksUrlChecker::BookmarksUrlChecker(int profile,
959 const GURL& url, 960 const GURL& url,
960 int expected_count) 961 int expected_count)
961 : AwaitMatchStatusChangeChecker(base::Bind(BookmarkCountsByUrlMatch, 962 : AwaitMatchStatusChangeChecker(base::Bind(BookmarkCountsByUrlMatch,
962 profile, 963 profile,
963 base::ConstRef(url), 964 base::ConstRef(url),
964 expected_count), 965 expected_count),
965 "Bookmark URL counts match.") {} 966 "Bookmark URL counts match.") {}
OLDNEW
« no previous file with comments | « no previous file | components/bookmarks/browser/bookmark_codec.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698