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

Unified Diff: extensions/browser/extension_protocols.cc

Issue 2626923002: Make ExtensionIconSet::ContainsPath use StringPiece. (Closed)
Patch Set: Created 3 years, 11 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/test/BUILD.gn ('k') | extensions/browser/url_request_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/extension_protocols.cc
diff --git a/extensions/browser/extension_protocols.cc b/extensions/browser/extension_protocols.cc
index a9164ea76ccb5852969b694f6f8cb48d63dd81bf..43b6dbbf7fdfed20226ec3c949e4547318e71f21 100644
--- a/extensions/browser/extension_protocols.cc
+++ b/extensions/browser/extension_protocols.cc
@@ -393,11 +393,12 @@ bool URLIsForExtensionIcon(const GURL& url, const Extension* extension) {
if (!extension)
return false;
- std::string path = url.path();
DCHECK_EQ(url.host(), extension->id());
+ base::StringPiece path = url.path_piece();
DCHECK(path.length() > 0 && path[0] == '/');
- path = path.substr(1);
- return extensions::IconsInfo::GetIcons(extension).ContainsPath(path);
+ base::StringPiece path_without_slash = path.substr(1);
+ return extensions::IconsInfo::GetIcons(extension).ContainsPath(
+ path_without_slash);
}
class ExtensionProtocolHandler
« no previous file with comments | « chrome/test/BUILD.gn ('k') | extensions/browser/url_request_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698