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

Unified Diff: chrome/browser/ui/webui/favicon_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/favicon_source.h ('k') | chrome/browser/ui/webui/favicon_source_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/favicon_source.cc
diff --git a/chrome/browser/ui/webui/favicon_source.cc b/chrome/browser/ui/webui/favicon_source.cc
index b71df5df6a294bbbfaf77b80c3e611671ef2238e..45522732b755fe411cb35e45929c56361a6d8aee 100644
--- a/chrome/browser/ui/webui/favicon_source.cc
+++ b/chrome/browser/ui/webui/favicon_source.cc
@@ -82,7 +82,7 @@ std::string FaviconSource::GetSource() const {
}
void FaviconSource::StartDataRequest(
- const std::string& raw_path,
+ const std::string& path,
int render_process_id,
int render_view_id,
const content::URLDataSource::GotDataCallback& callback) {
@@ -97,7 +97,7 @@ void FaviconSource::StartDataRequest(
GURL url;
int size_in_dip = 16;
ui::ScaleFactor scale_factor = ui::SCALE_FACTOR_100P;
- bool success = ParsePath(raw_path, &is_icon_url, &url, &size_in_dip,
+ bool success = ParsePath(path, &is_icon_url, &url, &size_in_dip,
&scale_factor);
if (!success) {
@@ -160,10 +160,8 @@ bool FaviconSource::ShouldReplaceExistingSource() const {
}
bool FaviconSource::ShouldServiceRequest(const net::URLRequest* request) const {
- if (request->url().SchemeIs(chrome::kChromeSearchScheme)) {
- return InstantService::IsInstantPath(request->url()) &&
- InstantIOContext::ShouldServiceRequest(request);
- }
+ if (request->url().SchemeIs(chrome::kChromeSearchScheme))
+ return InstantIOContext::ShouldServiceRequest(request);
return URLDataSource::ShouldServiceRequest(request);
}
@@ -173,7 +171,7 @@ bool FaviconSource::HandleMissingResource(const IconRequest& request) {
return false;
}
-bool FaviconSource::ParsePath(const std::string& raw_path,
+bool FaviconSource::ParsePath(const std::string& path,
bool* is_icon_url,
GURL* url,
int* size_in_dip,
@@ -185,14 +183,9 @@ bool FaviconSource::ParsePath(const std::string& raw_path,
*size_in_dip = 16;
*scale_factor = ui::SCALE_FACTOR_100P;
- if (raw_path.empty())
+ if (path.empty())
return false;
- // Translate to regular path if |raw_path| is of the form
- // chrome-search://favicon/<most_visited_item_id>, where
- // "most_visited_item_id" is a uint64.
- std::string path = InstantService::MaybeTranslateInstantPathOnUI(profile_,
- raw_path);
size_t parsed_index = 0;
if (HasSubstringAt(path, parsed_index, kLargestParameter)) {
parsed_index += strlen(kLargestParameter);
@@ -213,8 +206,7 @@ bool FaviconSource::ParsePath(const std::string& raw_path,
size_str = path.substr(parsed_index, slash - parsed_index);
} else {
size_str = path.substr(parsed_index, scale_delimiter - parsed_index);
- scale_str = path.substr(scale_delimiter + 1,
- slash - scale_delimiter - 1);
+ scale_str = path.substr(scale_delimiter + 1, slash - scale_delimiter - 1);
}
if (!base::StringToInt(size_str, size_in_dip))
« no previous file with comments | « chrome/browser/ui/webui/favicon_source.h ('k') | chrome/browser/ui/webui/favicon_source_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698