New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 638950 link

Starred by 2 users

Issue metadata

Status: Started
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Register and request mojo:media on BrowserContext Connector

Project Member Reported by s...@chromium.org, Aug 18 2016

Issue description

mojo:media should be registered and requested using BrowserContext's Connector, instead of the Browser process Connector (MojoShellConnection::GetForProcess()). This will allow a mojo:media instance for each user in the long-run.

When mojo:media is hosted in the Browser, this can easily be done by registering the handler in BrowserContext::Initialize(). For other platforms like Android, where mojo:media is hosted elsewhere, this will take further thought.

 

Comment 1 by alokp@chromium.org, Aug 18 2016

FYI: we eventually want to move the mojo:media service out of the browser process as a standalone mojo service.

Comment 2 by roc...@chromium.org, Aug 18 2016

It doesn't matter where mojo:media runs. You can still use BrowserContext's
Connector (or the renderer's ChildThreadImpl::GetMojoShellConnection(),
which uses the same user ID as its browser-side BrowserContext) to connect
to it.

The Connector you use to connect to it really only determines the identity
mojo:media sees on the incoming connection, and determines whether the
connection is to a new instance or an existing instance (e.g. if there's
already an instance of the service running for that user ID).

Comment 3 by alokp@chromium.org, Aug 18 2016

rockot@: If mojo:media were a standalone mojo service (not an embedded service in browser/gpu process), does this mean launching a new process for each client with unique user ID?

Comment 4 by roc...@chromium.org, Aug 18 2016

The only thing it means strictly is that the registered service request
handler
<https://cs.chromium.org/chromium/src/content/browser/mojo/mojo_shell_context.cc?rcl=0&l=287>
will be invoked once for each client with a unique user ID.
Project Member

Comment 5 by bugdroid1@chromium.org, Aug 18 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f78815009d7a7801126d30a76c71a2554ea86f93

commit f78815009d7a7801126d30a76c71a2554ea86f93
Author: slan <slan@chromium.org>
Date: Thu Aug 18 16:59:59 2016

Use the process-level MojoShellConnection to connect to mojo:media.

The interface provided by mojo:media, media::mojom::MediaService, is
registered in mojo_shell_context.cc on the browser process
MojoShellConnection. Use this ShellConnection to connect to this
interface (rather than the connection for the BrowserContext).

BUG=638950

CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation

Review-Url: https://codereview.chromium.org/2255223002
Cr-Commit-Position: refs/heads/master@{#412859}

[modify] https://crrev.com/f78815009d7a7801126d30a76c71a2554ea86f93/content/browser/frame_host/render_frame_host_impl.cc

Comment 6 by xhw...@chromium.org, Nov 10 2017

Cc: -alokp@chromium.org -xhw...@chromium.org s...@chromium.org
Labels: -Pri-3 Proj-Sodo Pri-2
Owner: xhw...@chromium.org
Status: Started (was: Assigned)

Comment 7 by xhw...@chromium.org, Nov 10 2017

Cc: dcheng@chromium.org
Labels: M-65
+dcheng from security's perspective.

For comparison, when hosting the desktop CDM using pepper plugin, we'll have a CDM process per CDM/plugin type, and per user profile (BrowserContext). Now when hosting the CDM using mojo CDM (media/cdm service), we have a CDM process per CDM type (see  issue 664364 ). But since we use the browser process connector, all user profile (BrowserContext) shares the same CDM process for one CDM type.

dcheng: Is this a concern from security/privacy's perspective? The CDM process is sandboxed. Each CDM instance runs in it's own context in the CDM process. They talk to the browser to access resources, where the browser side services are bound to RenderFrameHost (see FrameServiceBase).

rockot: As you pointed out, I could easily move our code to use the BrowserContext Connector, so that we'll have different user ID based on different BrowserContext. But as we discussed, I am now using different user ID for different CDM types because using different instance ID didn't work. When I switch to using BrowserContext connector, shall I switch back to use different instance ID for different CDM types? Will that work?

Comment 8 by roc...@chromium.org, Nov 10 2017

Using a different instance ID for different CDM types *will* work now, and
should be preferred. The issue before was that we did not have a proper
support for singleton services, so we were tripping over the lack of a
content_packaged_services instance with a matching instance ID.

Since then, we have introduced real singleton services, and
content_packaged_services is one.

Comment 9 by xhw...@chromium.org, Nov 10 2017

rockot: Cool, then I'll switch back to use instance ID.

Any comment on what service should use the BrowserContext connector instead of the browser process connector? Or should we always prefer the former to avoid potential cross-user-profile issues?


Totally your call there, as I don't understand the security or privacy
constraints of your use case. In general the deciding factor is: do you
want different profiles using the service to have their service-side state
isolated from each other, or does it not really matter?

Resource constraints (like too many processes) are probably less concerning
here given that multiprofile use is uncommon, and I would expect that to be
especially true on mobile.
dcheng: See #7, any comments?
Labels: -M-65 M-66
dcheng: kindly ping :)
Labels: -M-66 M-67
dcheng: kingly ping!
Cc: jam@chromium.org
+jam since you are familiar with the old pepper model. See #7 and https://chromium-review.googlesource.com/c/chromium/src/+/952469 for existing discussion. Thanks!
Labels: -M-67 M-68
Labels: -M-68 M-70
Labels: -M-70 M-71
Labels: -Pri-2 -M-71 Pri-3
Cc: -roc...@chromium.org rockot@google.com

Sign in to add a comment