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

Unified Diff: content/renderer/media/user_media_client_impl.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
Index: content/renderer/media/user_media_client_impl.cc
diff --git a/content/renderer/media/user_media_client_impl.cc b/content/renderer/media/user_media_client_impl.cc
index dccfb72bcc83ec7a5f42141d48d666c7ed7ca72c..15e096b6469d9b1bc061d68be7d41c99bb18666c 100644
--- a/content/renderer/media/user_media_client_impl.cc
+++ b/content/renderer/media/user_media_client_impl.cc
@@ -30,6 +30,7 @@
#include "content/renderer/media/webrtc_logging.h"
#include "content/renderer/media/webrtc_uma_histograms.h"
#include "content/renderer/render_thread_impl.h"
+#include "third_party/WebKit/public/platform/URLConversion.h"
#include "third_party/WebKit/public/platform/WebMediaConstraints.h"
#include "third_party/WebKit/public/platform/WebMediaDeviceInfo.h"
#include "third_party/WebKit/public/platform/WebMediaStreamTrack.h"
@@ -189,7 +190,8 @@ void UserMediaClientImpl::requestUserMedia(
}
CopyBlinkRequestToStreamControls(user_media_request, &controls);
- security_origin = GURL(user_media_request.securityOrigin().toString());
+ security_origin =
+ blink::WebStringToGURL(user_media_request.securityOrigin().toString());
DCHECK(render_frame()->GetWebFrame() ==
static_cast<blink::WebFrame*>(
user_media_request.ownerDocument().frame()));
@@ -268,8 +270,10 @@ void UserMediaClientImpl::requestMediaDevices(
// underlying pointer is null). In order to use this function in a test we
// need to check if it isNull.
GURL security_origin;
- if (!media_devices_request.isNull())
- security_origin = GURL(media_devices_request.securityOrigin().toString());
+ if (!media_devices_request.isNull()) {
+ security_origin = blink::WebStringToGURL(
+ media_devices_request.securityOrigin().toString());
+ }
DVLOG(1) << "UserMediaClientImpl::requestMediaDevices("
<< audio_input_request_id
« no previous file with comments | « content/renderer/media/cdm/pepper_cdm_wrapper_impl.cc ('k') | content/renderer/pepper/pepper_plugin_instance_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698