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

Side by Side Diff: chrome/browser/thumbnails/thumbnail_service_impl.cc

Issue 1443723002: Revert of Fix NTP thumbnail generation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 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/thumbnails/thumbnail_service_impl.h" 5 #include "chrome/browser/thumbnails/thumbnail_service_impl.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/memory/ref_counted_memory.h" 8 #include "base/memory/ref_counted_memory.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "chrome/browser/history/history_utils.h" 10 #include "chrome/browser/history/history_utils.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 53
54 ThumbnailServiceImpl::~ThumbnailServiceImpl() { 54 ThumbnailServiceImpl::~ThumbnailServiceImpl() {
55 } 55 }
56 56
57 bool ThumbnailServiceImpl::SetPageThumbnail(const ThumbnailingContext& context, 57 bool ThumbnailServiceImpl::SetPageThumbnail(const ThumbnailingContext& context,
58 const gfx::Image& thumbnail) { 58 const gfx::Image& thumbnail) {
59 scoped_refptr<history::TopSites> local_ptr(top_sites_); 59 scoped_refptr<history::TopSites> local_ptr(top_sites_);
60 if (!local_ptr) 60 if (!local_ptr)
61 return false; 61 return false;
62 62
63 return local_ptr->SetPageThumbnail(context.GetURL(), thumbnail, 63 return local_ptr->SetPageThumbnail(context.url, thumbnail, context.score);
64 context.score());
65 } 64 }
66 65
67 bool ThumbnailServiceImpl::GetPageThumbnail( 66 bool ThumbnailServiceImpl::GetPageThumbnail(
68 const GURL& url, 67 const GURL& url,
69 bool prefix_match, 68 bool prefix_match,
70 scoped_refptr<base::RefCountedMemory>* bytes) { 69 scoped_refptr<base::RefCountedMemory>* bytes) {
71 scoped_refptr<history::TopSites> local_ptr(top_sites_); 70 scoped_refptr<history::TopSites> local_ptr(top_sites_);
72 if (!local_ptr) 71 if (!local_ptr)
73 return false; 72 return false;
74 73
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 } 120 }
122 121
123 void ThumbnailServiceImpl::ShutdownOnUIThread() { 122 void ThumbnailServiceImpl::ShutdownOnUIThread() {
124 // Since each call uses its own scoped_refptr, we can just clear the reference 123 // Since each call uses its own scoped_refptr, we can just clear the reference
125 // here by assigning null. If another call is completed, it added its own 124 // here by assigning null. If another call is completed, it added its own
126 // reference. 125 // reference.
127 top_sites_ = NULL; 126 top_sites_ = NULL;
128 } 127 }
129 128
130 } // namespace thumbnails 129 } // namespace thumbnails
OLDNEW
« no previous file with comments | « chrome/browser/thumbnails/thumbnail_service.h ('k') | chrome/browser/thumbnails/thumbnail_tab_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698