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

Unified Diff: chrome/browser/media/media_stream_devices_controller.cc

Issue 795703003: Don't auto allow access to media devices unless a the security origin of the requester is the same … (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix problem with that the ui_request_ was used for state updates. Created 5 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: chrome/browser/media/media_stream_devices_controller.cc
diff --git a/chrome/browser/media/media_stream_devices_controller.cc b/chrome/browser/media/media_stream_devices_controller.cc
index 98a08f3f248a010514f6b774fc90f594e64a5365..dc0d0e8bbe436cf42364330c36b6636e2e8513b0 100644
--- a/chrome/browser/media/media_stream_devices_controller.cc
+++ b/chrome/browser/media/media_stream_devices_controller.cc
@@ -498,6 +498,11 @@ void MediaStreamDevicesController::RequestFinished() {
}
bool MediaStreamDevicesController::IsRequestAllowedByDefault() const {
+ // If not all ancestors of the requesting frame have the same origin, do not
+ // allow the request per default.
+ if (!request_.all_ancestors_have_same_origin)
tommi (sloooow) - chröme 2015/01/27 21:07:13 nit: Would it make sense to have a UMA stat for th
+ return false;
+
// The request from internal objects like chrome://URLs is always allowed.
if (CheckAllowAllMediaStreamContentForOrigin(profile_,
request_.security_origin)) {

Powered by Google App Engine
This is Rietveld 408576698