[MSC] Screen auto selection for getDisplayMediaSet. [chromium/src : main]

14 views
Skip to first unread message

Simon Hangl (Gerrit)

unread,
Apr 29, 2022, 6:40:48 AM4/29/22
to Elad Alon, alexmo...@chromium.org, android-web...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, carlos...@chromium.org, chfreme...@chromium.org, chili...@chromium.org, chrome-gr...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, cricke...@chromium.org, dewitt...@chromium.org, dimich...@chromium.org, droger+w...@chromium.org, extension...@chromium.org, feature-me...@chromium.org, feature-v...@chromium.org, fgorsk...@chromium.org, fuchsia...@chromium.org, halliwe...@chromium.org, ipc-securi...@chromium.org, jasonrobe...@google.com, jophba...@chromium.org, kinuko...@chromium.org, lcwu+...@chromium.org, mfoltz...@chromium.org, navigation...@chromium.org, performance-m...@chromium.org, petewi...@chromium.org, phoglun...@chromium.org, poscia...@chromium.org, tommyw+w...@chromium.org

Attention is currently required from: Elad Alon.

Simon Hangl would like Elad Alon to review this change.

View Change

[MSC] Screen auto selection for getDisplayMediaSet.

This change enables auto selection for getDisplayMediaSet.
It propagates the autoSelectAllScreens property through the
call stack, loads a list of all attached screens and forwards
it for capturing.

Change-Id: I4cc00e9dd6807c5a992367a31f10e261c372b89e
---
M content/browser/renderer_host/media/media_stream_manager.cc
M content/browser/renderer_host/media/media_stream_manager.h
M content/browser/renderer_host/media/media_stream_manager_unittest.cc
M third_party/blink/common/mediastream/media_stream_mojom_traits.cc
M third_party/blink/public/common/mediastream/media_stream_controls.h
M third_party/blink/public/common/mediastream/media_stream_mojom_traits.h
M third_party/blink/public/mojom/mediastream/media_stream.mojom
M third_party/blink/renderer/modules/mediastream/user_media_processor.cc
M third_party/blink/renderer/modules/mediastream/user_media_request.cc
M third_party/blink/renderer/modules/mediastream/user_media_request.h
10 files changed, 139 insertions(+), 22 deletions(-)


To view, visit change 3605769. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I4cc00e9dd6807c5a992367a31f10e261c372b89e
Gerrit-Change-Number: 3605769
Gerrit-PatchSet: 10
Gerrit-Owner: Simon Hangl <sim...@google.com>
Gerrit-Reviewer: Elad Alon <elad...@chromium.org>
Gerrit-Reviewer: Simon Hangl <sim...@google.com>
Gerrit-CC: Ehsan Karamad <ekar...@chromium.org>
Gerrit-CC: Enterprise Policy Reviews <enterprise-p...@google.com>
Gerrit-CC: James Maclean <wjma...@chromium.org>
Gerrit-CC: Kevin McNee <mc...@chromium.org>
Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
Gerrit-Attention: Elad Alon <elad...@chromium.org>
Gerrit-MessageType: newchange

Simon Hangl (Gerrit)

unread,
Apr 29, 2022, 6:40:57 AM4/29/22
to alexmo...@chromium.org, android-web...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, carlos...@chromium.org, chfreme...@chromium.org, chili...@chromium.org, chrome-gr...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, cricke...@chromium.org, dewitt...@chromium.org, dimich...@chromium.org, droger+w...@chromium.org, extension...@chromium.org, feature-me...@chromium.org, feature-v...@chromium.org, fgorsk...@chromium.org, fuchsia...@chromium.org, halliwe...@chromium.org, ipc-securi...@chromium.org, jasonrobe...@google.com, jophba...@chromium.org, kinuko...@chromium.org, lcwu+...@chromium.org, mfoltz...@chromium.org, navigation...@chromium.org, performance-m...@chromium.org, petewi...@chromium.org, phoglun...@chromium.org, poscia...@chromium.org, tommyw+w...@chromium.org, Elad Alon, Tricium, Chromium LUCI CQ, chromium...@chromium.org, Ehsan Karamad, Enterprise Policy Reviews, Kevin McNee, Rijubrata Bhaumik, Sadrul Chowdhury, James Maclean

Attention is currently required from: Elad Alon.

View Change

1 comment:

  • Patchset:

    • Patch Set #10:

      eladalon@: this change enables "select all screens". PTAL.

To view, visit change 3605769. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I4cc00e9dd6807c5a992367a31f10e261c372b89e
Gerrit-Change-Number: 3605769
Gerrit-PatchSet: 10
Gerrit-Owner: Simon Hangl <sim...@google.com>
Gerrit-Reviewer: Elad Alon <elad...@chromium.org>
Gerrit-Reviewer: Simon Hangl <sim...@google.com>
Gerrit-CC: Ehsan Karamad <ekar...@chromium.org>
Gerrit-CC: Enterprise Policy Reviews <enterprise-p...@google.com>
Gerrit-CC: James Maclean <wjma...@chromium.org>
Gerrit-CC: Kevin McNee <mc...@chromium.org>
Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
Gerrit-Attention: Elad Alon <elad...@chromium.org>
Gerrit-Comment-Date: Fri, 29 Apr 2022 10:40:44 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment

Elad Alon (Gerrit)

unread,
Jun 8, 2022, 6:29:27 AM6/8/22
to Simon Hangl, alexmo...@chromium.org, android-web...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, carlos...@chromium.org, chfreme...@chromium.org, chili...@chromium.org, chrome-gr...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, cricke...@chromium.org, dewitt...@chromium.org, dimich...@chromium.org, droger+w...@chromium.org, extension...@chromium.org, feature-me...@chromium.org, feature-v...@chromium.org, fgorsk...@chromium.org, fuchsia...@chromium.org, halliwe...@chromium.org, ipc-securi...@chromium.org, jasonrobe...@google.com, jophba...@chromium.org, kinuko...@chromium.org, lcwu+...@chromium.org, mfoltz...@chromium.org, navigation...@chromium.org, performance-m...@chromium.org, petewi...@chromium.org, phoglun...@chromium.org, poscia...@chromium.org, tommyw+w...@chromium.org, Tricium, Chromium LUCI CQ, chromium...@chromium.org, Ehsan Karamad, Enterprise Policy Reviews, Kevin McNee, Rijubrata Bhaumik, Sadrul Chowdhury, James Maclean

Attention is currently required from: Simon Hangl.

View Change

28 comments:

  • File content/browser/renderer_host/media/media_stream_manager.h:

  • File content/browser/renderer_host/media/media_stream_manager.cc:

    • Patch Set #21, Line 2863:

      nit: Undo.

    • Patch Set #21, Line 1118:

            MediaDeviceSaltAndOrigin{/*device_id_salt=*/std::string(),
      /*group_id_salt=*/std::string(), security_origin,
      /*has_focus=*/true, /*is_background=*/false});

      Could you use this syntax?
      ```
      MediaDeviceSaltAndOrigin{
      .device_id_salt = std::string(),
      .group_id_salt = std::string,
      ...
      };
      ```
    • Patch Set #21, Line 1906:

            // Cache the |label| in the device name field, for unit test purpose
      // only.

      Could you undo the change?

    • Patch Set #21, Line 2002: base::Unretained(this)

      Annotate Unretained with rationale.

    • Patch Set #21, Line 2016: if (fake_origin_uri_for_testing_.is_valid()) {

      Is it intentional that `browser_context` is left nullptr if `fake_origin_uri_for_testing_` is not set? (It would make things simpler if you always read it.)

    • Patch Set #21, Line 2019: render_process_host

      Check for nullness? Is it guaranteed it's still alive when you're processing this?

    • Patch Set #21, Line 2022:

          const ProcessLock process_lock = render_process_host->GetProcessLock();
      origin = process_lock.lock_url();

      Note to self: Scrutinize this part in following iterations of the review. (ProcessLock is not used anywhere else in this file.)

    • Patch Set #21, Line 2030: base::Unretained(this)

      Please add a comment explaining why Unretained is safe whenever you use it.

    • Patch Set #21, Line 2031:

                GetContentClient()
      ->browser()
      ->IsGetDisplayMediaSetSelectAllScreensAllowed(browser_context,
      origin))

      Could you use an intermediary so as to make this easier to read?

    • Patch Set #21, Line 2042: if (!select_all_screens_allowed) {

      1. If `select_all_screens` was specified even though `!select_all_screens_allowed`, we should kill the render process using a BadMessage.
      2. Can you do it in the dispatcher?

    • Patch Set #21, Line 2051: DCHECK(surface_enumerator);

      Btw, I recall there was one implementation of `SurfaceEnumerator` that returned `nullptr`. Is it guaranteed it's not the one used?

    • Patch Set #21, Line 2052:

        // If forced screen selection is requested, there is no need to post the
      // request to the UI.

      Could you please explain why not?

    • Patch Set #21, Line 2056: Unretained

      Same.

    • Patch Set #21, Line 2059: HandleAttachedDevices

      The implementation assumes (1) screens and (2) video, but the name does not reflect that.

    • Patch Set #21, Line 2063: DCHECK(request);

      Is this DCHECK truly guaranteed? Can the request not get asynchronously ejected from the container where you Find() it?

    • Patch Set #21, Line 2067: media_id.ToString()

      Could you cache this value in an intermediary variable so as to avoid computing it twice?

    • Patch Set #21, Line 2072: ? true : false

      The `? true : false` part can be dropped, as the result of `!=` is already a bool.

    • Patch Set #21, Line 2083: emplace_back

      I think push_back would be equivalent in this case. Or am I wrong?

  • File content/browser/renderer_host/media/media_stream_manager.cc:

    • Patch Set #24, Line 1877:

        // If using the fake UI, it will just auto-select from the available
      // devices. The fake UI doesn't work for desktop sharing requests since we
      // can't see its devices from here; always use the real UI for such
      // requests. The processing below for MEDIA_GUM_DESKTOP_VIDEO_CAPTURE is for

      Please undo this change if it's only a reshuffling caused by formatting double-commented text during development.

    • Patch Set #24, Line 2907: void MediaStreamManager::UseFakeOriginUriForTesting(

      DCHECK thread.

  • File content/browser/renderer_host/media/media_stream_manager_unittest.cc:

  • File content/public/browser/content_browser_client.h:

    • Patch Set #21, Line 637: // Checks whether screen auto selection is allowed for capturing.

      nit: Would be good to explain what screen auto-selection is.

To view, visit change 3605769. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I4cc00e9dd6807c5a992367a31f10e261c372b89e
Gerrit-Change-Number: 3605769
Gerrit-PatchSet: 24
Gerrit-Owner: Simon Hangl <sim...@google.com>
Gerrit-Reviewer: Elad Alon <elad...@chromium.org>
Gerrit-Reviewer: Simon Hangl <sim...@google.com>
Gerrit-CC: Ehsan Karamad <ekar...@chromium.org>
Gerrit-CC: Enterprise Policy Reviews <enterprise-p...@google.com>
Gerrit-CC: James Maclean <wjma...@chromium.org>
Gerrit-CC: Kevin McNee <mc...@chromium.org>
Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
Gerrit-Attention: Simon Hangl <sim...@google.com>
Gerrit-Comment-Date: Wed, 08 Jun 2022 10:29:10 +0000

Simon Hangl (Gerrit)

unread,
Jun 14, 2022, 7:44:10 AM6/14/22
to alexmo...@chromium.org, android-web...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, carlos...@chromium.org, chfreme...@chromium.org, chili...@chromium.org, chrome-gr...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, cricke...@chromium.org, dewitt...@chromium.org, dimich...@chromium.org, droger+w...@chromium.org, extension...@chromium.org, feature-me...@chromium.org, feature-v...@chromium.org, fgorsk...@chromium.org, fuchsia...@chromium.org, halliwe...@chromium.org, ipc-securi...@chromium.org, jasonrobe...@google.com, jophba...@chromium.org, kinuko...@chromium.org, lcwu+...@chromium.org, mfoltz...@chromium.org, navigation...@chromium.org, performance-m...@chromium.org, petewi...@chromium.org, phoglun...@chromium.org, poscia...@chromium.org, tommyw+w...@chromium.org, Elad Alon, Tricium, Chromium LUCI CQ, chromium...@chromium.org, Ehsan Karamad, Enterprise Policy Reviews, Kevin McNee, Rijubrata Bhaumik, Sadrul Chowdhury, James Maclean

Attention is currently required from: Elad Alon.

View Change

