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

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

Issue 15907006: Rip out browser-side RID caching for most visited items. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: '' 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 side-by-side diff with in-line comments
Download patch
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 f75111ffde7070c8d3a1dd5ca6959e6b5180679c..31f1a4f8e3a21b0f2acba979fe4e2bb1fa038f8d 100644
--- a/chrome/browser/ui/webui/ntp/thumbnail_source.cc
+++ b/chrome/browser/ui/webui/ntp/thumbnail_source.cc
@@ -39,23 +39,8 @@ void ThumbnailSource::StartDataRequest(
int render_process_id,
int render_view_id,
const content::URLDataSource::GotDataCallback& callback) {
- // Translate to regular path if |raw_path| is of the form
- // chrome-search://favicon/<id> or chrome-search://thumb/<id>, where <id> is
- // an integer.
- std::string path = raw_path;
- if (BrowserThread::CurrentlyOn(BrowserThread::IO)) {
- std::map<std::string, std::string>::iterator it =
- id_to_url_map_.find(raw_path);
- if (it != id_to_url_map_.end()) {
- path = id_to_url_map_[raw_path];
- id_to_url_map_.erase(it);
- }
- } else if (BrowserThread::CurrentlyOn(BrowserThread::UI)) {
- path = InstantService::MaybeTranslateInstantPathOnUI(profile_, raw_path);
- }
-
scoped_refptr<base::RefCountedMemory> data;
- if (thumbnail_service_->GetPageThumbnail(GURL(path), &data)) {
+ if (thumbnail_service_->GetPageThumbnail(GURL(raw_path), &data)) {
// We have the thumbnail.
callback.Run(data.get());
} else {
@@ -79,21 +64,9 @@ base::MessageLoop* ThumbnailSource::MessageLoopForRequestPath(
bool ThumbnailSource::ShouldServiceRequest(
const net::URLRequest* request) const {
if (request->url().SchemeIs(chrome::kChromeSearchScheme)) {
- if (InstantService::IsInstantPath(request->url()) &&
- InstantIOContext::ShouldServiceRequest(request)) {
- // If this request will be serviced on the IO thread, then do the
- // translation from raw_path to path here, where we have the |request|
- // object in-hand, saving the result for later use.
-
- // Strip leading slash from path.
- std::string raw_path = request->url().path().substr(1);
- if (!MessageLoopForRequestPath(raw_path)) {
- id_to_url_map_[raw_path] =
- InstantService::MaybeTranslateInstantPathOnIO(request, raw_path);
- }
- return true;
- }
- return false;
+ // Strip leading slash from path.
+ std::string raw_path = request->url().path().substr(1);
Jered 2013/05/31 17:34:33 Same comment here about the check for an empty pat
kmadhusu 2013/06/04 02:36:01 Fixed.
+ return !raw_path.empty() && InstantIOContext::ShouldServiceRequest(request);
}
return URLDataSource::ShouldServiceRequest(request);
}

Powered by Google App Engine
This is Rietveld 408576698