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

Issue 11446042: Make sure that all OpenDevice requests are scrutinized against the audio and video policies. (Closed)

Created:
8 years ago by pastarmovj
Modified:
8 years ago
CC:
chromium-reviews, joi+watch-content_chromium.org, feature-media-reviews_chromium.org, jam, darin-cc_chromium.org
Visibility:
Public.

Description

Make sure that all OpenDevice requests are scrutinized against the audio and video policies. BUG=159404 TEST=unit_tests,browser_tests,Manually by setting the policy and observing flapper obey it. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=172877

Patch Set 1 #

Patch Set 2 : Moved RequestType according to Shijing's proposal. #

Total comments: 3

Patch Set 3 : Renamed request type enums. #

Patch Set 4 : Rebased to ToT. #

Total comments: 2

Patch Set 5 : Improved comments as per Joi's proposal. #

Total comments: 1

Patch Set 6 : Fixed a typo. #

Patch Set 7 : Rebased again... #

Unified diffs Side-by-side diffs Delta from patch set Stats (+55 lines, -48 lines) Patch
M chrome/browser/media/media_stream_devices_controller.cc View 1 2 3 4 5 6 1 chunk +7 lines, -0 lines 0 comments Download
M content/browser/renderer_host/media/media_stream_manager.cc View 1 2 3 4 5 6 18 chunks +21 lines, -41 lines 0 comments Download
M content/browser/renderer_host/media/media_stream_ui_controller.h View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download
M content/browser/renderer_host/media/media_stream_ui_controller.cc View 1 2 3 4 5 6 2 chunks +6 lines, -5 lines 0 comments Download
M content/browser/renderer_host/media/media_stream_ui_controller_unittest.cc View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download
M content/public/common/media_stream_request.h View 1 2 3 4 5 6 3 chunks +15 lines, -0 lines 0 comments Download
M content/public/common/media_stream_request.cc View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 16 (0 generated)
pastarmovj
Hi Shijing, Can you take a look at that CL. It is an attempt to ...
8 years ago (2012-12-06 17:18:17 UTC) #1
no longer working on chromium
Hi Julian, Sorry for the delay on reviewing, we had our christmas party yesterday. Thanks ...
8 years ago (2012-12-07 14:01:05 UTC) #2
wjia(left Chromium)
+yzshen@ for his opinion since this will affect Pepper.
8 years ago (2012-12-07 18:47:19 UTC) #3
pastarmovj
Hi guys, Now that we have agreement on this change I would like to get ...
8 years ago (2012-12-10 09:54:44 UTC) #4
no longer working on chromium
Thanks for sorting it out. lgtm with two nits. https://codereview.chromium.org/11446042/diff/8001/chrome/browser/media/media_stream_devices_controller.cc File chrome/browser/media/media_stream_devices_controller.cc (right): https://codereview.chromium.org/11446042/diff/8001/chrome/browser/media/media_stream_devices_controller.cc#newcode85 chrome/browser/media/media_stream_devices_controller.cc:85: ...
8 years ago (2012-12-10 10:17:56 UTC) #5
pastarmovj
Addressed the comment. If there aren't any objections I will click the CQ once the ...
8 years ago (2012-12-12 09:57:03 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pastarmovj@chromium.org/11446042/18008
8 years ago (2012-12-12 14:07:21 UTC) #7
commit-bot: I haz the power
Presubmit check for 11446042-18008 failed and returned exit status 1. Running presubmit commit checks ...
8 years ago (2012-12-12 14:07:28 UTC) #8
pastarmovj
Adding Joi for OWNER approval for content/public. Thanks!
8 years ago (2012-12-12 14:09:05 UTC) #9
Jói
https://codereview.chromium.org/11446042/diff/18008/content/public/common/media_stream_request.h File content/public/common/media_stream_request.h (right): https://codereview.chromium.org/11446042/diff/18008/content/public/common/media_stream_request.h#newcode89 content/public/common/media_stream_request.h:89: // Whether the request should be verified against the ...
8 years ago (2012-12-12 14:18:18 UTC) #10
pastarmovj
PTAL. https://codereview.chromium.org/11446042/diff/18008/content/public/common/media_stream_request.h File content/public/common/media_stream_request.h (right): https://codereview.chromium.org/11446042/diff/18008/content/public/common/media_stream_request.h#newcode89 content/public/common/media_stream_request.h:89: // Whether the request should be verified against ...
8 years ago (2012-12-12 14:52:52 UTC) #11
Jói
LGTM https://codereview.chromium.org/11446042/diff/28001/content/public/common/media_stream_request.h File content/public/common/media_stream_request.h (right): https://codereview.chromium.org/11446042/diff/28001/content/public/common/media_stream_request.h#newcode92 content/public/common/media_stream_request.h:92: // later should not be subject to user ...
8 years ago (2012-12-12 14:58:12 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pastarmovj@chromium.org/11446042/18018
8 years ago (2012-12-12 15:00:28 UTC) #13
commit-bot: I haz the power
Retried try job too often on linux_rel for step(s) content_browsertests
8 years ago (2012-12-12 16:30:12 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pastarmovj@chromium.org/11446042/18018
8 years ago (2012-12-12 16:34:48 UTC) #15
commit-bot: I haz the power
8 years ago (2012-12-12 16:34:51 UTC) #16
Failed to apply patch for
chrome/browser/media/media_stream_devices_controller.cc:
While running patch -p1 --forward --force --no-backup-if-mismatch;
  patching file chrome/browser/media/media_stream_devices_controller.cc
  Hunk #1 FAILED at 80.
  Hunk #2 FAILED at 141.
  2 out of 2 hunks FAILED -- saving rejects to file
chrome/browser/media/media_stream_devices_controller.cc.rej

Patch:       chrome/browser/media/media_stream_devices_controller.cc
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
793254723bf621dab999885ccfe95006933fd484..ba61d5dddf1555770a294d5c401c672f815b262c
100644
--- a/chrome/browser/media/media_stream_devices_controller.cc
+++ b/chrome/browser/media/media_stream_devices_controller.cc
@@ -80,6 +80,18 @@ void
MediaStreamDevicesController::RegisterUserPrefs(PrefService* prefs) {
 
 
 bool MediaStreamDevicesController::DismissInfoBarAndTakeActionOnSettings() {
+  // If this is a no UI check for policies only go straight to accept - policy
+  // check will be done automatically on the way.
+  if (request_.request_type == content::MEDIA_OPEN_DEVICE) {
+    std::string audio, video;
+    if (has_audio_)
+      audio = GetFirstDeviceId(content::MEDIA_DEVICE_AUDIO_CAPTURE);
+    if (has_video_)
+      video = GetFirstDeviceId(content::MEDIA_DEVICE_VIDEO_CAPTURE);
+    Accept(audio, video, false);
+    return true;
+  }
+
   // For tab media requests, we need to make sure the request came from the
   // extension API, so we check the registry here.
   content::MediaStreamDeviceMap::const_iterator tab_video =
@@ -141,7 +153,6 @@ bool
MediaStreamDevicesController::DismissInfoBarAndTakeActionOnSettings() {
       return true;
     }
 
-    // Show the infobar.
     return false;
   }

Powered by Google App Engine
This is Rietveld 408576698