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

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

Issue 14585015: Recommit the generate profile patch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Load the browser dll manually on Windows. Created 7 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
« no previous file with comments | « chrome/browser/history/top_sites.h ('k') | chrome/browser/history/top_sites_impl.h » ('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 16 matching lines...) Expand all
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( 31 bool TopSitesCache::GetPageThumbnail(
32 const GURL& url, 32 const GURL& url,
33 scoped_refptr<base::RefCountedMemory>* bytes) { 33 scoped_refptr<base::RefCountedMemory>* bytes) {
34 std::map<GURL, Images>::const_iterator found = 34 std::map<GURL, Images>::const_iterator found =
35 images_.find(GetCanonicalURL(url)); 35 images_.find(GetCanonicalURL(url));
36 if (found != images_.end()) { 36 if (found != images_.end()) {
37 base::RefCountedBytes* data = found->second.thumbnail.get(); 37 base::RefCountedMemory* data = found->second.thumbnail.get();
38 if (data) { 38 if (data) {
39 *bytes = data; 39 *bytes = data;
40 return true; 40 return true;
41 } 41 }
42 } 42 }
43 return false; 43 return false;
44 } 44 }
45 45
46 bool TopSitesCache::GetPageThumbnailScore(const GURL& url, 46 bool TopSitesCache::GetPageThumbnailScore(const GURL& url,
47 ThumbnailScore* score) { 47 ThumbnailScore* score) {
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 const GURL& url) { 95 const GURL& url) {
96 MostVisitedURL most_visited_url; 96 MostVisitedURL most_visited_url;
97 most_visited_url.redirects.push_back(url); 97 most_visited_url.redirects.push_back(url);
98 CanonicalURLEntry entry; 98 CanonicalURLEntry entry;
99 entry.first = &most_visited_url; 99 entry.first = &most_visited_url;
100 entry.second = 0u; 100 entry.second = 0u;
101 return canonical_urls_.find(entry); 101 return canonical_urls_.find(entry);
102 } 102 }
103 103
104 } // namespace history 104 } // namespace history
OLDNEW
« no previous file with comments | « chrome/browser/history/top_sites.h ('k') | chrome/browser/history/top_sites_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698