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

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: Rebase Created 7 years, 6 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_tests_unit.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 4870107366fd2d2839de86ce5a4e2626d80d4a89..a1767d7b6d0d2db2322aa6fb1f80409c6dd242a0 100644
--- a/chrome/browser/ui/webui/ntp/thumbnail_source.cc
+++ b/chrome/browser/ui/webui/ntp/thumbnail_source.cc
@@ -35,25 +35,10 @@ std::string ThumbnailSource::GetSource() const {
}
void ThumbnailSource::StartDataRequest(
- const std::string& raw_path,
+ const std::string& path,
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)) {
// We have the thumbnail.
@@ -78,22 +63,7 @@ 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;
- }
+ if (request->url().SchemeIs(chrome::kChromeSearchScheme))
+ return InstantIOContext::ShouldServiceRequest(request);
return URLDataSource::ShouldServiceRequest(request);
}
« no previous file with comments | « chrome/browser/ui/webui/ntp/thumbnail_source.h ('k') | chrome/chrome_tests_unit.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698