Why:
This change will allow the reuse of existing components that already
utilize BrowserInterfaceBroker for Mojo connection setup. One
potential example is blink::LockManager for Web Locks API support,
which sets up a mojom::blink::LockManager connection. Regardless,
the BrowserInterfaceBroker provides a streamlined approach to
bootstrap Mojo service connections.
Note:
- 1. No behavior change -- I went through the caller sites for
WorkletGlobalScope::GetBrowserInterfaceBroker() and identified
ukm::mojom::UkmRecorderFactory as the only potential interface that
can be requested within a SharedStorageWorklet. To maintain code
simplicity, we avoid special-casing renderer logic and disable
ukm::mojom::UkmRecorderFactory on the browser side.
- 2. Other usages appear to originate from non-(SharedStorage)Worklet
contexts. If any usages were overlooked, this could lead to
renderer crashes. We will actively monitor overall crash reports
to promptly address any issues arising from this change.
Bug: 365578420
Change-Id: Ie0df93761f3194b6a90a4b7e7b867a43047a69b9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5847692
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Yao Xiao <yaoxia@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1355290}
This field is:
* Unsafe in presence of Oilpan (see https://crbug.com/40261265)
* Not actually used - there are no callers of
`AgentGroupScheduler::GetBrowserInterfaceBroker`. This method was
added in https://crrev.com/c/2677585 and AFAICT no callers have ever
been added later - for example this command finds no other commits:
`git log -S AgentSched -- content/browser/browser_interface_binders.cc`
Removing this field also helps to make progress on
https://crbug.com/41482945 - this field is related to 1 out of 5 callers
of `BrowserInterfaceBrokerProxy::Bind` and the linked bug requires
passing `ContextLifecycleNotifier` to `HeapMojoRemote`. I note that
`AgentGroupSchedulerImpl::BindInterfaceBroker` seems to be the only
caller of `BrowserInterfaceBrokerProxy::Bind` which doesn't have a 1:1
relationship with a `ContextLifecycleNotifier` (which IIUC roughly
corresponds to the `ExecutionContext`). The other callers are 1)
constructor of `WorkerGlobalScope`, 2) constructor of
`content::RenderFrameImpl`, 3)
`MojoBindingContext::SetMojoJSInterfaceBroker` (we ignore here
`GetEmptyBrowserInterfaceBroker` which doesn't actually need to bind an
actual mojo remote).
Fixed: 40261265
Bug: 41482945
Change-Id: Id07826bb008bea6157a30868a56ad05ad3bbc675
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5646657
Reviewed-by: Francois Pierre Doray <fdoray@chromium.org>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Auto-Submit: Łukasz Anforowicz <lukasza@chromium.org>
Reviewed-by: Emily Stark <estark@chromium.org>
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Reviewed-by: Scott Haseley <shaseley@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1319775}
It's becoming clear that the posture is not a global state. On Android
the posture is tied to an Activity : for example an Android Activity can
be on an external screen or two Chrome instances side by side and Android does not return the physical posture of the device. While right now Windows is a global state we can imagine scenarios like this where the "logical" posture doesn't match the physical posture.
This patch moves the device_posture mojo implementation out of services/. This means that now it is attached to a given web content. This allows us to simplify some of the implementation now that we can assume the receivers are from the same web content.
Also now that we are in the content/ layer we can directly hook into the device posture classes to implement the viewport segments support in RWHA.
Bug: 1517764
Change-Id: I173d6913d953134dc6f1973d511b5e874de38158
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5202826
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Bo Liu <boliu@chromium.org>
Commit-Queue: Alexis Menard <alexis.menard@intel.com>
Cr-Commit-Position: refs/heads/main@{#1253273}
This patch extend the DevTools protocol to allow overriding the device posture.
It refactors the mojo implementation to make sure that only a single connection to the device service is made per window, allowing the device posture service to know which connection is emulated/overridden which will update the clients (JS bindings/MQs).
This patch also remove the device posture browsertests and make them web tests so the added codepath is tested.
Emulating the device posture should be available from every platforms therefore the patch enables the mojo bindings on platforms that do not have native support for device posture. This would be required anyway when the API will ship.
Bug: 1066842
Change-Id: I6184d39c78fb86dc4a906ae64afef0811598d661
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5067005
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Bo Liu <boliu@chromium.org>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Commit-Queue: Alexis Menard <alexis.menard@intel.com>
Cr-Commit-Position: refs/heads/main@{#1232398}
BrowserInterfaceBinders is one of the biggest classes around. Reduce
excess includes to try to help reduce its size. Headers being removed
are based on suggestions from the IWYU tool.
Also combine some conditional includes into an #if/#else block.
Bug: 1227131
Change-Id: I9fbf9d7a7ced22ca0ccaa482d9aef75df1f4f480
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3035433
Reviewed-by: Alex Gough <ajgo@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#902736}
This CL adds RegisterBrowserInterfaceBindersForServiceWorker() to
content::ContentBrowserClient to support a general method for
binding an interface scoped to service workers.
ContentBrowserClient::BindBadgeServiceReceiverFromServiceWorker()
is replaced with using it.
It introduces ServiceWorkerVersionBaseInfo as a minimal version of
ServiceWorkerVersionInfo to expose other folders than //content.
Bug: 1045214
Change-Id: I24b82875df79f1eaf89adc3d80bd52db9394ac33
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2805764
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Chase Phillips <cmp@chromium.org>
Reviewed-by: Matt Falkenhagen <falken@chromium.org>
Reviewed-by: Asami Doi <asamidoi@chromium.org>
Commit-Queue: Julie Kim <jkim@igalia.com>
Cr-Commit-Position: refs/heads/master@{#875024}
Bind the battery monitor to the RenderFrameHostImpl BIB instead of the
RenderProcessHostImpl BIB. This allows freezing/managing the interface
with more granularity.
Remove multiple-windows tests. These were necessary when multiple
windows could share the same mojo connection. Since each page has its
own connection these tests are no longer necessary.
Bug: 1126758
Change-Id: Iba5a928105d19a9e86f9100fa6fdcf356b847c29
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2500968
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Tim Volodine <timvolodine@chromium.org>
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Commit-Queue: Johann Koenig <johannkoenig@google.com>
Cr-Commit-Position: refs/heads/master@{#828585}
This moves DeviceService client code off of Service Manager APIs and
onto direct usage of the browser's global GetDeviceService() API.
This CL covers all clients of BatteryMonitor, PowerMonitor,
TimeZoneMonitor, ScreenOrientationListener, NFCProvider, and
VibrationManager.
Bug: 977637
Change-Id: I34727b14ff36ffff95724724ad6011d693f2d6cf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1957184
Reviewed-by: Ryan Sturm <ryansturm@chromium.org>
Reviewed-by: Alexander Cooper <alcooper@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Sam McNally <sammc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#724143}
This change adds BrowserInterfaceBroker plumbing for service workers,
as well as support of task runners for binding interface handlers.
It also converts BackgroundFetchService clients in blink to use
BrowserInterfaceBroker as a use case.
Bug: 985110, 985112, 976962
Change-Id: I5c431f3f862cb3ac10d389f8c7afea3734d5bfd5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1742779
Commit-Queue: Oksana Zhuravlova <oksamyt@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Matt Falkenhagen <falken@chromium.org>
Reviewed-by: Peter Beverloo <peter@chromium.org>
Reviewed-by: Ken Rockot <rockot@google.com>
Cr-Commit-Position: refs/heads/master@{#686578}
This change adds BrowserInterfaceBroker support for binders with context
(in this case shared and dedicated workers), as well as plumbing for
shared and dedicated workers.
It also converts FileSystemManager client in blink to use
BrowserInterfaceBroker for all contexts (should be safe because shared
workers don't use this interface).
DedicatedWorkerHost now has its own header since it is used by
browser_interface_binders.cc
Bug: 985112
Change-Id: If412b07948a0ae7831ec109ae876b0b62ffc1125
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1721936
Reviewed-by: Marijn Kruisselbrink <mek@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Ken Rockot <rockot@google.com>
Reviewed-by: Robert Flack <flackr@chromium.org>
Reviewed-by: Ken Buchanan <kenrb@chromium.org>
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Oksana Zhuravlova <oksamyt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#685422}
This CL adds the mojom interface that the renderer will use to get
interfaces from the browser, as well as its implementation, functions
for registering interface handlers and all the necessary plumbing.
This CL also converts AudioContext to use BrowserInterfaceBroker.
Bug: 718652
Change-Id: I6b24bc802ca482feac1d8ae5fff7e5bf44215fa4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1688547
Commit-Queue: Oksana Zhuravlova <oksamyt@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Hongchan Choi <hongchan@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Ken Rockot <rockot@google.com>
Reviewed-by: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#681341}