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

Unified Diff: components/plugins/renderer/mobile_youtube_plugin.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: components/plugins/renderer/mobile_youtube_plugin.cc
diff --git a/components/plugins/renderer/mobile_youtube_plugin.cc b/components/plugins/renderer/mobile_youtube_plugin.cc
index 455640b0fbc07b849cb2638b8751cd698a4bb162..d98b74ddf38b2c20540a028b7f9be320e93502cb 100644
--- a/components/plugins/renderer/mobile_youtube_plugin.cc
+++ b/components/plugins/renderer/mobile_youtube_plugin.cc
@@ -28,13 +28,13 @@ namespace {
std::string GetYoutubeVideoId(const blink::WebPluginParams& params) {
GURL url(params.url);
- std::string video_id = url.path().substr(strlen(kSlashVSlash));
+ base::StringPiece video_id = url.path().substr(strlen(kSlashVSlash));
// Extract just the video id
size_t video_id_end = video_id.find('&');
if (video_id_end != std::string::npos)
video_id = video_id.substr(0, video_id_end);
- return video_id;
+ return video_id.as_string();
}
std::string HtmlData(const blink::WebPluginParams& params,
@@ -44,7 +44,7 @@ std::string HtmlData(const blink::WebPluginParams& params,
return webui::GetI18nTemplateHtml(template_html, &values);
}
-bool IsValidYouTubeVideo(const std::string& path) {
+bool IsValidYouTubeVideo(const base::StringPiece& path) {
unsigned len = strlen(kSlashVSlash);
// check for more than just /v/ or /e/.
« no previous file with comments | « components/password_manager/core/browser/password_form_manager.cc ('k') | components/search_engines/template_url.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698