30 comments:

  • Patchset:

  • File content/browser/renderer_host/media/media_stream_manager.h:

    • URI or URL? (Same question for `fake_origin_uri`. […]

      url.

    • the implementation now uses base::BindPostTask. the result is returned through the passed callback (explicit now in the function signature).

    • Done

    • Change to a simple bool, it does not hurt if the function modifies primitive parameters passed by va […]

      Done

    • The method is called "HandleAttachedDevices". […]

      Done

    • Done

  • File content/browser/renderer_host/media/media_stream_manager.cc:

    • Done

    • Patch Set #21, Line 1118:

            MediaDeviceSaltAndOrigin{/*device_id_salt=*/std::string(),
      /*group_id_salt=*/std::string(), security_origin,
      /*has_focus=*/true, /*is_background=*/false});

    • Patch Set #21, Line 1906:

            // Cache the |label| in the device name field, for unit test purpose
      // only.

      Could you undo the change?

    • Done

    • Done

    • Is it intentional that `browser_context` is left nullptr if `fake_origin_uri_for_testing_` is not se […]

      yes, in my (unit) tests the renderer_process_host was null.

    • Patch Set #21, Line 2019: render_process_host

      Check for nullness? Is it guaranteed it's still alive when you're processing this?

    • indeed. now i exit early in this case.

    • Done

    • Patch Set #21, Line 2031:

                GetContentClient()
      ->browser()
      ->IsGetDisplayMediaSetSelectAllScreensAllowed(browser_context,
      origin))

      Could you use an intermediary so as to make this easier to read?

    • Done

    • 1. […]

      1) i moved it over to the dispatcher.
      2) a BadMessage is emitted on error.
      3) adapted tests for both (positive and negative) cases.

    • Btw, I recall there was one implementation of `SurfaceEnumerator` that returned `nullptr`. […]

      Done

    • Patch Set #21, Line 2052:

        // If forced screen selection is requested, there is no need to post the
      // request to the UI.

      Could you please explain why not?

    • Done

    • this one actually in principle could outlive the `MediaStreamManager`. i also moved over ownership of the `ScreenEnumerator` object to the callback to make sure it does not get destructed.

    • Patch Set #21, Line 2059: HandleAttachedDevices

      The implementation assumes (1) screens and (2) video, but the name does not reflect that.

    • Done

    • Is this DCHECK truly guaranteed? Can the request not get asynchronously ejected from the container w […]

      true. now rejected with permission denied.

    • Patch Set #21, Line 2067: media_id.ToString()

      Could you cache this value in an intermediary variable so as to avoid computing it twice?

    • Done

    • Done

    • I think push_back would be equivalent in this case. […]

      Done

  • File content/browser/renderer_host/media/media_stream_manager.cc:

  • File content/browser/renderer_host/media/media_stream_manager.cc:

    • Patch Set #24, Line 1877:

        // If using the fake UI, it will just auto-select from the available
      // devices. The fake UI doesn't work for desktop sharing requests since we
      // can't see its devices from here; always use the real UI for such
      // requests. The processing below for MEDIA_GUM_DESKTOP_VIDEO_CAPTURE is for

    • Please undo this change if it's only a reshuffling caused by formatting double-commented text during […]

      Done

    • Done

  • File content/browser/renderer_host/media/media_stream_manager_unittest.cc:

    • > single-argument constructors must be marked explicit to avoid unintentional implicit conversions ( […]

      Done

  • File content/public/browser/content_browser_client.h:

    • Patch Set #21, Line 637: // Checks whether screen auto selection is allowed for capturing.

      nit: Would be good to explain what screen auto-selection is.

    • Done

To view, visit change 3605769. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I4cc00e9dd6807c5a992367a31f10e261c372b89e
Gerrit-Change-Number: 3605769
Gerrit-PatchSet: 25
Gerrit-Owner: Simon Hangl <sim...@google.com>
Gerrit-Reviewer: Elad Alon <elad...@chromium.org>
Gerrit-Reviewer: Simon Hangl <sim...@google.com>
Gerrit-CC: Ehsan Karamad <ekar...@chromium.org>
Gerrit-CC: Enterprise Policy Reviews <enterprise-p...@google.com>
Gerrit-CC: James Maclean <wjma...@chromium.org>
Gerrit-CC: Kevin McNee <mc...@chromium.org>
Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
Gerrit-Attention: Elad Alon <elad...@chromium.org>
Gerrit-Comment-Date: Tue, 14 Jun 2022 11:44:01 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Elad Alon <elad...@chromium.org>
Gerrit-MessageType: comment

Elad Alon (Gerrit)

unread,
Jun 15, 2022, 7:36:12 AM6/15/22
to Simon Hangl, alexmo...@chromium.org, android-web...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, carlos...@chromium.org, chfreme...@chromium.org, chili...@chromium.org, chrome-gr...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, cricke...@chromium.org, dewitt...@chromium.org, dimich...@chromium.org, droger+w...@chromium.org, extension...@chromium.org, feature-me...@chromium.org, feature-v...@chromium.org, fgorsk...@chromium.org, fuchsia...@chromium.org, halliwe...@chromium.org, ipc-securi...@chromium.org, jasonrobe...@google.com, jophba...@chromium.org, kinuko...@chromium.org, lcwu+...@chromium.org, mfoltz...@chromium.org, navigation...@chromium.org, performance-m...@chromium.org, petewi...@chromium.org, phoglun...@chromium.org, poscia...@chromium.org, tommyw+w...@chromium.org, Tricium, Chromium LUCI CQ, chromium...@chromium.org, Ehsan Karamad, Enterprise Policy Reviews, Kevin McNee, Rijubrata Bhaumik, Sadrul Chowdhury, James Maclean

Attention is currently required from: Simon Hangl.

View Change

13 comments:

  • File content/browser/renderer_host/media/media_stream_dispatcher_host.h:

    • Patch Set #28, Line 172:

        // Sets a fake origin url for the select all screens check.
      void UseFakeOriginUrlForTesting(const GURL& fake_origin_url);

      Can we remove this and `fake_origin_url_for_testing_`? We don't have to use a unit test to check this if it requires too much test-code in prod-code. We can use a browser test instead, and then we won't need to fake. Does that make sense, or am I overlooking something?

  • File content/browser/renderer_host/media/media_stream_dispatcher_host.cc:

    • Patch Set #28, Line 385: const ProcessLock process_lock

      Could you please explain why this is necessary? I've not seen this used before. Is it the new recommended way for obtaining origins?

      See here for example:
      https://source.chromium.org/chromium/chromium/src/+/main:content/browser/media/media_devices_util.cc;l=159-162;drc=c673ac8876330a42eed34e298ff585636af113bc

    • Patch Set #28, Line 446:

          return;
      }

      It would be nice to make a single hop to the UI thread.
      Wdyt of this?

      ```
      return;
      }

      base::PostTask(GetUIThreadTaskRunner({}).get(), FROM_HERE,
      base::BindOnce(&GenerateStreamsChecksOnUIthread...);
      } // <-- Finish GenerateStreams.
      void MediaStreamDispatcherHost::GenerateStreamsChecksOnUIthread(...) {
      DCHECK_CURRENTLY_ON(BrowserThread::UI);
      // 1. Validate all-screens and early-exit if necessary.
      // 2. Run salt_and_origin_callback_ synchronously.
      // 3. Post result to DoGenerateStreams on the UI thread.
      }
      void MediaStreamDispatcherHost::DoGenerateStreams(
      int32_t page_request_id,
      const blink::StreamControls& controls,
      bool user_gesture,
      blink::mojom::StreamSelectionInfoPtr audio_stream_selection_info_ptr,
      GenerateStreamsCallback callback,
      MediaDeviceSaltAndOrigin salt_and_origin) {
      DCHECK_CURRENTLY_ON(BrowserThread::IO);
      ```
  • File content/browser/renderer_host/media/media_stream_manager.h:

  • File content/browser/renderer_host/media/media_stream_manager.cc:

    •       MediaDeviceSaltAndOrigin{/*device_id_salt=*/std::string(),
      /*group_id_salt=*/std::string(), security_origin,
      /*has_focus=*/true, /*is_background=*/false});

  • File content/browser/renderer_host/media/media_stream_manager.cc:

    • Patch Set #28, Line 786: IsSelectAllScreens

      nit: Move next to `IsGetDisplayMediaSet()`. (Or maybe just drop it altogether? It's public, right? I don't think the getter adds value...?)

    • Patch Set #28, Line 1124:

            MediaDeviceSaltAndOrigin(/*device_id_salt=*/std::string(),
      /*group_id_salt=*/std::string(),
      /*origin=*/security_origin,
      /*has_focus=*/true,
      /*is_background=*/false));

      This is great, but does it really need to be part of this CL? If you're not really changing anything, or compelled to do this because of a change I am overlooking, then please do this in a separate CL. (Or not at all if you're too busy.)

    • Patch Set #28, Line 1535: /*user gesture=*/false

      Similarly.

    • Patch Set #28, Line 2021:

    •     // If forced screen selection is requested, there is no need to post the

    •     // request to the UI as all screens are automatically selected and no user
      // input is required.

      Potentially misleading because Ash still enumerates on the UI thread. Consider just dropping the comment.

    • Patch Set #28, Line 2042: PERMISSION_DENIED

      Maybe INVALID_STATE? I think this would happen if the request is cancelled while the other task is in flight?

    • Patch Set #28, Line 2046: blink::mojom::StreamDevicesSet stream_devices_set;

      Would it make sense for EnumerateScreens() to return this set instead of the list of IDs? Other than the `video_type`, it does not look like MSM is contributing anything here, does it?

      Note that if this advice makes sense, and if you take it, then you might be able to just wrap the piping to HandleAccessRequestResponse in a OnceCallback and not have to worry about adding and naming HandleAttachedVideoScreens.

  • File third_party/blink/public/common/mediastream/media_stream_controls.h:

    • Patch Set #28, Line 57: select_all_screens

      If you s/select_all_screens/request_all_screens, that would put security-minded folk more at ease, and you'll have an easier time. See one line above you for prior art. (I'd *not* add _permission here.) Please also consider consistency if doing this.

To view, visit change 3605769. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I4cc00e9dd6807c5a992367a31f10e261c372b89e
Gerrit-Change-Number: 3605769
Gerrit-PatchSet: 29
Gerrit-Owner: Simon Hangl <sim...@google.com>
Gerrit-Reviewer: Elad Alon <elad...@chromium.org>
Gerrit-Reviewer: Simon Hangl <sim...@google.com>
Gerrit-CC: Ehsan Karamad <ekar...@chromium.org>
Gerrit-CC: Enterprise Policy Reviews <enterprise-p...@google.com>
Gerrit-CC: James Maclean <wjma...@chromium.org>
Gerrit-CC: Kevin McNee <mc...@chromium.org>
Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
Gerrit-Attention: Simon Hangl <sim...@google.com>
Gerrit-Comment-Date: Wed, 15 Jun 2022 11:36:02 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Simon Hangl <sim...@google.com>

Simon Hangl (Gerrit)

unread,
Jun 16, 2022, 3:06:03 PM6/16/22
to alexmo...@chromium.org, android-web...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, carlos...@chromium.org, chfreme...@chromium.org, chili...@chromium.org, chrome-gr...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, cricke...@chromium.org, dewitt...@chromium.org, dimich...@chromium.org, droger+w...@chromium.org, extension...@chromium.org, feature-me...@chromium.org, feature-v...@chromium.org, fgorsk...@chromium.org, fuchsia...@chromium.org, halliwe...@chromium.org, ipc-securi...@chromium.org, jasonrobe...@google.com, jophba...@chromium.org, kinuko...@chromium.org, lcwu+...@chromium.org, mfoltz...@chromium.org, navigation...@chromium.org, performance-m...@chromium.org, petewi...@chromium.org, phoglun...@chromium.org, poscia...@chromium.org, tommyw+w...@chromium.org, Elad Alon, Tricium, Chromium LUCI CQ, chromium...@chromium.org, Ehsan Karamad, Enterprise Policy Reviews, Kevin McNee, Rijubrata Bhaumik, Sadrul Chowdhury, James Maclean

Attention is currently required from: Elad Alon.

View Change

13 comments:

  • Patchset:

  • File content/browser/renderer_host/media/media_stream_dispatcher_host.h:

    • Patch Set #28, Line 172:

        // Sets a fake origin url for the select all screens check.
      void UseFakeOriginUrlForTesting(const GURL& fake_origin_url);

    • Can we remove this and `fake_origin_url_for_testing_`? We don't have to use a unit test to check thi […]

      i can, but then i need to remove the unit test (which i think currently adds some value). a browser test i can only introduce when the whole loop is closed. i suggest:

      • we keep it for now and tag it with a todo.
      • when the loop is closed i replace the unit test with a browser test.
  • File content/browser/renderer_host/media/media_stream_dispatcher_host.cc:

    • Could you please explain why this is necessary? I've not seen this used before. […]

      switcher over to the method you suggested.

    • It would be nice to make a single hop to the UI thread. […]

      i changed it to something very similar:

      • i kept PostTaskAndReply as i received [1] for GenerateStreamsCallback when i tried to move the callback.
      • i return a std::pair<bool, MediaDeviceSaltAndOrigin>. the bool is used to determine if the check was successful.

      [1] Check failed: !connected. ... was destroyed without first either being run or its corresponding binding being closed. It is an error to drop response callbacks which still correspond to an open interface pipe.

  • File content/browser/renderer_host/media/media_stream_manager.h:

    • Patch Set #28, Line 766: base::WeakPtrFactory<MediaStreamManager> weak_factory_{this};

      Undo this. MSM is owned by BrowserLoop. See comments inside of the . […]

      Done

  • File content/browser/renderer_host/media/media_stream_manager.cc:

    • Patch Set #21, Line 1118:

            MediaDeviceSaltAndOrigin{/*device_id_salt=*/std::string(),
      /*group_id_salt=*/std::string(), security_origin,
      /*has_focus=*/true, /*is_background=*/false});

    • It works here: […]

      Done

  • File content/browser/renderer_host/media/media_stream_manager.cc:

    • nit: Move next to `IsGetDisplayMediaSet()`. […]

      Done

    • Patch Set #28, Line 1124:

            MediaDeviceSaltAndOrigin(/*device_id_salt=*/std::string(),
      /*group_id_salt=*/std::string(),
      /*origin=*/security_origin,
      /*has_focus=*/true,
      /*is_background=*/false));

    • This is great, but does it really need to be part of this CL? If you're not really changing anything […]

      Done

    • Done

    • Patch Set #28, Line 2021:

          // If forced screen selection is requested, there is no need to post the
      // request to the UI as all screens are automatically selected and no user
      // input is required.

    • Potentially misleading because Ash still enumerates on the UI thread. […]

      Done

    • Maybe INVALID_STATE? I think this would happen if the request is cancelled while the other task is i […]

      Done

    • Would it make sense for EnumerateScreens() to return this set instead of the list of IDs? Other than […]

      it does make sense. i will revise the base CL and fix this in the next iteration.

  • File third_party/blink/public/common/mediastream/media_stream_controls.h:

    • If you s/select_all_screens/request_all_screens, that would put security-minded folk more at ease, a […]

      Done

