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

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: Fixed nit. 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
« no previous file with comments | « no previous file | content/browser/frame_host/frame_tree_node.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
+ return false;
+
// The request from internal objects like chrome://URLs is always allowed.
if (CheckAllowAllMediaStreamContentForOrigin(profile_,
request_.security_origin)) {
« no previous file with comments | « no previous file | content/browser/frame_host/frame_tree_node.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698