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

Unified Diff: content/browser/renderer_host/media/media_stream_ui_proxy.cc

Issue 1928493002: Use url::Origin to represent security origins in MediaStream-related code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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/browser/renderer_host/media/media_stream_ui_proxy.cc
diff --git a/content/browser/renderer_host/media/media_stream_ui_proxy.cc b/content/browser/renderer_host/media/media_stream_ui_proxy.cc
index 79ae89de62ae842e7b0c74774f257b0a208b8591..9997a76e3e93b0cc7a68669276d50c02277ff91e 100644
--- a/content/browser/renderer_host/media/media_stream_ui_proxy.cc
+++ b/content/browser/renderer_host/media/media_stream_ui_proxy.cc
@@ -14,9 +14,19 @@
#include "content/public/browser/browser_thread.h"
#include "content/public/common/content_switches.h"
#include "media/capture/video/fake_video_capture_device.h"
+#include "url/gurl.h"
+#include "url/origin.h"
namespace content {
+namespace {
+
+GURL ConvertToGURL(const url::Origin& origin) {
+ return origin.unique() ? GURL() : GURL(origin.Serialize());
+}
+
+} // namespace
+
void SetAndCheckAncestorFlag(MediaStreamRequest* request) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
RenderFrameHostImpl* rfh =
@@ -193,7 +203,7 @@ void MediaStreamUIProxy::RequestAccess(
}
void MediaStreamUIProxy::CheckAccess(
- const GURL& security_origin,
+ const url::Origin& security_origin,
MediaStreamType type,
int render_process_id,
int render_frame_id,
@@ -201,17 +211,12 @@ void MediaStreamUIProxy::CheckAccess(
DCHECK_CURRENTLY_ON(BrowserThread::IO);
BrowserThread::PostTaskAndReplyWithResult(
- BrowserThread::UI,
- FROM_HERE,
- base::Bind(&Core::CheckAccess,
- base::Unretained(core_.get()),
- security_origin,
- type,
- render_process_id,
+ BrowserThread::UI, FROM_HERE,
+ base::Bind(&Core::CheckAccess, base::Unretained(core_.get()),
+ ConvertToGURL(security_origin), type, render_process_id,
render_frame_id),
base::Bind(&MediaStreamUIProxy::OnCheckedAccess,
- weak_factory_.GetWeakPtr(),
- callback));
+ weak_factory_.GetWeakPtr(), callback));
}
void MediaStreamUIProxy::OnStarted(const base::Closure& stop_callback,
@@ -350,7 +355,7 @@ void FakeMediaStreamUIProxy::RequestAccess(
}
void FakeMediaStreamUIProxy::CheckAccess(
- const GURL& security_origin,
+ const url::Origin& security_origin,
MediaStreamType type,
int render_process_id,
int render_frame_id,

Powered by Google App Engine
This is Rietveld 408576698