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

Unified Diff: content/renderer/media/android/webmediaplayer_android.cc

Issue 1568073002: Reduce string copies in GURL creation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | « content/renderer/drop_data_builder.cc ('k') | content/renderer/media/cdm/pepper_cdm_wrapper_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/android/webmediaplayer_android.cc
diff --git a/content/renderer/media/android/webmediaplayer_android.cc b/content/renderer/media/android/webmediaplayer_android.cc
index d23206905839416e823191d6d39145988b97d5bc..96c420d18d8433703285eea67ab89602296e417c 100644
--- a/content/renderer/media/android/webmediaplayer_android.cc
+++ b/content/renderer/media/android/webmediaplayer_android.cc
@@ -51,6 +51,7 @@
#include "media/blink/webmediaplayer_util.h"
#include "net/base/mime_util.h"
#include "third_party/WebKit/public/platform/Platform.h"
+#include "third_party/WebKit/public/platform/URLConversion.h"
#include "third_party/WebKit/public/platform/WebContentDecryptionModuleResult.h"
#include "third_party/WebKit/public/platform/WebEncryptedMediaTypes.h"
#include "third_party/WebKit/public/platform/WebGraphicsContext3DProvider.h"
@@ -312,8 +313,9 @@ void WebMediaPlayerAndroid::DoLoad(LoadType load_type,
CORSMode cors_mode) {
DCHECK(main_thread_checker_.CalledOnValidThread());
- media::ReportMetrics(load_type, GURL(url),
- GURL(frame_->document().securityOrigin().toString()));
+ media::ReportMetrics(
+ load_type, GURL(url),
+ blink::WebStringToGURL(frame_->document().securityOrigin().toString()));
switch (load_type) {
case LoadTypeURL:
@@ -1526,7 +1528,8 @@ WebMediaPlayerAndroid::GenerateKeyRequestInternal(
base::Bind(&WebMediaPlayerAndroid::OnKeyMessage,
weak_factory_.GetWeakPtr())));
- GURL security_origin(frame_->document().securityOrigin().toString());
+ GURL security_origin(
+ blink::WebStringToGURL(frame_->document().securityOrigin().toString()));
proxy_decryptor_->CreateCdm(
cdm_factory_, key_system, security_origin,
base::Bind(&WebMediaPlayerAndroid::OnCdmContextReady,
@@ -1854,7 +1857,7 @@ void WebMediaPlayerAndroid::ReportHLSMetrics() const {
UMA_HISTOGRAM_BOOLEAN("Media.Android.IsHttpLiveStreamingMedia", is_hls);
if (is_hls) {
media::RecordOriginOfHLSPlayback(
- GURL(frame_->document().securityOrigin().toString()));
+ blink::WebStringToGURL(frame_->document().securityOrigin().toString()));
}
// Assuming that |is_hls| is the ground truth, test predictions.
« no previous file with comments | « content/renderer/drop_data_builder.cc ('k') | content/renderer/media/cdm/pepper_cdm_wrapper_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698