To view, visit change 3605769. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I4cc00e9dd6807c5a992367a31f10e261c372b89e
Gerrit-Change-Number: 3605769
Gerrit-PatchSet: 30
Gerrit-Owner: Simon Hangl <sim...@google.com>
Gerrit-Reviewer: Elad Alon <elad...@chromium.org>
Gerrit-Reviewer: Simon Hangl <sim...@google.com>
Gerrit-CC: Ehsan Karamad <ekar...@chromium.org>
Gerrit-CC: Enterprise Policy Reviews <enterprise-p...@google.com>
Gerrit-CC: James Maclean <wjma...@chromium.org>
Gerrit-CC: Kevin McNee <mc...@chromium.org>
Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
Gerrit-Attention: Elad Alon <elad...@chromium.org>
Gerrit-Comment-Date: Thu, 16 Jun 2022 19:05:51 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Elad Alon <elad...@chromium.org>
Comment-In-Reply-To: Simon Hangl <sim...@google.com>
Gerrit-MessageType: comment

Simon Hangl (Gerrit)

unread,
Jun 16, 2022, 3:08:16 PM6/16/22
to alexmo...@chromium.org, android-web...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, carlos...@chromium.org, chfreme...@chromium.org, chili...@chromium.org, chrome-gr...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, cricke...@chromium.org, dewitt...@chromium.org, dimich...@chromium.org, droger+w...@chromium.org, extension...@chromium.org, feature-me...@chromium.org, feature-v...@chromium.org, fgorsk...@chromium.org, fuchsia...@chromium.org, halliwe...@chromium.org, ipc-securi...@chromium.org, jasonrobe...@google.com, jophba...@chromium.org, kinuko...@chromium.org, lcwu+...@chromium.org, mfoltz...@chromium.org, navigation...@chromium.org, performance-m...@chromium.org, petewi...@chromium.org, phoglun...@chromium.org, poscia...@chromium.org, tommyw+w...@chromium.org, Elad Alon, Tricium, Chromium LUCI CQ, chromium...@chromium.org, Ehsan Karamad, Enterprise Policy Reviews, Kevin McNee, Rijubrata Bhaumik, Sadrul Chowdhury, James Maclean

Attention is currently required from: Elad Alon.

View Change

2 comments:

  • File content/browser/renderer_host/media/media_stream_manager.h:

    • Patch Set #28, Line 561: // Handles all attached screens.

      This comment is unclear. […]

      this will go away in the next iteration.

  • File content/browser/renderer_host/media/media_stream_manager.cc:

    •     const ProcessLock process_lock = render_process_host->GetProcessLock();
      origin = process_lock.lock_url();

    • Note to self: Scrutinize this part in following iterations of the review. […]

      ProcessLock is gone now.

To view, visit change 3605769. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I4cc00e9dd6807c5a992367a31f10e261c372b89e
Gerrit-Change-Number: 3605769
Gerrit-PatchSet: 30
Gerrit-Owner: Simon Hangl <sim...@google.com>
Gerrit-Reviewer: Elad Alon <elad...@chromium.org>
Gerrit-Reviewer: Simon Hangl <sim...@google.com>
Gerrit-CC: Ehsan Karamad <ekar...@chromium.org>
Gerrit-CC: Enterprise Policy Reviews <enterprise-p...@google.com>
Gerrit-CC: James Maclean <wjma...@chromium.org>
Gerrit-CC: Kevin McNee <mc...@chromium.org>
Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
Gerrit-Attention: Elad Alon <elad...@chromium.org>
Gerrit-Comment-Date: Thu, 16 Jun 2022 19:08:03 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Elad Alon <elad...@chromium.org>
Gerrit-MessageType: comment

Simon Hangl (Gerrit)

unread,
Jun 16, 2022, 5:11:19 PM6/16/22
to alexmo...@chromium.org, android-web...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, carlos...@chromium.org, chfreme...@chromium.org, chili...@chromium.org, chrome-gr...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, cricke...@chromium.org, dewitt...@chromium.org, dimich...@chromium.org, droger+w...@chromium.org, extension...@chromium.org, feature-me...@chromium.org, feature-v...@chromium.org, fgorsk...@chromium.org, fuchsia...@chromium.org, halliwe...@chromium.org, ipc-securi...@chromium.org, jasonrobe...@google.com, jophba...@chromium.org, kinuko...@chromium.org, lcwu+...@chromium.org, mfoltz...@chromium.org, navigation...@chromium.org, performance-m...@chromium.org, petewi...@chromium.org, phoglun...@chromium.org, poscia...@chromium.org, tommyw+w...@chromium.org, Elad Alon, Tricium, Chromium LUCI CQ, chromium...@chromium.org, Ehsan Karamad, Enterprise Policy Reviews, Kevin McNee, Rijubrata Bhaumik, Sadrul Chowdhury, James Maclean

Attention is currently required from: Elad Alon.

View Change

1 comment:

  • File content/browser/renderer_host/media/media_stream_manager.h:

    • this will go away in the next iteration.

      gone now.

To view, visit change 3605769. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I4cc00e9dd6807c5a992367a31f10e261c372b89e
Gerrit-Change-Number: 3605769
Gerrit-PatchSet: 31
Gerrit-Owner: Simon Hangl <sim...@google.com>
Gerrit-Reviewer: Elad Alon <elad...@chromium.org>
Gerrit-Reviewer: Simon Hangl <sim...@google.com>
Gerrit-CC: Ehsan Karamad <ekar...@chromium.org>
Gerrit-CC: Enterprise Policy Reviews <enterprise-p...@google.com>
Gerrit-CC: James Maclean <wjma...@chromium.org>
Gerrit-CC: Kevin McNee <mc...@chromium.org>
Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
Gerrit-Attention: Elad Alon <elad...@chromium.org>
Gerrit-Comment-Date: Thu, 16 Jun 2022 21:11:08 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Simon Hangl <sim...@google.com>

Elad Alon (Gerrit)

unread,
Jun 17, 2022, 6:16:37 PM6/17/22
to Simon Hangl, alexmo...@chromium.org, android-web...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, carlos...@chromium.org, chfreme...@chromium.org, chili...@chromium.org, chrome-gr...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, cricke...@chromium.org, dewitt...@chromium.org, dimich...@chromium.org, droger+w...@chromium.org, extension...@chromium.org, feature-me...@chromium.org, feature-v...@chromium.org, fgorsk...@chromium.org, fuchsia...@chromium.org, halliwe...@chromium.org, ipc-securi...@chromium.org, jasonrobe...@google.com, jophba...@chromium.org, kinuko...@chromium.org, lcwu+...@chromium.org, mfoltz...@chromium.org, navigation...@chromium.org, performance-m...@chromium.org, petewi...@chromium.org, phoglun...@chromium.org, poscia...@chromium.org, tommyw+w...@chromium.org, Tricium, Chromium LUCI CQ, chromium...@chromium.org, Ehsan Karamad, Enterprise Policy Reviews, Kevin McNee, Rijubrata Bhaumik, Sadrul Chowdhury, James Maclean

Attention is currently required from: Simon Hangl.

View Change

23 comments:

  • File content/browser/renderer_host/media/media_stream_dispatcher_host.h:

  • File content/browser/renderer_host/media/media_stream_dispatcher_host.h:

    • Patch Set #28, Line 172:

        // Sets a fake origin url for the select all screens check.
      void UseFakeOriginUrlForTesting(const GURL& fake_origin_url);

    • i can, but then i need to remove the unit test (which i think currently adds some value). […]

      I am worried about adding complexity in production code that runs for all video-conferencing calls, to support unit tests for a feature that has not yet been completed, and letting it land while a lot of the people are on summer vacation. But please see my other comments about ideas for minimizing risks.

  • File content/browser/renderer_host/media/media_stream_dispatcher_host.cc:

  • File content/browser/renderer_host/media/media_stream_manager.cc:

    • Patch Set #21, Line 2022:

          const ProcessLock process_lock = render_process_host->GetProcessLock();
      origin = process_lock.lock_url();

    • ProcessLock is gone now.

      Ack

  • File content/browser/renderer_host/media/media_stream_manager.cc:

    • Patch Set #31, Line 1946: nullptr

      /*param=*/

    • Patch Set #31, Line 2013: /*screen_enumerator=*/nullptr

      nit: `screen_enumerator.get()` also works. Your choice, but note that comments are less authoritative than code. (For example, if `A*` is changed to `B*` in the signature, `nullptr` would still be accepted with an outdated comment, but the `.get()` version would not.)

    • Patch Set #31, Line 2013: media::AudioParameters()

      media::AudioParameters() - see similar question below.

    • Patch Set #31, Line 2020:

          // Using base::Unretained is safe since MediaStreamManager is deleted on
      // the UI thread, after the IO thread has been stopped.

      I find this one more compelling:
      // It is safe to bind base::Unretained(this) because MediaStreamManager is
      // owned by BrowserMainLoop.
    • Patch Set #31, Line 2022: screen_enumerator

      This looks very scary: `x->Func(..., std::move(x))`

    • Patch Set #31, Line 2025: media::AudioParameters()

      Is this code correct? Always empty audio parameters? Don't you want to go through `ReadOutputParamsAndPostRequestToUI` here too?

  • File third_party/blink/renderer/modules/mediastream/user_media_processor.cc:

    • Patch Set #31, Line 847: request_all_screens

      Please note that you've renamed to request_ in some places, but kept auto_select_ in others. Do you plan to clean this up later? Or do you want to maintain this discrepancy? (I don't recommend the latter.)

To view, visit change 3605769. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I4cc00e9dd6807c5a992367a31f10e261c372b89e
Gerrit-Change-Number: 3605769
Gerrit-PatchSet: 32
Gerrit-Owner: Simon Hangl <sim...@google.com>
Gerrit-Reviewer: Elad Alon <elad...@chromium.org>
Gerrit-Reviewer: Simon Hangl <sim...@google.com>
Gerrit-CC: Ehsan Karamad <ekar...@chromium.org>
Gerrit-CC: Enterprise Policy Reviews <enterprise-p...@google.com>
Gerrit-CC: James Maclean <wjma...@chromium.org>
Gerrit-CC: Kevin McNee <mc...@chromium.org>
Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
Gerrit-Attention: Simon Hangl <sim...@google.com>
Gerrit-Comment-Date: Fri, 17 Jun 2022 22:16:23 +0000

Simon Hangl (Gerrit)

unread,
Jun 18, 2022, 6:29:09 PM6/18/22
to alexmo...@chromium.org, android-web...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, carlos...@chromium.org, chfreme...@chromium.org, chili...@chromium.org, chrome-gr...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, cricke...@chromium.org, dewitt...@chromium.org, dimich...@chromium.org, droger+w...@chromium.org, extension...@chromium.org, feature-me...@chromium.org, feature-v...@chromium.org, fgorsk...@chromium.org, fuchsia...@chromium.org, halliwe...@chromium.org, ipc-securi...@chromium.org, jasonrobe...@google.com, jophba...@chromium.org, kinuko...@chromium.org, lcwu+...@chromium.org, mfoltz...@chromium.org, navigation...@chromium.org, performance-m...@chromium.org, petewi...@chromium.org, phoglun...@chromium.org, poscia...@chromium.org, tommyw+w...@chromium.org

Attention is currently required from: Simon Hangl.

Simon Hangl uploaded patch set #35 to this change.

View Change

[MSC] Screen auto selection for getDisplayMediaSet.

This change enables auto selection for getDisplayMediaSet.
It propagates the autoSelectAllScreens property through the
call stack, loads a list of all attached screens and forwards
it for capturing.

Bug: 1300883

