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

Unified Diff: content/common/plugin_list.cc

Issue 2481923002: [WIP] make GURL::path() return a StringPiece (Closed)
Patch Set: thanks asan Created 4 years, 1 month 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: content/common/plugin_list.cc
diff --git a/content/common/plugin_list.cc b/content/common/plugin_list.cc
index 9d650aac1d16b20a717318eb0437cd73c907c3af..a63cb731fda805ce72876e897ee0b09443df98d7 100644
--- a/content/common/plugin_list.cc
+++ b/content/common/plugin_list.cc
@@ -236,11 +236,10 @@ void PluginList::GetPluginInfoArray(
// We collected stats to determine this approach isn't a major compat issue,
// and we defend against content confusion attacks in various cases, such
// as when the user doesn't have the Flash plugin enabled.
- std::string path = url.path();
+ base::StringPiece path = url.path();
std::string::size_type last_dot = path.rfind('.');
if (last_dot != std::string::npos && mime_type.empty()) {
- std::string extension =
- base::ToLowerASCII(base::StringPiece(path).substr(last_dot + 1));
+ std::string extension = base::ToLowerASCII(path.substr(last_dot + 1));
std::string actual_mime_type;
for (size_t i = 0; i < plugins_list_.size(); ++i) {
if (SupportsExtension(plugins_list_[i], extension, &actual_mime_type)) {
« no previous file with comments | « content/child/ftp_directory_listing_response_delegate.cc ('k') | content/common/service_worker/service_worker_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698