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

Side by Side Diff: chrome/browser/history/top_sites_cache.cc

Issue 10272004: Move RefCountedMemory class to base namespace. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 8 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/history/top_sites_cache.h ('k') | chrome/browser/history/top_sites_unittest.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/history/top_sites_cache.h" 5 #include "chrome/browser/history/top_sites_cache.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/ref_counted_memory.h" 8 #include "base/memory/ref_counted_memory.h"
9 9
10 namespace history { 10 namespace history {
(...skipping 10 matching lines...) Expand all
21 } 21 }
22 22
23 void TopSitesCache::SetThumbnails(const URLToImagesMap& images) { 23 void TopSitesCache::SetThumbnails(const URLToImagesMap& images) {
24 images_ = images; 24 images_ = images;
25 } 25 }
26 26
27 Images* TopSitesCache::GetImage(const GURL& url) { 27 Images* TopSitesCache::GetImage(const GURL& url) {
28 return &images_[GetCanonicalURL(url)]; 28 return &images_[GetCanonicalURL(url)];
29 } 29 }
30 30
31 bool TopSitesCache::GetPageThumbnail(const GURL& url, 31 bool TopSitesCache::GetPageThumbnail(
32 scoped_refptr<RefCountedMemory>* bytes) { 32 const GURL& url,
33 scoped_refptr<base::RefCountedMemory>* bytes) {
33 std::map<GURL, Images>::const_iterator found = 34 std::map<GURL, Images>::const_iterator found =
34 images_.find(GetCanonicalURL(url)); 35 images_.find(GetCanonicalURL(url));
35 if (found != images_.end()) { 36 if (found != images_.end()) {
36 base::RefCountedBytes* data = found->second.thumbnail.get(); 37 base::RefCountedBytes* data = found->second.thumbnail.get();
37 if (data) { 38 if (data) {
38 *bytes = data; 39 *bytes = data;
39 return true; 40 return true;
40 } 41 }
41 } 42 }
42 return false; 43 return false;
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 const GURL& url) { 95 const GURL& url) {
95 MostVisitedURL most_visited_url; 96 MostVisitedURL most_visited_url;
96 most_visited_url.redirects.push_back(url); 97 most_visited_url.redirects.push_back(url);
97 CanonicalURLEntry entry; 98 CanonicalURLEntry entry;
98 entry.first = &most_visited_url; 99 entry.first = &most_visited_url;
99 entry.second = 0u; 100 entry.second = 0u;
100 return canonical_urls_.find(entry); 101 return canonical_urls_.find(entry);
101 } 102 }
102 103
103 } // namespace history 104 } // namespace history
OLDNEW
« no previous file with comments | « chrome/browser/history/top_sites_cache.h ('k') | chrome/browser/history/top_sites_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698