Change-Id: I4cc00e9dd6807c5a992367a31f10e261c372b89e
---
M chrome/browser/chrome_content_browser_client.cc
M chrome/browser/chrome_content_browser_client.h
M content/browser/bad_message.h
M content/browser/renderer_host/media/media_stream_dispatcher_host.cc
M content/browser/renderer_host/media/media_stream_dispatcher_host.h
M content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc
M content/browser/renderer_host/media/media_stream_manager.cc
M content/browser/renderer_host/media/media_stream_manager.h
M content/public/browser/content_browser_client.cc
M content/public/browser/content_browser_client.h

M third_party/blink/common/mediastream/media_stream_mojom_traits.cc
M third_party/blink/public/common/mediastream/media_stream_controls.h
M third_party/blink/public/common/mediastream/media_stream_mojom_traits.h
M third_party/blink/public/mojom/mediastream/media_stream.mojom
M third_party/blink/renderer/modules/mediastream/user_media_processor.cc
M third_party/blink/renderer/modules/mediastream/user_media_request.cc
M third_party/blink/renderer/modules/mediastream/user_media_request.h
M tools/metrics/histograms/enums.xml
18 files changed, 320 insertions(+), 35 deletions(-)

To view, visit change 3605769. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I4cc00e9dd6807c5a992367a31f10e261c372b89e
Gerrit-Change-Number: 3605769
Gerrit-PatchSet: 35
Gerrit-Owner: Simon Hangl <sim...@google.com>
Gerrit-Reviewer: Elad Alon <elad...@chromium.org>
Gerrit-Reviewer: Simon Hangl <sim...@google.com>
Gerrit-CC: Ehsan Karamad <ekar...@chromium.org>
Gerrit-CC: Enterprise Policy Reviews <enterprise-p...@google.com>
Gerrit-CC: James Maclean <wjma...@chromium.org>
Gerrit-CC: Kevin McNee <mc...@chromium.org>
Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
Gerrit-Attention: Simon Hangl <sim...@google.com>
Gerrit-MessageType: newpatchset

Simon Hangl (Gerrit)

unread,
Jun 19, 2022, 2:18:17 AM6/19/22
to alexmo...@chromium.org, android-web...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, carlos...@chromium.org, chfreme...@chromium.org, chili...@chromium.org, chrome-gr...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, cricke...@chromium.org, dewitt...@chromium.org, dimich...@chromium.org, droger+w...@chromium.org, extension...@chromium.org, feature-me...@chromium.org, feature-v...@chromium.org, fgorsk...@chromium.org, fuchsia...@chromium.org, halliwe...@chromium.org, ipc-securi...@chromium.org, jasonrobe...@google.com, jophba...@chromium.org, kinuko...@chromium.org, lcwu+...@chromium.org, mfoltz...@chromium.org, navigation...@chromium.org, performance-m...@chromium.org, petewi...@chromium.org, phoglun...@chromium.org, poscia...@chromium.org, tommyw+w...@chromium.org, Elad Alon, Tricium, Chromium LUCI CQ, chromium...@chromium.org, Ehsan Karamad, Enterprise Policy Reviews, Kevin McNee, Rijubrata Bhaumik, Sadrul Chowdhury, James Maclean

Attention is currently required from: Elad Alon.

View Change

