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

Unified Diff: chrome/browser/ui/webui/ntp/thumbnail_source.cc

Issue 23477033: Implementing URL prefix match for history thumbnail cache. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Replacing ASSERT_TRUE() << ... to NOTREACHED() << ... Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/webui/ntp/thumbnail_source.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/ntp/thumbnail_source.cc
diff --git a/chrome/browser/ui/webui/ntp/thumbnail_source.cc b/chrome/browser/ui/webui/ntp/thumbnail_source.cc
index 324c69432c744b534cc10b0a9e42e7d61d4ffe53..a14239f57937830d2d94e0f65a5baf0d554bdeed 100644
--- a/chrome/browser/ui/webui/ntp/thumbnail_source.cc
+++ b/chrome/browser/ui/webui/ntp/thumbnail_source.cc
@@ -20,16 +20,18 @@
using content::BrowserThread;
// Set ThumbnailService now as Profile isn't thread safe.
-ThumbnailSource::ThumbnailSource(Profile* profile)
+ThumbnailSource::ThumbnailSource(Profile* profile, bool prefix_match)
: thumbnail_service_(ThumbnailServiceFactory::GetForProfile(profile)),
- profile_(profile) {
+ profile_(profile),
+ prefix_match_(prefix_match) {
}
ThumbnailSource::~ThumbnailSource() {
}
std::string ThumbnailSource::GetSource() const {
- return chrome::kChromeUIThumbnailHost;
+ return prefix_match_ ?
+ chrome::kChromeUIThumbnailHost2 : chrome::kChromeUIThumbnailHost;
}
void ThumbnailSource::StartDataRequest(
@@ -38,7 +40,7 @@ void ThumbnailSource::StartDataRequest(
int render_view_id,
const content::URLDataSource::GotDataCallback& callback) {
scoped_refptr<base::RefCountedMemory> data;
- if (thumbnail_service_->GetPageThumbnail(GURL(path), &data)) {
+ if (thumbnail_service_->GetPageThumbnail(GURL(path), prefix_match_, &data)) {
// We have the thumbnail.
callback.Run(data.get());
} else {
« no previous file with comments | « chrome/browser/ui/webui/ntp/thumbnail_source.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698