25 comments:

    • eladalon@: i revised the CL. PTAL.

  • File content/browser/renderer_host/media/media_stream_dispatcher_host.h:

    • I think you meant "e.g." rather than "i.e." here. […]

      actually i meant "i.e." == "that is", as the test is the only check that is performed. though i omitted the salt computation.

  • File content/browser/renderer_host/media/media_stream_dispatcher_host.h:

    • Patch Set #28, Line 172:

        // Sets a fake origin url for the select all screens check.
      void UseFakeOriginUrlForTesting(const GURL& fake_origin_url);

    • I am worried about adding complexity in production code that runs for all video-conferencing calls, […]

      test is removed now.

  • File content/browser/renderer_host/media/media_stream_dispatcher_host.cc:

    • Done

    • Done

    • A helper function that only checks the state related to this, would reduce indentation and simplify […]

      Done

    • Patch Set #31, Line 339: content::BrowserContext* browser_context = nullptr;

      You could declare this in a tighter context.

    • i revised the whole block.

    • It does not look like you actually read `url` if you enter this branch. […]

      url is passed in `browser_client->IsGetDisplayMediaSetSelectAllScreensAllowed`, but i removed the fake url now anyways.

    • Do you need both RPH and RFHI? […]

      Done

    • Do you need to go through the tree? Isn't this good enough? […]

      Done

    • Patch Set #31, Line 357: GetURL()

      Should the policy really be by URL? Not by origin? Is this an intentional part of the design?

    • Once you use a struct, can you use `{.a = false, . […]

      Done

    • no, i cannot bind the callback with a WeakPtr as the sequence checker would complain then.

    • Patch Set #31, Line 458:


      if (!ui_check_result.first) {
      ReceivedBadMessage(
      render_process_id_,
      bad_message::MSDH_REQUEST_ALL_SCREENS_NOT_ALLOWED_FOR_ORIGIN);
      return;
      }

    • Do we have a browser test that proves that this is not hit, by checking that this request is blocked […]

      no, unless i am missing something, i cannot write a browser test until the basic functionality is landed for getDisplayMediaSet (as i will not be able to enter this path before). i created a bug and added a todo.

    • It's odd that you std::move away from a const-ref. Specifically, the const part. […]

      indeed. it did compile, yes. replaced with your suggestion.

  • File content/browser/renderer_host/media/media_stream_manager.cc:

    • yes, in my (unit) tests the renderer_process_host was null.

    • removed.

  • File content/browser/renderer_host/media/media_stream_manager.cc:

    • Patch Set #28, Line 2046: blink::mojom::StreamDevicesSet stream_devices_set;

      it does make sense. i will revise the base CL and fix this in the next iteration.

      Done

  • File content/browser/renderer_host/media/media_stream_manager.cc:

    • see answer to question below.

    • Patch Set #31, Line 2020:

          // Using base::Unretained is safe since MediaStreamManager is deleted on
      // the UI thread, after the IO thread has been stopped.

    • I find this one more compelling: […]

      Done

    • This looks very scary: `x->Func(... […]

      true. the idea was to keep the screen_enumerator alive. but i can achieve the same by holding the ScreenEnumerator as a member function and lazy loading it on the first time needed. the move is gone now.

    • Is this code correct? Always empty audio parameters? Don't you want to go through `ReadOutputParamsA […]

      audio is not supported with multi screen capture (explicitly outscoped).

  • File third_party/blink/renderer/modules/mediastream/user_media_processor.cc:

    • Please note that you've renamed to request_ in some places, but kept auto_select_ in others. […]

      i kept it for api exposed interfaces as this was the name decided in the design doc and there is already a policy delivered that refers to auto_select_all_screens. i guess then it's best to roll it all back to auto_select_all_screens?

To view, visit change 3605769. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I4cc00e9dd6807c5a992367a31f10e261c372b89e
Gerrit-Change-Number: 3605769
Gerrit-PatchSet: 37
Gerrit-Owner: Simon Hangl <sim...@google.com>
Gerrit-Reviewer: Elad Alon <elad...@chromium.org>
Gerrit-Reviewer: Simon Hangl <sim...@google.com>
Gerrit-CC: Ehsan Karamad <ekar...@chromium.org>
Gerrit-CC: Enterprise Policy Reviews <enterprise-p...@google.com>
Gerrit-CC: James Maclean <wjma...@chromium.org>
Gerrit-CC: Kevin McNee <mc...@chromium.org>
Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
Gerrit-Attention: Elad Alon <elad...@chromium.org>
Gerrit-Comment-Date: Sun, 19 Jun 2022 06:18:06 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No

Elad Alon (Gerrit)

unread,
Jun 20, 2022, 7:57:16 AM6/20/22
to Simon Hangl, alexmo...@chromium.org, android-web...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, carlos...@chromium.org, chfreme...@chromium.org, chili...@chromium.org, chrome-gr...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, cricke...@chromium.org, dewitt...@chromium.org, dimich...@chromium.org, droger+w...@chromium.org, extension...@chromium.org, feature-me...@chromium.org, feature-v...@chromium.org, fgorsk...@chromium.org, fuchsia...@chromium.org, halliwe...@chromium.org, ipc-securi...@chromium.org, jasonrobe...@google.com, jophba...@chromium.org, kinuko...@chromium.org, lcwu+...@chromium.org, mfoltz...@chromium.org, navigation...@chromium.org, performance-m...@chromium.org, petewi...@chromium.org, phoglun...@chromium.org, poscia...@chromium.org, tommyw+w...@chromium.org, Tricium, Chromium LUCI CQ, chromium...@chromium.org, Ehsan Karamad, Enterprise Policy Reviews, Kevin McNee, Rijubrata Bhaumik, Sadrul Chowdhury, James Maclean

Attention is currently required from: Simon Hangl.

View Change

13 comments:

  • File content/browser/renderer_host/media/media_stream_dispatcher_host.h:

    • Patch Set #38, Line 65:

        FRIEND_TEST_ALL_PREFIXES(MediaStreamDispatcherHostTest,
      SelectAllScreensPolicyAllowed);
      FRIEND_TEST_ALL_PREFIXES(MediaStreamDispatcherHostTest,
      SelectAllScreensPolicyForbidden);

      I couldn't find these in this CL.

    • Patch Set #38, Line 71:

          GenerateStreamsUIThreadCheckResult() = default;
      bool request_allowed;

      IIANM the default ctor leaves `request_allowed` unassigned - so a garbage value. That'd be a bug. Please do this:
      ```
      bool request_allowed = false;
      ```
    • Patch Set #38, Line 145: GenerateStreamsUIThreadCheckResult

      Would making this const-ref help avoid a copy? It contains strings and origins, and these can be sizeable.

  • File content/browser/renderer_host/media/media_stream_dispatcher_host.cc:


    • if (!ui_check_result.first) {
      ReceivedBadMessage(
      render_process_id_,
      bad_message::MSDH_REQUEST_ALL_SCREENS_NOT_ALLOWED_FOR_ORIGIN);
      return;
      }

    • no, unless i am missing something, i cannot write a browser test until the basic functionality is la […]

      Ack

  • File content/browser/renderer_host/media/media_stream_dispatcher_host.cc:

    •   RenderProcessHost* render_process_host =
      RenderProcessHost::FromID(render_process_id);

    •   if (!render_process_host)
      return false;

      rm

    • Patch Set #38, Line 333: render_frame_host

      Check this for nullness.

    • Patch Set #38, Line 335:

        GURL url =
      render_frame_host->GetMainFrame()->GetLastCommittedOrigin().GetURL();
      content::BrowserContext* browser_context =
      render_frame_host->GetBrowserContext(

      I'd have inlined these two, but it's up to you.

  • File content/browser/renderer_host/media/media_stream_manager.h:

    • Patch Set #38, Line 759: = nullptr

      This is not necessary because unique_ptr's default ctor takes care of this. (Unlike raw pointers.)

  • File content/browser/renderer_host/media/media_stream_manager.cc:

    • audio is not supported with multi screen capture (explicitly outscoped).

    • Ack

  • File content/browser/renderer_host/media/media_stream_manager.cc:

    • Patch Set #38, Line 2008:

          if (!screen_enumerator_) {
      screen_enumerator_ =

      This raises a question - should it really be a member? Do we want to keep a screen enumerator alive for the runtime of the browser? Isn't it enough to only construct and use one when necessary?

    • Patch Set #38, Line 2022:

          screen_enumerator_->EnumerateScreens(
      request->video_type(),
      base::BindOnce(&MediaStreamManager::HandleAccessRequestResponse,
      base::Unretained(this), label,
      media::AudioParameters()));
      } else {
      ReadOutputParamsAndPostRequestToUI(label, request,
      MediaDeviceEnumeration());

      ```
      screen_enumerator_->EnumerateScreens(
      request->video_type(),
      base::BindOnce(&MediaStreamManager::HandleAccessRequestResponse,
      base::Unretained(this), label,
      media::AudioParameters()));
      return;
      }
        ReadOutputParamsAndPostRequestToUI(label, request, MediaDeviceEnumeration());
      }
      ```
  • File third_party/blink/renderer/modules/mediastream/user_media_processor.cc:

    • i kept it for api exposed interfaces as this was the name decided in the design doc and there is alr […]

      Okay, let's file an issue for clean-up and make the decision then.

To view, visit change 3605769. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I4cc00e9dd6807c5a992367a31f10e261c372b89e
Gerrit-Change-Number: 3605769
Gerrit-PatchSet: 38
Gerrit-Owner: Simon Hangl <sim...@google.com>
Gerrit-Reviewer: Elad Alon <elad...@chromium.org>
Gerrit-Reviewer: Simon Hangl <sim...@google.com>
Gerrit-CC: Ehsan Karamad <ekar...@chromium.org>
Gerrit-CC: Enterprise Policy Reviews <enterprise-p...@google.com>
Gerrit-CC: James Maclean <wjma...@chromium.org>
Gerrit-CC: Kevin McNee <mc...@chromium.org>
Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
Gerrit-Attention: Simon Hangl <sim...@google.com>
Gerrit-Comment-Date: Mon, 20 Jun 2022 11:57:07 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No

Simon Hangl (Gerrit)

unread,
Jun 20, 2022, 9:51:04 AM6/20/22
to alexmo...@chromium.org, android-web...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, carlos...@chromium.org, chfreme...@chromium.org, chili...@chromium.org, chrome-gr...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, cricke...@chromium.org, dewitt...@chromium.org, dimich...@chromium.org, droger+w...@chromium.org, extension...@chromium.org, feature-me...@chromium.org, feature-v...@chromium.org, fgorsk...@chromium.org, fuchsia...@chromium.org, halliwe...@chromium.org, ipc-securi...@chromium.org, jasonrobe...@google.com, jophba...@chromium.org, kinuko...@chromium.org, lcwu+...@chromium.org, mfoltz...@chromium.org, navigation...@chromium.org, performance-m...@chromium.org, petewi...@chromium.org, phoglun...@chromium.org, poscia...@chromium.org, tommyw+w...@chromium.org, Elad Alon, Tricium, Chromium LUCI CQ, chromium...@chromium.org, Ehsan Karamad, Enterprise Policy Reviews, Kevin McNee, Rijubrata Bhaumik, Sadrul Chowdhury, James Maclean

Attention is currently required from: Elad Alon.

View Change

11 comments:

    • eladalon@: i revised the cl. PTAL.

  • File content/browser/renderer_host/media/media_stream_dispatcher_host.h:

    • Patch Set #38, Line 65:

        FRIEND_TEST_ALL_PREFIXES(MediaStreamDispatcherHostTest,
      SelectAllScreensPolicyAllowed);
      FRIEND_TEST_ALL_PREFIXES(MediaStreamDispatcherHostTest,
      SelectAllScreensPolicyForbidden);

      I couldn't find these in this CL.

    • Done

    • IIANM the default ctor leaves `request_allowed` unassigned - so a garbage value. That'd be a bug. […]

      Done

    • Would making this const-ref help avoid a copy? It contains strings and origins, and these can be siz […]

      no, as it would clash with the subsequent
      ```
      MediaDeviceSaltAndOrigin salt_and_origin =
      std::move(ui_check_result.salt_and_origin);
      ui_check_result = {};
      ```
      and
      ```
      media_stream_manager_->GenerateStreams(
      render_process_id_, render_frame_id_, requester_id_, page_request_id,
      controls, std::move(salt_and_origin),
      ```

      i also checked how the initial implementation solved this problem [1], but there it was a copy as well.
      [1] https://source.chromium.org/chromium/chromium/src/+/main:content/browser/renderer_host/media/media_stream_dispatcher_host.cc;l=402

  • File content/browser/renderer_host/media/media_stream_dispatcher_host.cc:

    • Done

    • Patch Set #38, Line 329:

        RenderProcessHost* render_process_host =
      RenderProcessHost::FromID(render_process_id);
      if (!render_process_host)
      return false;

      rm

    • Done

    • Done

    • Patch Set #38, Line 335:

        GURL url =
      render_frame_host->GetMainFrame()->GetLastCommittedOrigin().GetURL();
      content::BrowserContext* browser_context =
      render_frame_host->GetBrowserContext(

      I'd have inlined these two, but it's up to you.

    • Done

  • File content/browser/renderer_host/media/media_stream_manager.h:

    • This is not necessary because unique_ptr's default ctor takes care of this. (Unlike raw pointers. […]

      Done

  • File content/browser/renderer_host/media/media_stream_manager.cc:

    • This raises a question - should it really be a member? Do we want to keep a screen enumerator alive […]

      see question in chat:
      " so initially i had the screen enumerator moved over to the callback so that it is guaranteed to be alive, but you (rightfully so) pointed out that this is pretty scary [1]. the only alternative i see is to keep it as a member of MediaStreamManager. is there any other alternative?

      [1] https://chromium-review.googlesource.com/c/chromium/src/+/3605769/comments/fbf5280e_9e685c5c"

    • Patch Set #38, Line 2022:

          screen_enumerator_->EnumerateScreens(
      request->video_type(),
      base::BindOnce(&MediaStreamManager::HandleAccessRequestResponse,
      base::Unretained(this), label,
      media::AudioParameters()));
      } else {
      ReadOutputParamsAndPostRequestToUI(label, request,
      MediaDeviceEnumeration());

    • ``` […]

      Done

To view, visit change 3605769. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I4cc00e9dd6807c5a992367a31f10e261c372b89e
Gerrit-Change-Number: 3605769
Gerrit-PatchSet: 39
Gerrit-Owner: Simon Hangl <sim...@google.com>
Gerrit-Reviewer: Elad Alon <elad...@chromium.org>
Gerrit-Reviewer: Simon Hangl <sim...@google.com>
Gerrit-CC: Ehsan Karamad <ekar...@chromium.org>
Gerrit-CC: Enterprise Policy Reviews <enterprise-p...@google.com>
Gerrit-CC: James Maclean <wjma...@chromium.org>
Gerrit-CC: Kevin McNee <mc...@chromium.org>
Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
Gerrit-Attention: Elad Alon <elad...@chromium.org>
Gerrit-Comment-Date: Mon, 20 Jun 2022 13:50:49 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No

Elad Alon (Gerrit)

unread,
Jun 20, 2022, 3:40:54 PM6/20/22
to Simon Hangl, alexmo...@chromium.org, android-web...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, carlos...@chromium.org, chfreme...@chromium.org, chili...@chromium.org, chrome-gr...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, cricke...@chromium.org, dewitt...@chromium.org, dimich...@chromium.org, droger+w...@chromium.org, extension...@chromium.org, feature-me...@chromium.org, feature-v...@chromium.org, fgorsk...@chromium.org, fuchsia...@chromium.org, halliwe...@chromium.org, ipc-securi...@chromium.org, jasonrobe...@google.com, jophba...@chromium.org, kinuko...@chromium.org, lcwu+...@chromium.org, mfoltz...@chromium.org, navigation...@chromium.org, performance-m...@chromium.org, petewi...@chromium.org, phoglun...@chromium.org, poscia...@chromium.org, tommyw+w...@chromium.org, Tricium, Chromium LUCI CQ, chromium...@chromium.org, Ehsan Karamad, Enterprise Policy Reviews, Kevin McNee, Rijubrata Bhaumik, Sadrul Chowdhury, James Maclean

Attention is currently required from: Simon Hangl.

View Change

1 comment:

  • File content/browser/renderer_host/media/media_stream_manager.cc:

    • see question in chat: […]

      Would this work?
      ```
      std::unique_ptr<media::ScreenEnumerator> enumerator =
      GetContentClient()->browser()->CreateScreenEnumerator();
      ...
      enumerator->EnumeratreScreens(...);
      ```
      Even if the enumerator posts a task, so long as the task does not need to respond directly to the enumerator, we can safely destroy it, right? IIANM, you'd have even made it static, if not for your need to expose it as an overridden virtual method? So the actual object is not truly necessary. Or am I wrong?

To view, visit change 3605769. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I4cc00e9dd6807c5a992367a31f10e261c372b89e
Gerrit-Change-Number: 3605769
Gerrit-PatchSet: 39
Gerrit-Owner: Simon Hangl <sim...@google.com>
Gerrit-Reviewer: Elad Alon <elad...@chromium.org>
Gerrit-Reviewer: Simon Hangl <sim...@google.com>
Gerrit-CC: Ehsan Karamad <ekar...@chromium.org>
Gerrit-CC: Enterprise Policy Reviews <enterprise-p...@google.com>
Gerrit-CC: James Maclean <wjma...@chromium.org>
Gerrit-CC: Kevin McNee <mc...@chromium.org>
Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
Gerrit-Attention: Simon Hangl <sim...@google.com>
Gerrit-Comment-Date: Mon, 20 Jun 2022 19:40:41 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Simon Hangl <sim...@google.com>

Simon Hangl (Gerrit)

unread,
Jun 21, 2022, 5:00:34 AM6/21/22
to alexmo...@chromium.org, android-web...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, carlos...@chromium.org, chfreme...@chromium.org, chili...@chromium.org, chrome-gr...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, cricke...@chromium.org, dewitt...@chromium.org, dimich...@chromium.org, droger+w...@chromium.org, extension...@chromium.org, feature-me...@chromium.org, feature-v...@chromium.org, fgorsk...@chromium.org, fuchsia...@chromium.org, halliwe...@chromium.org, ipc-securi...@chromium.org, jasonrobe...@google.com, jophba...@chromium.org, kinuko...@chromium.org, lcwu+...@chromium.org, mfoltz...@chromium.org, navigation...@chromium.org, performance-m...@chromium.org, petewi...@chromium.org, phoglun...@chromium.org, poscia...@chromium.org, tommyw+w...@chromium.org, Elad Alon, Tricium, Chromium LUCI CQ, chromium...@chromium.org, Ehsan Karamad, Enterprise Policy Reviews, Kevin McNee, Rijubrata Bhaumik, Sadrul Chowdhury, James Maclean

Attention is currently required from: Elad Alon.

View Change

2 comments:

  • Patchset:

  • File content/browser/renderer_host/media/media_stream_manager.cc:

    • Would this work? […]

      hm, you know my code better than i do 👍 . just checked it, you are absolutely right, no need to keep the object alive. the posted task is not a static member function but a regular function.

To view, visit change 3605769. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I4cc00e9dd6807c5a992367a31f10e261c372b89e
Gerrit-Change-Number: 3605769
Gerrit-PatchSet: 42
Gerrit-Owner: Simon Hangl <sim...@google.com>
Gerrit-Reviewer: Elad Alon <elad...@chromium.org>
Gerrit-Reviewer: Simon Hangl <sim...@google.com>
Gerrit-CC: Ehsan Karamad <ekar...@chromium.org>
Gerrit-CC: Enterprise Policy Reviews <enterprise-p...@google.com>
Gerrit-CC: James Maclean <wjma...@chromium.org>
Gerrit-CC: Kevin McNee <mc...@chromium.org>
Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
Gerrit-Attention: Elad Alon <elad...@chromium.org>
Gerrit-Comment-Date: Tue, 21 Jun 2022 09:00:21 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No

Elad Alon (Gerrit)

unread,
Jun 23, 2022, 5:46:46 PM6/23/22
to Simon Hangl, alexmo...@chromium.org, android-web...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, carlos...@chromium.org, chfreme...@chromium.org, chili...@chromium.org, chrome-gr...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, cricke...@chromium.org, dewitt...@chromium.org, dimich...@chromium.org, droger+w...@chromium.org, extension...@chromium.org, feature-me...@chromium.org, feature-v...@chromium.org, fgorsk...@chromium.org, fuchsia...@chromium.org, halliwe...@chromium.org, ipc-securi...@chromium.org, jasonrobe...@google.com, jophba...@chromium.org, kinuko...@chromium.org, lcwu+...@chromium.org, mfoltz...@chromium.org, navigation...@chromium.org, performance-m...@chromium.org, petewi...@chromium.org, phoglun...@chromium.org, poscia...@chromium.org, tommyw+w...@chromium.org, Tricium, Chromium LUCI CQ, chromium...@chromium.org, Ehsan Karamad, Enterprise Policy Reviews, Kevin McNee, Rijubrata Bhaumik, Sadrul Chowdhury, James Maclean

Attention is currently required from: Simon Hangl.

Patch set 42:Code-Review +1

View Change

5 comments:

  • File content/browser/renderer_host/media/media_stream_dispatcher_host.h:

    • Patch Set #42, Line 67: GenerateStreamsUIThreadCheckResult() = default;

      Is this line strictly required?

    • Patch Set #42, Line 85:

            int render_process_id,
      int render_frame_id,

      It's more idiomatic in this codebase to pass these two ints first.

  • File content/browser/renderer_host/media/media_stream_manager.cc:

    • hm, you know my code better than i do 👍 . […]

      Ack

  • File content/browser/renderer_host/media/media_stream_manager.cc:

    • Patch Set #42, Line 2013: PERMISSION_DENIED

      `NOT_SUPPORTED` seems more appropriate given the current implementations of CreateScreenEnumerator, where there's one impl that always returns nullptr and one that never returns nullptr. Or wdyt?

  • File content/public/browser/content_browser_client.h:

    • Patch Set #42, Line 637: Screen auto selection allows

      // Check if applications whose URL is |url| are allowed to perform all-screens-auto-selection, which...

To view, visit change 3605769. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I4cc00e9dd6807c5a992367a31f10e261c372b89e
Gerrit-Change-Number: 3605769
Gerrit-PatchSet: 42
Gerrit-Owner: Simon Hangl <sim...@google.com>
Gerrit-Reviewer: Elad Alon <elad...@chromium.org>
Gerrit-Reviewer: Simon Hangl <sim...@google.com>
Gerrit-CC: Ehsan Karamad <ekar...@chromium.org>
Gerrit-CC: Enterprise Policy Reviews <enterprise-p...@google.com>
Gerrit-CC: James Maclean <wjma...@chromium.org>
Gerrit-CC: Kevin McNee <mc...@chromium.org>
Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
Gerrit-Attention: Simon Hangl <sim...@google.com>
Gerrit-Comment-Date: Thu, 23 Jun 2022 21:46:28 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes

Simon Hangl (Gerrit)

unread,
Jun 24, 2022, 4:33:37 AM6/24/22
to Avi Drissman, Tom Sepez, alexmo...@chromium.org, android-web...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, carlos...@chromium.org, chfreme...@chromium.org, chili...@chromium.org, chrome-gr...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, cricke...@chromium.org, dewitt...@chromium.org, dimich...@chromium.org, droger+w...@chromium.org, extension...@chromium.org, feature-me...@chromium.org, feature-v...@chromium.org, fgorsk...@chromium.org, fuchsia...@chromium.org, halliwe...@chromium.org, ipc-securi...@chromium.org, jasonrobe...@google.com, jophba...@chromium.org, kinuko...@chromium.org, lcwu+...@chromium.org, mfoltz...@chromium.org, navigation...@chromium.org, performance-m...@chromium.org, petewi...@chromium.org, phoglun...@chromium.org, poscia...@chromium.org, tommyw+w...@chromium.org, Elad Alon

Attention is currently required from: Avi Drissman, Tom Sepez.

Simon Hangl would like Avi Drissman and Tom Sepez to review this change.

View Change

[MSC] Screen auto selection for getDisplayMediaSet.

This change enables auto selection for getDisplayMediaSet.
It propagates the autoSelectAllScreens property through the
call stack, loads a list of all attached screens and forwards
it for capturing.

Bug: 1300883

Change-Id: I4cc00e9dd6807c5a992367a31f10e261c372b89e
---
M chrome/browser/chrome_content_browser_client.cc
M chrome/browser/chrome_content_browser_client.h
M content/browser/bad_message.h
M content/browser/renderer_host/media/media_stream_dispatcher_host.cc
M content/browser/renderer_host/media/media_stream_dispatcher_host.h
M content/browser/renderer_host/media/media_stream_manager.cc

M content/public/browser/content_browser_client.cc
M content/public/browser/content_browser_client.h
M third_party/blink/common/mediastream/media_stream_mojom_traits.cc
M third_party/blink/public/common/mediastream/media_stream_controls.h
M third_party/blink/public/common/mediastream/media_stream_mojom_traits.h
M third_party/blink/public/mojom/mediastream/media_stream.mojom
M third_party/blink/renderer/modules/mediastream/user_media_processor.cc
M third_party/blink/renderer/modules/mediastream/user_media_request.cc
M third_party/blink/renderer/modules/mediastream/user_media_request.h
M tools/metrics/histograms/enums.xml
16 files changed, 160 insertions(+), 6 deletions(-)


To view, visit change 3605769. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I4cc00e9dd6807c5a992367a31f10e261c372b89e
Gerrit-Change-Number: 3605769
Gerrit-PatchSet: 42
Gerrit-Owner: Simon Hangl <sim...@google.com>
Gerrit-Reviewer: Avi Drissman <a...@chromium.org>
Gerrit-Reviewer: Elad Alon <elad...@chromium.org>
Gerrit-Reviewer: Simon Hangl <sim...@google.com>
Gerrit-Reviewer: Tom Sepez <tse...@chromium.org>
Gerrit-CC: Ehsan Karamad <ekar...@chromium.org>
Gerrit-CC: Enterprise Policy Reviews <enterprise-p...@google.com>
Gerrit-CC: James Maclean <wjma...@chromium.org>
Gerrit-CC: Kevin McNee <mc...@chromium.org>
Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
Gerrit-Attention: Avi Drissman <a...@chromium.org>
Gerrit-Attention: Tom Sepez <tse...@chromium.org>
Gerrit-MessageType: newchange

Simon Hangl (Gerrit)

unread,
Jun 24, 2022, 4:33:43 AM6/24/22
to alexmo...@chromium.org, android-web...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, carlos...@chromium.org, chfreme...@chromium.org, chili...@chromium.org, chrome-gr...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, cricke...@chromium.org, dewitt...@chromium.org, dimich...@chromium.org, droger+w...@chromium.org, extension...@chromium.org, feature-me...@chromium.org, feature-v...@chromium.org, fgorsk...@chromium.org, fuchsia...@chromium.org, halliwe...@chromium.org, ipc-securi...@chromium.org, jasonrobe...@google.com, jophba...@chromium.org, kinuko...@chromium.org, lcwu+...@chromium.org, mfoltz...@chromium.org, navigation...@chromium.org, performance-m...@chromium.org, petewi...@chromium.org, phoglun...@chromium.org, poscia...@chromium.org, tommyw+w...@chromium.org, Avi Drissman, Tom Sepez, Elad Alon, Tricium, Chromium LUCI CQ, chromium...@chromium.org, Ehsan Karamad, Enterprise Policy Reviews, Kevin McNee, Rijubrata Bhaumik, Sadrul Chowdhury, James Maclean

Attention is currently required from: Avi Drissman, Tom Sepez.

View Change

1 comment:

  • Patchset:

    • Patch Set #42:

      dear reviewers, PTAL at the following files:

      avi@: content/public/browser/content_browser_client.h,
      content/public/browser/content_browser_client.cc, content/browser/bad_message.h
      tsepez@: third_party/blink/public/common/mediastream/media_stream_mojom_traits.h, third_party/blink/common/mediastream/media_stream_mojom_traits.cc, third_party/blink/public/mojom/mediastream/media_stream.mojom

To view, visit change 3605769. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I4cc00e9dd6807c5a992367a31f10e261c372b89e
Gerrit-Change-Number: 3605769
Gerrit-PatchSet: 42
Gerrit-Owner: Simon Hangl <sim...@google.com>
Gerrit-Reviewer: Avi Drissman <a...@chromium.org>
Gerrit-Reviewer: Elad Alon <elad...@chromium.org>
Gerrit-Reviewer: Simon Hangl <sim...@google.com>
Gerrit-Reviewer: Tom Sepez <tse...@chromium.org>
Gerrit-CC: Ehsan Karamad <ekar...@chromium.org>
Gerrit-CC: Enterprise Policy Reviews <enterprise-p...@google.com>
Gerrit-CC: James Maclean <wjma...@chromium.org>
Gerrit-CC: Kevin McNee <mc...@chromium.org>
Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
Gerrit-Attention: Avi Drissman <a...@chromium.org>
Gerrit-Attention: Tom Sepez <tse...@chromium.org>
Gerrit-Comment-Date: Fri, 24 Jun 2022 08:33:34 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment

Simon Hangl (Gerrit)

unread,
Jul 1, 2022, 9:35:14 AM7/1/22
to Alex Gough, Tom Sepez, alexmo...@chromium.org, android-web...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, carlos...@chromium.org, chfreme...@chromium.org, chili...@chromium.org, chrome-gr...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, cricke...@chromium.org, dewitt...@chromium.org, dimich...@chromium.org, droger+w...@chromium.org, extension...@chromium.org, feature-me...@chromium.org, feature-v...@chromium.org, fgorsk...@chromium.org, fuchsia...@chromium.org, halliwe...@chromium.org, ipc-securi...@chromium.org, jasonrobe...@google.com, jophba...@chromium.org, kinuko...@chromium.org, lcwu+...@chromium.org, mfoltz...@chromium.org, navigation...@chromium.org, performance-m...@chromium.org, petewi...@chromium.org, phoglun...@chromium.org, poscia...@chromium.org, tommyw+w...@chromium.org, Avi Drissman, Elad Alon

Attention is currently required from: Alex Gough, Avi Drissman.

Simon Hangl would like Alex Gough to review this change.

Simon Hangl removed Tom Sepez from this change.

To view, visit change 3605769. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I4cc00e9dd6807c5a992367a31f10e261c372b89e
Gerrit-Change-Number: 3605769
Gerrit-PatchSet: 45
Gerrit-Owner: Simon Hangl <sim...@google.com>
Gerrit-Reviewer: Alex Gough <aj...@chromium.org>
Gerrit-Reviewer: Avi Drissman <a...@chromium.org>
Gerrit-Reviewer: Elad Alon <elad...@chromium.org>
Gerrit-Reviewer: Simon Hangl <sim...@google.com>
Gerrit-CC: Ehsan Karamad <ekar...@chromium.org>
Gerrit-CC: Enterprise Policy Reviews <enterprise-p...@google.com>
Gerrit-CC: James Maclean <wjma...@chromium.org>
Gerrit-CC: Kevin McNee <mc...@chromium.org>
Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
Gerrit-Attention: Alex Gough <aj...@chromium.org>
Gerrit-Attention: Avi Drissman <a...@chromium.org>
Gerrit-MessageType: newchange

Simon Hangl (Gerrit)

unread,
Jul 1, 2022, 9:35:17 AM7/1/22
to alexmo...@chromium.org, android-web...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, carlos...@chromium.org, chfreme...@chromium.org, chili...@chromium.org, chrome-gr...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, cricke...@chromium.org, dewitt...@chromium.org, dimich...@chromium.org, droger+w...@chromium.org, extension...@chromium.org, feature-me...@chromium.org, feature-v...@chromium.org, fgorsk...@chromium.org, fuchsia...@chromium.org, halliwe...@chromium.org, ipc-securi...@chromium.org, jasonrobe...@google.com, jophba...@chromium.org, kinuko...@chromium.org, lcwu+...@chromium.org, mfoltz...@chromium.org, navigation...@chromium.org, performance-m...@chromium.org, petewi...@chromium.org, phoglun...@chromium.org, poscia...@chromium.org, tommyw+w...@chromium.org, Alex Gough, Avi Drissman, Elad Alon, Tricium, Chromium LUCI CQ, chromium...@chromium.org, Ehsan Karamad, Enterprise Policy Reviews, Kevin McNee, Rijubrata Bhaumik, Sadrul Chowdhury, James Maclean

Attention is currently required from: Alex Gough, Avi Drissman.

View Change

1 comment:

  • Patchset:

    • Patch Set #45:

      ajgo@, i added a new field in StreamControls. PTAL: third_party/blink/common/mediastream/media_stream_mojom_traits.cc, third_party/blink/public/common/mediastream/media_stream_mojom_traits.h, third_party/blink/public/mojom/mediastream/media_stream.mojom

To view, visit change 3605769. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I4cc00e9dd6807c5a992367a31f10e261c372b89e
Gerrit-Change-Number: 3605769
Gerrit-PatchSet: 45
Gerrit-Owner: Simon Hangl <sim...@google.com>
Gerrit-Reviewer: Alex Gough <aj...@chromium.org>
Gerrit-Reviewer: Avi Drissman <a...@chromium.org>
Gerrit-Reviewer: Elad Alon <elad...@chromium.org>
Gerrit-Reviewer: Simon Hangl <sim...@google.com>
Gerrit-CC: Ehsan Karamad <ekar...@chromium.org>
Gerrit-CC: Enterprise Policy Reviews <enterprise-p...@google.com>
Gerrit-CC: James Maclean <wjma...@chromium.org>
Gerrit-CC: Kevin McNee <mc...@chromium.org>
Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
Gerrit-Attention: Alex Gough <aj...@chromium.org>
Gerrit-Attention: Avi Drissman <a...@chromium.org>
Gerrit-Comment-Date: Fri, 01 Jul 2022 13:35:10 +0000

Simon Hangl (Gerrit)

unread,
Jul 1, 2022, 11:31:14 AM7/1/22
to Arthur Sonzogni, Avi Drissman, alexmo...@chromium.org, android-web...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, carlos...@chromium.org, chfreme...@chromium.org, chili...@chromium.org, chrome-gr...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, cricke...@chromium.org, dewitt...@chromium.org, dimich...@chromium.org, droger+w...@chromium.org, extension...@chromium.org, feature-me...@chromium.org, feature-v...@chromium.org, fgorsk...@chromium.org, fuchsia...@chromium.org, halliwe...@chromium.org, ipc-securi...@chromium.org, jasonrobe...@google.com, jophba...@chromium.org, kinuko...@chromium.org, lcwu+...@chromium.org, mfoltz...@chromium.org, navigation...@chromium.org, performance-m...@chromium.org, petewi...@chromium.org, phoglun...@chromium.org, poscia...@chromium.org, tommyw+w...@chromium.org, Alex Gough, Elad Alon

Attention is currently required from: Alex Gough, Arthur Sonzogni.

Simon Hangl would like Arthur Sonzogni to review this change.

Simon Hangl removed Avi Drissman from this change.

View Change

16 files changed, 179 insertions(+), 6 deletions(-)


To view, visit change 3605769. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I4cc00e9dd6807c5a992367a31f10e261c372b89e
Gerrit-Change-Number: 3605769
Gerrit-PatchSet: 47
Gerrit-Owner: Simon Hangl <sim...@google.com>
Gerrit-Reviewer: Alex Gough <aj...@chromium.org>
Gerrit-Reviewer: Arthur Sonzogni <arthurs...@chromium.org>
Gerrit-Reviewer: Elad Alon <elad...@chromium.org>
Gerrit-Reviewer: Simon Hangl <sim...@google.com>
Gerrit-CC: Ehsan Karamad <ekar...@chromium.org>
Gerrit-CC: Enterprise Policy Reviews <enterprise-p...@google.com>
Gerrit-CC: James Maclean <wjma...@chromium.org>
Gerrit-CC: Kevin McNee <mc...@chromium.org>
Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
Gerrit-Attention: Alex Gough <aj...@chromium.org>
Gerrit-Attention: Arthur Sonzogni <arthurs...@chromium.org>
Gerrit-MessageType: newchange

Simon Hangl (Gerrit)

unread,
Jul 1, 2022, 11:31:21 AM7/1/22
to alexmo...@chromium.org, android-web...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, carlos...@chromium.org, chfreme...@chromium.org, chili...@chromium.org, chrome-gr...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, cricke...@chromium.org, dewitt...@chromium.org, dimich...@chromium.org, droger+w...@chromium.org, extension...@chromium.org, feature-me...@chromium.org, feature-v...@chromium.org, fgorsk...@chromium.org, fuchsia...@chromium.org, halliwe...@chromium.org, ipc-securi...@chromium.org, jasonrobe...@google.com, jophba...@chromium.org, kinuko...@chromium.org, lcwu+...@chromium.org, mfoltz...@chromium.org, navigation...@chromium.org, performance-m...@chromium.org, petewi...@chromium.org, phoglun...@chromium.org, poscia...@chromium.org, tommyw+w...@chromium.org, Arthur Sonzogni, Alex Gough, Elad Alon, Tricium, Chromium LUCI CQ, chromium...@chromium.org, Ehsan Karamad, Enterprise Policy Reviews, Kevin McNee, Rijubrata Bhaumik, Sadrul Chowdhury, James Maclean

Attention is currently required from: Alex Gough, Arthur Sonzogni.

Patch set 46:Commit-Queue +1

View Change

1 comment:

To view, visit change 3605769. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I4cc00e9dd6807c5a992367a31f10e261c372b89e
Gerrit-Change-Number: 3605769
Gerrit-PatchSet: 46
Gerrit-Owner: Simon Hangl <sim...@google.com>
Gerrit-Reviewer: Alex Gough <aj...@chromium.org>
Gerrit-Reviewer: Arthur Sonzogni <arthurs...@chromium.org>
Gerrit-Reviewer: Elad Alon <elad...@chromium.org>
Gerrit-Reviewer: Simon Hangl <sim...@google.com>
Gerrit-CC: Ehsan Karamad <ekar...@chromium.org>
Gerrit-CC: Enterprise Policy Reviews <enterprise-p...@google.com>
Gerrit-CC: James Maclean <wjma...@chromium.org>
Gerrit-CC: Kevin McNee <mc...@chromium.org>
Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
Gerrit-Attention: Alex Gough <aj...@chromium.org>
Gerrit-Attention: Arthur Sonzogni <arthurs...@chromium.org>
Gerrit-Comment-Date: Fri, 01 Jul 2022 15:31:10 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

Alex Gough (Gerrit)

unread,
Jul 1, 2022, 3:26:24 PM7/1/22
to Simon Hangl, alexmo...@chromium.org, android-web...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, carlos...@chromium.org, chfreme...@chromium.org, chili...@chromium.org, chrome-gr...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, cricke...@chromium.org, dewitt...@chromium.org, dimich...@chromium.org, droger+w...@chromium.org, extension...@chromium.org, feature-me...@chromium.org, feature-v...@chromium.org, fgorsk...@chromium.org, fuchsia...@chromium.org, halliwe...@chromium.org, ipc-securi...@chromium.org, jasonrobe...@google.com, jophba...@chromium.org, kinuko...@chromium.org, lcwu+...@chromium.org, mfoltz...@chromium.org, navigation...@chromium.org, performance-m...@chromium.org, petewi...@chromium.org, phoglun...@chromium.org, poscia...@chromium.org, tommyw+w...@chromium.org, Alex Gough, Arthur Sonzogni, Elad Alon, Tricium, Chromium LUCI CQ, chromium...@chromium.org, Ehsan Karamad, Enterprise Policy Reviews, Kevin McNee, Rijubrata Bhaumik, Sadrul Chowdhury, James Maclean

Attention is currently required from: Arthur Sonzogni, Simon Hangl.

Patch set 47:Code-Review +1

View Change

1 comment:

  • Patchset:

To view, visit change 3605769. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I4cc00e9dd6807c5a992367a31f10e261c372b89e
Gerrit-Change-Number: 3605769
Gerrit-PatchSet: 47
Gerrit-Owner: Simon Hangl <sim...@google.com>
Gerrit-Reviewer: Alex Gough <aj...@chromium.org>
Gerrit-Reviewer: Arthur Sonzogni <arthurs...@chromium.org>
Gerrit-Reviewer: Elad Alon <elad...@chromium.org>
Gerrit-Reviewer: Simon Hangl <sim...@google.com>
Gerrit-CC: Ehsan Karamad <ekar...@chromium.org>
Gerrit-CC: Enterprise Policy Reviews <enterprise-p...@google.com>
Gerrit-CC: James Maclean <wjma...@chromium.org>
Gerrit-CC: Kevin McNee <mc...@chromium.org>
Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
Gerrit-Attention: Arthur Sonzogni <arthurs...@chromium.org>
Gerrit-Attention: Simon Hangl <sim...@google.com>
Gerrit-Comment-Date: Fri, 01 Jul 2022 19:26:14 +0000

Arthur Sonzogni (Gerrit)

unread,
Jul 4, 2022, 10:23:14 AM7/4/22
to Simon Hangl, alexmo...@chromium.org, android-web...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, carlos...@chromium.org, chfreme...@chromium.org, chili...@chromium.org, chrome-gr...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, cricke...@chromium.org, dewitt...@chromium.org, dimich...@chromium.org, droger+w...@chromium.org, extension...@chromium.org, feature-me...@chromium.org, feature-v...@chromium.org, fgorsk...@chromium.org, fuchsia...@chromium.org, halliwe...@chromium.org, ipc-securi...@chromium.org, jasonrobe...@google.com, jophba...@chromium.org, kinuko...@chromium.org, lcwu+...@chromium.org, mfoltz...@chromium.org, navigation...@chromium.org, performance-m...@chromium.org, petewi...@chromium.org, phoglun...@chromium.org, poscia...@chromium.org, tommyw+w...@chromium.org, Alex Gough, Elad Alon, Tricium, Chromium LUCI CQ, chromium...@chromium.org, Ehsan Karamad, Enterprise Policy Reviews, Kevin McNee, Rijubrata Bhaumik, Sadrul Chowdhury, James Maclean

Attention is currently required from: Simon Hangl.

View Change

1 comment:

To view, visit change 3605769. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I4cc00e9dd6807c5a992367a31f10e261c372b89e
Gerrit-Change-Number: 3605769
Gerrit-PatchSet: 47
Gerrit-Owner: Simon Hangl <sim...@google.com>
Gerrit-Reviewer: Alex Gough <aj...@chromium.org>
Gerrit-Reviewer: Arthur Sonzogni <arthurs...@chromium.org>
Gerrit-Reviewer: Elad Alon <elad...@chromium.org>
Gerrit-Reviewer: Simon Hangl <sim...@google.com>
Gerrit-CC: Ehsan Karamad <ekar...@chromium.org>
Gerrit-CC: Enterprise Policy Reviews <enterprise-p...@google.com>
Gerrit-CC: James Maclean <wjma...@chromium.org>
Gerrit-CC: Kevin McNee <mc...@chromium.org>
Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
Gerrit-Attention: Simon Hangl <sim...@google.com>
Gerrit-Comment-Date: Mon, 04 Jul 2022 14:23:06 +0000

Arthur Sonzogni (Gerrit)

unread,
Jul 4, 2022, 10:42:53 AM7/4/22
to Simon Hangl, alexmo...@chromium.org, android-web...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, carlos...@chromium.org, chfreme...@chromium.org, chili...@chromium.org, chrome-gr...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, cricke...@chromium.org, dewitt...@chromium.org, dimich...@chromium.org, droger+w...@chromium.org, extension...@chromium.org, feature-me...@chromium.org, feature-v...@chromium.org, fgorsk...@chromium.org, fuchsia...@chromium.org, halliwe...@chromium.org, ipc-securi...@chromium.org, jasonrobe...@google.com, jophba...@chromium.org, kinuko...@chromium.org, lcwu+...@chromium.org, mfoltz...@chromium.org, navigation...@chromium.org, performance-m...@chromium.org, petewi...@chromium.org, phoglun...@chromium.org, poscia...@chromium.org, tommyw+w...@chromium.org, Alex Gough, Elad Alon, Tricium, Chromium LUCI CQ, chromium...@chromium.org, Ehsan Karamad, Enterprise Policy Reviews, Kevin McNee, Rijubrata Bhaumik, Sadrul Chowdhury, James Maclean

Attention is currently required from: Simon Hangl.

View Change

2 comments:

  • File content/browser/renderer_host/media/media_stream_dispatcher_host.cc:

    • Patch Set #47, Line 326: CheckRequestAllScreensAllowed

      |request_all_screens| is always false. Are you going to add tests in follow-up so that all this code is covered?

    • Patch Set #47, Line 338: .GetURL()

      If the data we pass is the origin, it would be better to pass the url::Origin directly.

      I understand you are trying to reuse "IsGetDisplayMediaSetSelectAllScreensAllowed" later, which is taking a GURL.
      Still, it would be better to plumb the origin instead, to the deepest level you can. Then proceed with the conversion when calling IsGetDisplayMediaSetSelectAllScreensAllowed and add a TODO about converting this function in the future for url::Origin.

      Note: In the near future, on top of the origin, this might need to take the storage key instead of the simple origin. See:
      https://privacycg.github.io/storage-partitioning/

To view, visit change 3605769. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I4cc00e9dd6807c5a992367a31f10e261c372b89e
Gerrit-Change-Number: 3605769
Gerrit-PatchSet: 47
Gerrit-Owner: Simon Hangl <sim...@google.com>
Gerrit-Reviewer: Alex Gough <aj...@chromium.org>
Gerrit-Reviewer: Arthur Sonzogni <arthurs...@chromium.org>
Gerrit-Reviewer: Elad Alon <elad...@chromium.org>
Gerrit-Reviewer: Simon Hangl <sim...@google.com>
Gerrit-CC: Ehsan Karamad <ekar...@chromium.org>
Gerrit-CC: Enterprise Policy Reviews <enterprise-p...@google.com>
Gerrit-CC: James Maclean <wjma...@chromium.org>
Gerrit-CC: Kevin McNee <mc...@chromium.org>
Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
Gerrit-Attention: Simon Hangl <sim...@google.com>
Gerrit-Comment-Date: Mon, 04 Jul 2022 14:42:42 +0000

Simon Hangl (Gerrit)

unread,
Jul 5, 2022, 3:59:20 PM7/5/22
to alexmo...@chromium.org, android-web...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, carlos...@chromium.org, chfreme...@chromium.org, chili...@chromium.org, chrome-gr...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, cricke...@chromium.org, dewitt...@chromium.org, dimich...@chromium.org, droger+w...@chromium.org, extension...@chromium.org, feature-me...@chromium.org, feature-v...@chromium.org, fgorsk...@chromium.org, fuchsia...@chromium.org, halliwe...@chromium.org, ipc-securi...@chromium.org, jasonrobe...@google.com, jophba...@chromium.org, kinuko...@chromium.org, lcwu+...@chromium.org, mfoltz...@chromium.org, navigation...@chromium.org, performance-m...@chromium.org, petewi...@chromium.org, phoglun...@chromium.org, poscia...@chromium.org, tommyw+w...@chromium.org, Alex Gough, Arthur Sonzogni, Elad Alon, Tricium, Chromium LUCI CQ, chromium...@chromium.org, Ehsan Karamad, Enterprise Policy Reviews, Kevin McNee, Rijubrata Bhaumik, Sadrul Chowdhury, James Maclean

Attention is currently required from: Arthur Sonzogni.

View Change

8 comments:

  • Patchset:

    • Patch Set #48:

      arthursonzogni@: i revised the cl and replied to your comments. PTAL.

  • File content/browser/renderer_host/media/media_stream_dispatcher_host.h:

    • Done

    • Patch Set #42, Line 85:

            int render_process_id,
      int render_frame_id,

      It's more idiomatic in this codebase to pass these two ints first.

    • Done

  • File content/browser/renderer_host/media/media_stream_dispatcher_host.cc:

    • |request_all_screens| is always false. […]

      yes, i plan to add a set of browser tests when the loop for the getDisplayMediaSet API is closed. i added an explicit todo here too.

    • If the data we pass is the origin, it would be better to pass the url::Origin directly. […]

      pushed origin a bit further. added a todo.

  • File content/browser/renderer_host/media/media_stream_manager.cc:

    • `NOT_SUPPORTED` seems more appropriate given the current implementations of CreateScreenEnumerator, […]

      Done

  • File content/public/browser/content_browser_client.h:

    • This new API returning an object, the object implements a single function. […]

      i did consider this, though i suggest to keep the object for the following reasons:

      • additional methods may indeed be added (e.g. different surfaces, adding filters for screen selection). time frame: mid-term
      • the implementation will grow significantly in complexity as it will also have to handle lacros. time frame: short-term
      • we will move from a sorting based matching to id based matching. this may also add some complexity and may indeed require holding a state (e.g. to generate sequential ids or to dispatch asynchronous requests to fetch these ids).
  • File content/public/browser/content_browser_client.h:

    • // Check if applications whose URL is |url| are allowed to perform all-screens-auto-selection, which […]

      Done

To view, visit change 3605769. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I4cc00e9dd6807c5a992367a31f10e261c372b89e
Gerrit-Change-Number: 3605769
Gerrit-PatchSet: 48
Gerrit-Owner: Simon Hangl <sim...@google.com>
Gerrit-Reviewer: Alex Gough <aj...@chromium.org>
Gerrit-Reviewer: Arthur Sonzogni <arthurs...@chromium.org>
Gerrit-Reviewer: Elad Alon <elad...@chromium.org>
Gerrit-Reviewer: Simon Hangl <sim...@google.com>
Gerrit-CC: Ehsan Karamad <ekar...@chromium.org>
Gerrit-CC: Enterprise Policy Reviews <enterprise-p...@google.com>
Gerrit-CC: James Maclean <wjma...@chromium.org>
Gerrit-CC: Kevin McNee <mc...@chromium.org>
Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
Gerrit-Attention: Arthur Sonzogni <arthurs...@chromium.org>
Gerrit-Comment-Date: Tue, 05 Jul 2022 19:59:11 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Arthur Sonzogni <arthurs...@chromium.org>

Arthur Sonzogni (Gerrit)

unread,
Jul 6, 2022, 5:56:57 AM7/6/22
to Simon Hangl, alexmo...@chromium.org, android-web...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, carlos...@chromium.org, chfreme...@chromium.org, chili...@chromium.org, chrome-gr...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, cricke...@chromium.org, dewitt...@chromium.org, dimich...@chromium.org, droger+w...@chromium.org, extension...@chromium.org, feature-me...@chromium.org, feature-v...@chromium.org, fgorsk...@chromium.org, fuchsia...@chromium.org, halliwe...@chromium.org, ipc-securi...@chromium.org, jasonrobe...@google.com, jophba...@chromium.org, kinuko...@chromium.org, lcwu+...@chromium.org, mfoltz...@chromium.org, navigation...@chromium.org, performance-m...@chromium.org, petewi...@chromium.org, phoglun...@chromium.org, poscia...@chromium.org, tommyw+w...@chromium.org, Alex Gough, Elad Alon, Tricium, Chromium LUCI CQ, chromium...@chromium.org, Ehsan Karamad, Enterprise Policy Reviews, Kevin McNee, Rijubrata Bhaumik, Sadrul Chowdhury, James Maclean

Attention is currently required from: Simon Hangl.

Patch set 49:Code-Review +1

View Change

4 comments:

  • Patchset:

    • Patch Set #49:

      LGTM for:
      ```
      content/public/browser/content_browser_client.cc
      content/public/browser/content_browser_client.h
      content/browser/bad_message.h
      ```

  • File content/browser/renderer_host/media/media_stream_dispatcher_host.cc:

    • yes, i plan to add a set of browser tests when the loop for the getDisplayMediaSet API is closed. […]

      Ack

    • pushed origin a bit further. added a todo.

      Thanks!

  • File content/public/browser/content_browser_client.h:

    • i did consider this, though i suggest to keep the object for the following reasons: […]

      Ack

To view, visit change 3605769. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I4cc00e9dd6807c5a992367a31f10e261c372b89e
Gerrit-Change-Number: 3605769
Gerrit-PatchSet: 49
Gerrit-Owner: Simon Hangl <sim...@google.com>
Gerrit-Reviewer: Alex Gough <aj...@chromium.org>
Gerrit-Reviewer: Arthur Sonzogni <arthurs...@chromium.org>
Gerrit-Reviewer: Elad Alon <elad...@chromium.org>
Gerrit-Reviewer: Simon Hangl <sim...@google.com>
Gerrit-CC: Ehsan Karamad <ekar...@chromium.org>
Gerrit-CC: Enterprise Policy Reviews <enterprise-p...@google.com>
Gerrit-CC: James Maclean <wjma...@chromium.org>
Gerrit-CC: Kevin McNee <mc...@chromium.org>
Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
Gerrit-Attention: Simon Hangl <sim...@google.com>
Gerrit-Comment-Date: Wed, 06 Jul 2022 09:56:41 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Arthur Sonzogni <arthurs...@chromium.org>

Simon Hangl (Gerrit)

unread,
Jul 11, 2022, 2:16:28 PM7/11/22
to alexmo...@chromium.org, android-web...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, carlos...@chromium.org, chfreme...@chromium.org, chili...@chromium.org, chrome-gr...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, cricke...@chromium.org, dewitt...@chromium.org, dimich...@chromium.org, droger+w...@chromium.org, extension...@chromium.org, feature-me...@chromium.org, feature-v...@chromium.org, fgorsk...@chromium.org, fuchsia...@chromium.org, halliwe...@chromium.org, ipc-securi...@chromium.org, jasonrobe...@google.com, jophba...@chromium.org, kinuko...@chromium.org, lcwu+...@chromium.org, mfoltz...@chromium.org, navigation...@chromium.org, performance-m...@chromium.org, petewi...@chromium.org, phoglun...@chromium.org, poscia...@chromium.org, tommyw+w...@chromium.org, Arthur Sonzogni, Alex Gough, Elad Alon, Tricium, Chromium LUCI CQ, chromium...@chromium.org, Ehsan Karamad, Enterprise Policy Reviews, Kevin McNee, Rijubrata Bhaumik, Sadrul Chowdhury, James Maclean

Attention is currently required from: Simon Hangl.

Patch set 52:Commit-Queue +2

View Change

    To view, visit change 3605769. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I4cc00e9dd6807c5a992367a31f10e261c372b89e
    Gerrit-Change-Number: 3605769
    Gerrit-PatchSet: 52
    Gerrit-Owner: Simon Hangl <sim...@google.com>
    Gerrit-Reviewer: Alex Gough <aj...@chromium.org>
    Gerrit-Reviewer: Arthur Sonzogni <arthurs...@chromium.org>
    Gerrit-Reviewer: Elad Alon <elad...@chromium.org>
    Gerrit-Reviewer: Simon Hangl <sim...@google.com>
    Gerrit-CC: Ehsan Karamad <ekar...@chromium.org>
    Gerrit-CC: Enterprise Policy Reviews <enterprise-p...@google.com>
    Gerrit-CC: James Maclean <wjma...@chromium.org>
    Gerrit-CC: Kevin McNee <mc...@chromium.org>
    Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
    Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
    Gerrit-Attention: Simon Hangl <sim...@google.com>
    Gerrit-Comment-Date: Mon, 11 Jul 2022 18:16:14 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    Gerrit-MessageType: comment

    Chromium LUCI CQ (Gerrit)

    unread,
    Jul 11, 2022, 4:05:38 PM7/11/22
    to Simon Hangl, alexmo...@chromium.org, android-web...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, carlos...@chromium.org, chfreme...@chromium.org, chili...@chromium.org, chrome-gr...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, cricke...@chromium.org, dewitt...@chromium.org, dimich...@chromium.org, droger+w...@chromium.org, extension...@chromium.org, feature-me...@chromium.org, feature-v...@chromium.org, fgorsk...@chromium.org, fuchsia...@chromium.org, halliwe...@chromium.org, ipc-securi...@chromium.org, jasonrobe...@google.com, jophba...@chromium.org, kinuko...@chromium.org, lcwu+...@chromium.org, mfoltz...@chromium.org, navigation...@chromium.org, performance-m...@chromium.org, petewi...@chromium.org, phoglun...@chromium.org, poscia...@chromium.org, tommyw+w...@chromium.org, Arthur Sonzogni, Alex Gough, Elad Alon, Tricium, chromium...@chromium.org, Ehsan Karamad, Enterprise Policy Reviews, Kevin McNee, Rijubrata Bhaumik, Sadrul Chowdhury, James Maclean

    Chromium LUCI CQ submitted this change.

    View Change



    49 is the latest approved patch-set.
    No files were changed between the latest approved patch-set and the submitted one.

    Approvals: Elad Alon: Looks good to me Simon Hangl: Commit Arthur Sonzogni: Looks good to me Alex Gough: Looks good to me
    [MSC] Screen auto selection for getDisplayMediaSet.

    This change enables auto selection for getDisplayMediaSet.
    It propagates the autoSelectAllScreens property through the
    call stack, loads a list of all attached screens and forwards
    it for capturing.

    Bug: 1300883

    Change-Id: I4cc00e9dd6807c5a992367a31f10e261c372b89e
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3605769
    Reviewed-by: Elad Alon <elad...@chromium.org>
    Reviewed-by: Alex Gough <aj...@chromium.org>
    Commit-Queue: Simon Hangl <sim...@google.com>
    Reviewed-by: Arthur Sonzogni <arthurs...@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1022849}

    ---
    M chrome/browser/chrome_content_browser_client.cc
    M chrome/browser/chrome_content_browser_client.h
    M chrome/browser/media/webrtc/capture_policy_utils.h

    M content/browser/bad_message.h
    M content/browser/renderer_host/media/media_stream_dispatcher_host.cc
    M content/browser/renderer_host/media/media_stream_dispatcher_host.h
    M content/browser/renderer_host/media/media_stream_manager.cc
    M content/public/browser/content_browser_client.cc
    M content/public/browser/content_browser_client.h
    M third_party/blink/common/mediastream/media_stream_mojom_traits.cc
    M third_party/blink/public/common/mediastream/media_stream_controls.h
    M third_party/blink/public/common/mediastream/media_stream_mojom_traits.h
    M third_party/blink/public/mojom/mediastream/media_stream.mojom
    M third_party/blink/renderer/modules/mediastream/user_media_processor.cc
    M third_party/blink/renderer/modules/mediastream/user_media_request.cc
    M third_party/blink/renderer/modules/mediastream/user_media_request.h
    M tools/metrics/histograms/enums.xml
    17 files changed, 188 insertions(+), 6 deletions(-)


    To view, visit change 3605769. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I4cc00e9dd6807c5a992367a31f10e261c372b89e
    Gerrit-Change-Number: 3605769
    Gerrit-PatchSet: 53
    Gerrit-Owner: Simon Hangl <sim...@google.com>
    Gerrit-Reviewer: Alex Gough <aj...@chromium.org>
    Gerrit-Reviewer: Arthur Sonzogni <arthurs...@chromium.org>
    Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
    Gerrit-Reviewer: Elad Alon <elad...@chromium.org>
    Gerrit-Reviewer: Simon Hangl <sim...@google.com>
    Gerrit-CC: Ehsan Karamad <ekar...@chromium.org>
    Gerrit-CC: Enterprise Policy Reviews <enterprise-p...@google.com>
    Gerrit-CC: James Maclean <wjma...@chromium.org>
    Gerrit-CC: Kevin McNee <mc...@chromium.org>
    Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
    Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
    Gerrit-MessageType: merged

    Silvia Medina (Gerrit)

    unread,
    May 23, 2026, 3:28:35 PMMay 23
    to Chromium LUCI CQ, Simon Hangl, Arthur Sonzogni, Alex Gough, Elad Alon, chromium...@chromium.org, Enterprise Policy Reviews, Kevin McNee, Rijubrata Bhaumik, Sadrul Chowdhury, James Maclean, alexmo...@chromium.org, android-web...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, carlos...@chromium.org, chfreme...@chromium.org, chili...@chromium.org, chrome-gr...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, cricke...@chromium.org, dewitt...@chromium.org, dimich...@chromium.org, droger+w...@chromium.org, extension...@chromium.org, feature-me...@chromium.org, feature-v...@chromium.org, fgorsk...@chromium.org, fuchsia...@chromium.org, halliwe...@chromium.org, ipc-securi...@chromium.org, jasonrobe...@google.com, jophba...@chromium.org, kinuko...@chromium.org, lcwu+...@chromium.org, mfoltz...@chromium.org, navigation...@chromium.org, performance-m...@chromium.org, petewi...@chromium.org, phoglun...@chromium.org, poscia...@chromium.org, tommyw+w...@chromium.org

    Silvia Medina added 1 comment

    Patchset-level comments
    Open in Gerrit

    Related details

    Attention set is empty
    Submit Requirements:
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I4cc00e9dd6807c5a992367a31f10e261c372b89e
    Gerrit-Change-Number: 3605769
    Gerrit-PatchSet: 53
    Gerrit-Owner: Simon Hangl <sim...@google.com>
    Gerrit-Reviewer: Alex Gough <aj...@chromium.org>
    Gerrit-Reviewer: Arthur Sonzogni <arthurs...@chromium.org>
    Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
    Gerrit-Reviewer: Elad Alon <elad...@chromium.org>
    Gerrit-Reviewer: Simon Hangl <sim...@google.com>
    Gerrit-CC: Ehsan Karamad <ekar...@chromium.org>
    Gerrit-CC: Enterprise Policy Reviews <enterprise-p...@google.com>
    Gerrit-CC: James Maclean <wjma...@chromium.org>
    Gerrit-CC: Kevin McNee <mc...@chromium.org>
    Gerrit-CC: Name of user not set #1242319
    Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
    Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
    Gerrit-CC: Silvia Medina <silmed...@gmail.com>
    Gerrit-Comment-Date: Sat, 23 May 2026 19:28:21 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages