Android has a browser-side timeout for establish channel which is
usually the #1 crash on the stable channel. This CL will try to perform
a DumpWithoutCrashing in the gpu process when this timeout happens to
gather more data.
Bug: 680777
Change-Id: I21e1701c359afc57e31a50403d59ba9a94a2baae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2222919
Reviewed-by: Khushal <khushalsagar@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Commit-Queue: Bo <boliu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#773783}
This CL makes sure that reports of bad mojo messages are preserving the
callstack and the crash keys. This is done by making sure that
DumpWithoutCrashing is called synchronously from
BrowserChildProcessHostImpl::OnMojoError.
The CL also opportunitically reduces code duplication related to
actually terminating a child process. The duplicated code is extracted
into a new TerminateProcessForBadMessage private method and reused both
from OnMojoError and from TerminateOnBadMessageReceived.
Bug: 1062418
Change-Id: I8f5bf802e9aabec4d92ee9fd37c1c55012f1250f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2106806
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Cr-Commit-Position: refs/heads/master@{#751478}
This reverts commit bfca6c8096.
Reason for revert: Reverting the revert which was only done make reverting an earlier CL possible. Earlier CL has been fixed and relanded.
Original change's description:
> Revert "Move Utility processes off Service Manager"
>
> This reverts commit 0a311ff4af.
>
> Reason for revert: breaks graphics on some Chrome OS devices.
>
> Original change's description:
> > Move Utility processes off Service Manager
> >
> > This migrates Utility processes to direct ChildProcess API usage instead
> > of bootstrapping IPC through the Service Manager.
> >
> > As this is the last remaining use of Service Manager IPC to bootstrap
> > Content child processes, this also rips out a bunch of infrastructure
> > that existed only to support that.
> >
> > Bug: 977637
> > Change-Id: I08e542f1d9f294bc1c387ea5845e8ba0d5a7d2b8
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1919719
> > Commit-Queue: Ken Rockot <rockot@google.com>
> > Reviewed-by: Robert Sesek <rsesek@chromium.org>
> > Reviewed-by: Avi Drissman <avi@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#718352}
>
> NOPRESUBMIT=true
>
> Bug: 1028852
> Bug: 977637
> Tbr: rockot@google.com
> Tbr: avi@chromium.org
> Tbr: rsesek@chromium.org
> Change-Id: I9b2e8ca44f5b6accc2d3718cab3cb547d979c230
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1948402
> Commit-Queue: Shuhei Takahashi <nya@chromium.org>
> Reviewed-by: Shuhei Takahashi <nya@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#720938}
TBR=avi@chromium.org,rockot@google.com,nya@chromium.org,rsesek@chromium.org
NOPRESUBMIT=true
Change-Id: I79ea423c97880366125abfb659dae223d0185023
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1028852, 977637
Tbr: rsesek@chromium.org
Tbr: avi@chromium.org
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1949304
Commit-Queue: Ken Rockot <rockot@google.com>
Reviewed-by: Ken Rockot <rockot@google.com>
Cr-Commit-Position: refs/heads/master@{#721383}
This reverts commit 881a65d746.
Reason for revert: breaks graphics on some Chrome OS devices.
Original change's description:
> Move Renderer processes off Service Manager
>
> Migrates Renderer processes to use the simpler ChildProcess IPC
> interface in place of deprecated Service Manager IPC.
>
> Support for preloaded files in service manifest definitions is
> effectively removed in favor of explicit parameters on
> BrowserChildProcessHost and ChildProcessLauncher. The only use case (V8
> snapshot files) has been migrated from manifest data to a simple map
> definition, and it's used during renderer and utility process
> launching.
>
> After this CL, only utility processes remain to be moved off of
> Service
> Manager IPC.
>
> NOPRESUBMIT=true
>
> Bug: 977637
> Change-Id: I1d8205cb73ead904aa21b85d6cbee11cb3fc84f5
> Tbr: boliu@chromium.org
> Tbr: yucliu@chromium.org
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1918375
> Reviewed-by: Martin Barbella <mbarbella@chromium.org>
> Reviewed-by: Robert Sesek <rsesek@chromium.org>
> Reviewed-by: Avi Drissman <avi@chromium.org>
> Commit-Queue: Ken Rockot <rockot@google.com>
> Cr-Commit-Position: refs/heads/master@{#717920}
NOPRESUBMIT=true
Bug: 1028852
Bug: 977637
Tbr: rockot@google.com
Tbr: boliu@chromium.org
Tbr: yucliu@chromium.org
Tbr: mbarbella@chromium.org
Tbr: rsesek@chromium.org
Tbr: avi@chromium.org
Change-Id: I30a52d825cc156b066d7c2ec455c8fb588a408af
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1948663
Commit-Queue: Shuhei Takahashi <nya@chromium.org>
Reviewed-by: Shuhei Takahashi <nya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#720939}
This reverts commit 0a311ff4af.
Reason for revert: breaks graphics on some Chrome OS devices.
Original change's description:
> Move Utility processes off Service Manager
>
> This migrates Utility processes to direct ChildProcess API usage instead
> of bootstrapping IPC through the Service Manager.
>
> As this is the last remaining use of Service Manager IPC to bootstrap
> Content child processes, this also rips out a bunch of infrastructure
> that existed only to support that.
>
> Bug: 977637
> Change-Id: I08e542f1d9f294bc1c387ea5845e8ba0d5a7d2b8
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1919719
> Commit-Queue: Ken Rockot <rockot@google.com>
> Reviewed-by: Robert Sesek <rsesek@chromium.org>
> Reviewed-by: Avi Drissman <avi@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#718352}
NOPRESUBMIT=true
Bug: 1028852
Bug: 977637
Tbr: rockot@google.com
Tbr: avi@chromium.org
Tbr: rsesek@chromium.org
Change-Id: I9b2e8ca44f5b6accc2d3718cab3cb547d979c230
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1948402
Commit-Queue: Shuhei Takahashi <nya@chromium.org>
Reviewed-by: Shuhei Takahashi <nya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#720938}
This migrates Utility processes to direct ChildProcess API usage instead
of bootstrapping IPC through the Service Manager.
As this is the last remaining use of Service Manager IPC to bootstrap
Content child processes, this also rips out a bunch of infrastructure
that existed only to support that.
Bug: 977637
Change-Id: I08e542f1d9f294bc1c387ea5845e8ba0d5a7d2b8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1919719
Commit-Queue: Ken Rockot <rockot@google.com>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#718352}
This is a reland of 45cef59a78
Original change's description:
> Move Renderer processes off Service Manager
>
> Migrates Renderer processes to use the simpler ChildProcess IPC
> interface in place of deprecated Service Manager IPC.
>
> Support for preloaded files in service manifest definitions is
> effectively removed in favor of explicit parameters on
> BrowserChildProcessHost and ChildProcessLauncher. The only use case (V8
> snapshot files) has been migrated from manifest data to a simple map
> definition, and it's used during renderer and utility process launching.
>
> After this CL, only utility processes remain to be moved off of Service
> Manager IPC.
>
> NOPRESUBMIT=true
>
> Bug: 977637
> Change-Id: I1d8205cb73ead904aa21b85d6cbee11cb3fc84f5
> Tbr: boliu@chromium.org
> Tbr: yucliu@chromium.org
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1918375
> Reviewed-by: Martin Barbella <mbarbella@chromium.org>
> Reviewed-by: Robert Sesek <rsesek@chromium.org>
> Reviewed-by: Avi Drissman <avi@chromium.org>
> Commit-Queue: Ken Rockot <rockot@google.com>
> Cr-Commit-Position: refs/heads/master@{#717920}
NOPRESUBMIT=true
Bug: 977637
Change-Id: I9dd89104626ef73f81abd93c8a35310a2d6997a2
Tbr: boliu@chromium.org
Tbr: yucliu@chromium.org
Tbr: mbarbella@chromium.org
Tbr: avi@chromium.org
Tbr: rsesek@chromium.org
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1930104
Reviewed-by: Ken Rockot <rockot@google.com>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Ken Rockot <rockot@google.com>
Cr-Commit-Position: refs/heads/master@{#718334}
This reverts commit 45cef59a78.
Reason for revert: breaks a fuzzing tool compile
Original change's description:
> Move Renderer processes off Service Manager
>
> Migrates Renderer processes to use the simpler ChildProcess IPC
> interface in place of deprecated Service Manager IPC.
>
> Support for preloaded files in service manifest definitions is
> effectively removed in favor of explicit parameters on
> BrowserChildProcessHost and ChildProcessLauncher. The only use case (V8
> snapshot files) has been migrated from manifest data to a simple map
> definition, and it's used during renderer and utility process launching.
>
> After this CL, only utility processes remain to be moved off of Service
> Manager IPC.
>
> NOPRESUBMIT=true
>
> Bug: 977637
> Change-Id: I1d8205cb73ead904aa21b85d6cbee11cb3fc84f5
> Tbr: boliu@chromium.org
> Tbr: yucliu@chromium.org
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1918375
> Reviewed-by: Martin Barbella <mbarbella@chromium.org>
> Reviewed-by: Robert Sesek <rsesek@chromium.org>
> Reviewed-by: Avi Drissman <avi@chromium.org>
> Commit-Queue: Ken Rockot <rockot@google.com>
> Cr-Commit-Position: refs/heads/master@{#717920}
TBR=avi@chromium.org,rockot@google.com,mbarbella@chromium.org,rsesek@chromium.org
Change-Id: I3fa67ad894cd5725ff71d59cadec2cebc4917952
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 977637
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1930102
Reviewed-by: Ken Rockot <rockot@google.com>
Commit-Queue: Ken Rockot <rockot@google.com>
Cr-Commit-Position: refs/heads/master@{#717937}
Migrates Renderer processes to use the simpler ChildProcess IPC
interface in place of deprecated Service Manager IPC.
Support for preloaded files in service manifest definitions is
effectively removed in favor of explicit parameters on
BrowserChildProcessHost and ChildProcessLauncher. The only use case (V8
snapshot files) has been migrated from manifest data to a simple map
definition, and it's used during renderer and utility process launching.
After this CL, only utility processes remain to be moved off of Service
Manager IPC.
NOPRESUBMIT=true
Bug: 977637
Change-Id: I1d8205cb73ead904aa21b85d6cbee11cb3fc84f5
Tbr: boliu@chromium.org
Tbr: yucliu@chromium.org
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1918375
Reviewed-by: Martin Barbella <mbarbella@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Ken Rockot <rockot@google.com>
Cr-Commit-Position: refs/heads/master@{#717920}
This removes Service Manager API dependencies from the Tracing service
and its clients.
A new TracingService mojom interface is introduced to own and control a
singleton Tracing service instance. This interface allows for client
registration and ConsumerHost binding.
The browser maintains a registry of active child processes, updated
explicitly by RenderProcessHostImpl and BrowserChildProcessHostImpl.
The registry is used to keep the Tracing service connected to all child
processes while it's running.
Bug: 977637
Change-Id: I7c67399fd03b78f68c997a26d89561fc71512cd5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1918311
Commit-Queue: Ken Rockot <rockot@google.com>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: oysteine <oysteine@chromium.org>
Cr-Commit-Position: refs/heads/master@{#717489}
This reverts NaCl processes to use only the Legacy IPC Channel (over
Mojo) for all IPC, rather than bootstrapping them as Service Manager
service processes just so they can then bind an IPC Channel.
To support this, Browser/ChildProcessHost is modified to support such
processes if so configured at construction time. This "legacy mode" for
ChildProcessHost can be removed if/when NaCl processes are removed from
Chrome.
Some light groundwork is put down for further refactoring as well:
namely the Mojo invitation ownership is lifted into ChildProcessHost,
and a ChildProcessHost::IpcMode enum is introduced to select what mode
different process types will operate in. Follow-up CLs will introduce
a new IPC mode and incrementally port all other process types to it.
IpcMode::kServiceManager will be removed in the near future, and
IpcMode itself will be removed completely (bringing ChildProcessHost
back down to only one mode of operation) once kLegacy can be removed
too.
Bug: 977637
Change-Id: I1abec0fe8ad7b2a18bddcdd467657447c641370e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1915320
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Derek Schuff <dschuff@chromium.org>
Commit-Queue: Ken Rockot <rockot@google.com>
Cr-Commit-Position: refs/heads/master@{#716345}
This service is run in the GPU process and its interfaces are bound only
by the browser, brokering unfiltered requests from renderers. Logic is
simplified by removing all dependencies on Service Manager APIs, in
favor of the browser's brokering logic talking directly to
GpuProcessHost and maintaining a persistent connection to the service.
Bug: 977637
Change-Id: I9047889de659b8ff61df4bae40867d3b81d8127f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1761689
Commit-Queue: Ken Rockot <rockot@google.com>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#688616}
This removes all Service Manager dependencies from the Font Service in
favor of direct Mojo interface connection. The browser maintains an
internal API for connecting new pipes to the in-process service
instance.
This requires ChildProcessHostImpl to support the BindHostReceiver()
mojom API for non-renderer child processes, as well as
plumbing it up to UtilityProcessHost and PluginProcessHost. Rather than
generic support through Service Manager with manifest-based filtering,
each process host type explicitly implements its support for binding the
FontService interface when requested by the child process.
This CL also fixes some thread-safety bugs in the existing Font Service
client library code which could cause the client endpoint and/or the
WeakPtrFactory to be destroyed on the wrong sequence. FontServiceThread
has been refactored to make the WeakPtrFactory unnecessary, and the
client endpoint is now always destroyed on the correct sequence.
Finally, this changes font_service_unittests to use an in-process
background service instance rather than using the Service Manager to
spin up a dedicated service executable.
Bug: 977637
Change-Id: I3efdafb06ae2d79e9cb149675e49c29e30d0cad6
Test: for good measure, manually tested PDF rendering
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1756435
Commit-Queue: Ken Rockot <rockot@google.com>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Dominik Röttsches <drott@chromium.org>
Cr-Commit-Position: refs/heads/master@{#687694}
This is a refactoring CL that switches all usages of obsolete
base::SharedMemory and base::SharedMemoryHandle classes in metrics allocators
to the new shared memory API.
No behavioral change is expected.
The browser process creates one shared memory allocator per child process. The
shared memory is writable both in the parent and the child processes. Thus, the
base::WritableSharedMemoryRegion class is used.
Bug: 920183
Change-Id: I31df2ca2eefb606b053e255cf06a91a0d3e1038c
Reviewed-on: https://chromium-review.googlesource.com/c/1477121
Commit-Queue: Alex Ilin <alexilin@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Brian White <bcwhite@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#634158}
AppendExtraCommandLineSwitches was called twice during GPU process launch and
it caused some duplicate command line switches in GPU process.
In GpuProcessHost::LaunchGpuProcess, the second AppendExtraCommandLineSwitches
call was from BrowserChildProcessHostImpl::Launch().
The solution is to divide BrowserChildProcessHostImpl::Launch() into two parts
- AppendExtraCommandLineSwitches and LaunchWithoutExtraComandLineSwitches. The
GPU process will now call LaunchWithoutExtraComandLineSwitches to avoid running
AppendExtraCommandLineSwitches twice.
Bug:899361
Change-Id: I4ddfeaaf9624aac68e9ab68aabac6ed4e83f7a03
Reviewed-on: https://chromium-review.googlesource.com/c/1316660
Commit-Queue: Maggie Chen <magchen@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#607043}
This EDK type is replaced with OutgoingInvitation in the public API.
All remaining consumers of the EDK type are migrated to the public
API in this CL, and the EDK type is deleted.
Bug: 844763
Change-Id: Ifc7bc48253bb725e7ce5e23fbb64c03d7c1ff74f
Reviewed-on: https://chromium-review.googlesource.com/1073079
Commit-Queue: Ken Rockot <rockot@chromium.org>
Reviewed-by: Siddhartha S <ssid@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Jay Civelli <jcivelli@chromium.org>
Cr-Commit-Position: refs/heads/master@{#564180}
Add new "metrics name" which is non-localized and will be used for
recording metrics for child processes. The name is taken from the
mojo service name for mojo processes, or can be custom set.
BUG=767906
Change-Id: Ibcfa314fe4c475256f76a4369d17e63e32050195
Reviewed-on: https://chromium-review.googlesource.com/1072789
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: Will Harris <wfh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#563777}
Combine termination status and exit code into a single struct. And then
add two Android-only fields: oom protection binding, and intentional
kill.
Update the code in ChildProcessLauncher and ChildProcessLauncherHelper
to populate Info instead, including renaming methods.
Other than populating the new fields on Android, this is a no-op change
on all platforms.
Bug: 693484
Change-Id: I1ce01cbf1e81a125b34604657d6abcb6a02e0556
Reviewed-on: https://chromium-review.googlesource.com/1013225
Reviewed-by: Mark Seaborn <mseaborn@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Reviewed-by: Maria Khomenko <mariakhomenko@chromium.org>
Commit-Queue: Bo <boliu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551894}
Startup tracing is broken for several reasons:
1. When renderers are forked from a Zygote process, --trace-startup
flags are ignored.
2. In a non-zygote mode, when --trace-config-file is used, it is
ignored since sandboxed renderers do not have access to file
system.
3. Another bug is that --trace-config-file is always passed to
renderer processes, even if they are created after tracing is
stopped, e.g. via DevTools.
4. Startup tracing flags are not passed along to the ppapi plugin
and utility processes.
This CL fixes 1, 3, and 4 and partially fixes 2 by passing categories
and record mode of a trace config file using flags to sandboxed
renderer processes so that they do not need to ready these information
from a file. Obviously, this does not work for complex trace config
files, but should be enough to resolve existing telemetry issues
(please see discussions in crbug.com/809833).
Bug: 809833
Change-Id: I6723664fd477117262763476c0a86fd6881b94a7
Reviewed-on: https://chromium-review.googlesource.com/972145
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: oysteine <oysteine@chromium.org>
Commit-Queue: Ehsan Chiniforooshan <chiniforooshan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#545950}
It has no callers, except from content::BrowserChildProcessHostDelegate,
which also has no callers for its CanShutdown() method.
Change-Id: I9070bc84adbb2f1221f6e7822420a1e743088b84
Reviewed-on: https://chromium-review.googlesource.com/928098
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#538156}
CL generated by
git grep -l NON_EXPORTED_BASE | xargs sed -i 's/NON_EXPORTED_BASE(\([^)]*\))/\1/g'
git cl format
I'm not changing compiler_specific.h itself in this cl, to keep the revert
small if the subsequent removal of the actual macro should break something.
Bug: 752837
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_site_isolation;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: I53d6460e592b91a173f7aa55dfdb05631e51e5f7
Reviewed-on: https://chromium-review.googlesource.com/614703
Reviewed-by: Brett Wilson <brettw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#494486}
This continues the replacement of the inaccurate EDK API model of
"parent" and "child" process relationships with something that more
accurately reflects the behavior of the system. This terminology
change only affects the public API for now, so the underlying
protocol details remain poorly named.
Rather than implying that a process may only be introduced into the
process graph by its parent, and rather than giving the developer a
series of public, stateless API functions to set up interprocess
connections, this CL introduces the concept of an "invitation" to join a
group of interconnected Mojo embedders.
If a process is acting as the broker, or is itself already a broker
client, it may send an OutgoingBrokerClientInvitation over some OS IPC
resource (e.g. an OS pipe). The target process can then construct an
IncomingBrokerClientInvitation from some corresponding OS IPC resource
(e.g. the other end of that pipe) which has been shared with it
out-of-band. This object can be used to accept the invitation and thus
join the process graph as a new broker client.
Cross-process bootstrap message pipes may be "attached" to an invitation
by the sender and "extracted" by the accepting process.
Note that in order to facilitate the new pipe attachment API which
encourages user-selected message pipe names (rather than much less
convenient unguessable nonces that require more out-of-band
communication), port reservations made on behalf of outgoing invitations
are now strictly scoped to the invitation target, allowing names to be
reused for different invitations and avoiding any risk of a misbehaving
process claiming someone else's port.
The vast majority of changes outside //mojo here are strictly aesthetic
adaptations to the new API and do not constitute any kind of behavioral
change.
Follow-up CLs will replace usage of SetParentPipeHandle* and
CreateChildMessagePipe with IncomingBrokerClientInvitation API usage,
and eliminate the peer-connection-related functions with a
new stateful PeerConnection object; thus completing the public API
changes necessary to support the transition to a more flexible
transport protocol selection.
BUG=696031
Change-Id: I4b9a8f76fc8457b31a3dc1390ecec3fc0235b732
Reviewed-on: https://chromium-review.googlesource.com/498972
Commit-Queue: Ken Rockot <rockot@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Jay Civelli <jcivelli@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#470863}
- This was a pretty viral change, sorry about the size.
- Specifically, had to make all the *Host classes use
BindInterface() to request interfaces from their children, thus
replacing their GetRemoteInterfaces() accessor with a
BindInterface() call.
- This also has to eliminate any use of service_manager::Connection
as an indicator of the lifetime of the connection, hence the
introduction of child.mojom as a means of monitoring the lifetime
of the renderer connection.
- I had to tweak the expectations of the EmbeddedWorkerInstance test
as queuing order changed slightly with the new BindInterface mocking.
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation
Review-Url: https://codereview.chromium.org/2766263009
Cr-Commit-Position: refs/heads/master@{#461826}
Replaces ad hoc ChildProcessLaunched etc functions and "child tokens"
with a scoping PendingProcessConnection object. This encapsulates the
concept of a process to which we intend to connect (e.g. so we can start
vending message pipe handles for it) but which may not yet be reachable,
and it ensures that any associated resources are reliably cleaned
up in the event that we never actually connect to the process.
This API also begins an intentional departure from the now-inaccurate
naming conventions of "parent" and "child" used at the EDK layer to
refer to some relative process relationships.
BUG=682794
Review-Url: https://codereview.chromium.org/2680973006
Cr-Commit-Position: refs/heads/master@{#449457}
Set up a mojom connection for content-browser to talk to content-gpu
through the mojom.GpuMain interface. Subsequent CLs will add code to
allow chrome-browser to set up a mojom.GpuService connection through
GpuMain to the gpu process. This GpuService will replace the existing
chrome-ipc messages between chrome-browser and chrome-gpu.
BUG=643746, 630895
Review-Url: https://codereview.chromium.org/2625933002
Cr-Commit-Position: refs/heads/master@{#443044}
Instead of always logging the message ID, log a custom error string.
This is necessary for when the messages are converted to mojo messages,
where the messages do not have a corresponding ID.
BUG=643746
Review-Url: https://codereview.chromium.org/2624613003
Cr-Commit-Position: refs/heads/master@{#442790}
This is the first child process outside of content to be connected to
the ServiceManager so this CL adds a way for content embedders to
provide additional service manifests via ContentBrowserClient. This
would introduce an unnecessary string copy when obtaining service
manifest overlays, so this changes that API to take a StringPiece.
BUG=666605
TBR=kmarshall@chromium.org
Review-Url: https://codereview.chromium.org/2501913002
Cr-Commit-Position: refs/heads/master@{#440299}
Move power monitor implmentations from //content into //device/power_monitor
Unittests are also moved from content_unittests target to device_unittests.
BUG=647247
Review-Url: https://codereview.chromium.org/2460823002
Cr-Commit-Position: refs/heads/master@{#431518}
Mojoify PoweMonitorMessageBroadcaster is the first step of "Decoupling Power
Monitor from //Content".
PowerMonitorMessageBroadcaster sends messages to both RenderProcess and other
ChildProcess. This CL Mojoifies the messages PowerMonitorMsg_PowerStateChange,
PowerMonitorMsg_Suspend, and PowerMonitorMsg_Resume. To do so we introduce the
PowerMonitorClient Mojo interface and change the PowerMonitorBroadcastSource to
implement the interface.
To avoid configure PowerMonitorClientPtr separately in {child,render}_process_
host_impl.cc, we add the PowerMonitor mojo interface, and add the
BrowserChildProcessHost::ConnectionFilterImpl so it can register the mojo
interface implementation in BrowserChildProcessHostImpl side.
Unit tests for PowerMonitorMessageBroadcaster and PowerMonitorBroadcastSource
are changed accordingly.
Followup will decouple PowerMonitorMessageBroadcaster and
PowerMonitorBroadcastSource from //Content.
BUG=647247
Review-Url: https://codereview.chromium.org/2433203003
Cr-Commit-Position: refs/heads/master@{#427965}
Change the method by which we share field trial state from using a
SharedMemory class to SharedPersistentMemoryAllocator. Adds this
allocator to the base::FieldTrialList singleton, so there is only one copy
of this state on the browser process vs. a copy for each process host
which is how it currently works (from
https://codereview.chromium.org/2365273004/)
BUG=653874
Review-Url: https://codereview.chromium.org/2412113002
Cr-Commit-Position: refs/heads/master@{#427378}
Presubmit skipped to avoid errors being triggered by things which
aren't actually changing here.
Strictly a rename CL.
BUG=None
R=ben@chromium.org
NOPRESUBMIT=True
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation
Review-Url: https://codereview.chromium.org/2420253002
Cr-Commit-Position: refs/heads/master@{#425570}
This plumbs the field trial state string from the gpu and renderer host
processes and puts it in shared memory, passes the shared memory handle
(and length) via a command-line flag to the child, and the child will
initialize it there.
BUG=131632
Review-Url: https://codereview.chromium.org/2365273004
Cr-Commit-Position: refs/heads/master@{#425013}
This allows metrics to survive and be collected even if a
subprocess terminates before reporting.
Only the GPU process is monitored with this CL but it should
be trivial to add the remaining ones going forward.
BUG=546019
Review-Url: https://codereview.chromium.org/2224063002
Cr-Commit-Position: refs/heads/master@{#413452}
Rather than have individual BrowserChildProcessHostImpl users
create their own connection, this moves all that junk into BCPHI
and allows its users to configure it with a service name and
instance ID.
Also changes ChildProcessHost to support ChannelMojo connection
via remote interfaces provided by its delegate, and uses this
in conjunction with the BCPHI changes. Eliminates one more use
of kMojoChannelToken.
BUG=623396
R=ben@chromium.org
Committed: https://crrev.com/8efa71b85282fb4df1d3836a20d086d223df714f
Review-Url: https://codereview.chromium.org/2221153003
Cr-Original-Commit-Position: refs/heads/master@{#410937}
Cr-Commit-Position: refs/heads/master@{#413232}
Reason for revert:
ContentBrowserTest.BrowserCrashCallStack/RendererCrashCallStack are failing on
"Linux Tests (dbg)(1)" and "Linux Tests (dbg)(1)(32)" since this CL. Reproduced
locally and bisected to "Establish MojoChildConnection from
BrowserChildProcessHostImpl", also verified that reverting it on master locally
fixes the problem.
When it fails, the tests stall for a long time before failing. Sample from bot:
ContentBrowserTest.RendererCrashCallStack (run #1):
[ RUN ] ContentBrowserTest.RendererCrashCallStack
[11795:11795:0810/064214:8507100974:WARNING:audio_manager.cc(317)] Multiple instances of AudioManager detected
[11795:11795:0810/064214:8507101034:WARNING:audio_manager.cc(278)] Multiple instances of AudioManager detected
Xlib: extension "RANDR" missing on display ":9".
BrowserTestBase signal handler received SIGTERM. Backtrace:
#0 0x7fdba1ca413e base::debug::StackTrace::StackTrace()
#1 0x00000145ffaa content::(anonymous namespace)::DumpStackTraceSignalHandler()
#2 0x7fdb929cf0b0 <unknown>
#3 0x7fdb92d65d2b __libc_read
#4 0x7fdba1db7e42 base::GetAppOutputInternal()
#5 0x7fdba1db7ff6 base::GetAppOutputAndError()
#6 0x000000993436 content::ContentBrowserTest_RendererCrashCallStack_Test::RunTestOnMainThread()
#7 0x00000144f6ae content::ContentBrowserTest::RunTestOnMainThreadLoop()
#8 0x00000145fd24 content::BrowserTestBase::ProxyRunTestOnMainThreadLoop()
#9 0x0000005b969d _ZN4base8internal13FunctorTraitsIMN4mojo13StrongBindingIN6device14BatteryMonitorEEEFvvEvE6InvokeIPS6_JEEEvS8_OT_DpOT0_
#10 0x0000005b95f1 _ZN4base8internal12InvokeHelperILb0EvE8MakeItSoIRKMN4mojo13StrongBindingIN6device14BatteryMonitorEEEFvvEJPS8_EEEvOT_DpOT0_
#11 0x000001461247 _ZN4base8internal7InvokerINS0_9BindStateIMN7content15BrowserTestBaseEFvvEJNS0_17UnretainedWrapperIS4_EEEEEFvvEE7RunImplIRKS6_RKSt5tupleIJS8_EEJLm0EEEEvOT_OT0_NS_13IndexSequenceIJXspT1_EEEE
#12 0x0000014611ac _ZN4base8internal7InvokerINS0_9BindStateIMN7content15BrowserTestBaseEFvvEJNS0_17UnretainedWrapperIS4_EEEEEFvvEE3RunEPNS0_13BindStateBaseE
#13 0x0000005b971e base::Callback<>::Run()
#14 0x0000015920a8 content::ShellBrowserMainParts::PreMainMessageLoopRun()
#15 0x7fdba3457031 content::BrowserMainLoop::PreMainMessageLoopRun()
#16 0x7fdba29ee2bd _ZN4base8internal13FunctorTraitsIMN4mojo10BindingSetIN7content5mojom14ProcessControlEE7ElementEFvvEvE6InvokeIPS8_JEEEvSA_OT_DpOT0_
#17 0x7fdba345f091 _ZN4base8internal12InvokeHelperILb0EiE8MakeItSoIRKMN7content15BrowserMainLoopEFivEJPS5_EEEiOT_DpOT0_
#18 0x7fdba345f037 _ZN4base8internal7InvokerINS0_9BindStateIMN7content15BrowserMainLoopEFivEJNS0_17UnretainedWrapperIS4_EEEEEFivEE7RunImplIRKS6_RKSt5tupleIJS8_EEJLm0EEEEiOT_OT0_NS_13IndexSequenceIJXspT1_EEEE
#19 0x7fdba345ef9c _ZN4base8internal7InvokerINS0_9BindStateIMN7content15BrowserMainLoopEFivEJNS0_17UnretainedWrapperIS4_EEEEEFivEE3RunEPNS0_13BindStateBaseE
#20 0x7fdba29ee36e base::Callback<>::Run()
#21 0x7fdba3ef057b content::StartupTaskRunner::RunAllTasksNow()
#22 0x7fdba3455033 content::BrowserMainLoop::CreateStartupTasks()
#23 0x7fdba346164d content::BrowserMainRunnerImpl::Initialize()
#24 0x000001541fc4 ShellBrowserMain()
#25 0x000001521e46 content::ShellMainDelegate::RunProcess()
#26 0x7fdba5057e3b content::RunNamedProcessTypeMain()
#27 0x7fdba505a172 content::ContentMainRunnerImpl::Run()
#28 0x7fdba5056f42 content::ContentMain()
#29 0x00000145fa46 content::BrowserTestBase::SetUp()
#30 0x00000144f52d content::ContentBrowserTest::SetUp()
#31 0x0000016a05da testing::internal::HandleSehExceptionsInMethodIfSupported<>()
#32 0x000001691b0e testing::internal::HandleExceptionsInMethodIfSupported<>()
#33 0x0000016868a3 testing::Test::Run()
#34 0x000001687098 testing::TestInfo::Run()
#35 0x00000168763a testing::TestCase::Run()
#36 0x00000168c98c testing::internal::UnitTestImpl::RunAllTests()
#37 0x0000016a4d6a testing::internal::HandleSehExceptionsInMethodIfSupported<>()
#38 0x0000016931ee testing::internal::HandleExceptionsInMethodIfSupported<>()
#39 0x00000168c62f testing::UnitTest::Run()
#40 0x0000014d1d11 RUN_ALL_TESTS()
#41 0x0000014d0bc2 base::TestSuite::Run()
#42 0x00000145edcc content::ContentTestLauncherDelegate::RunTestSuite()
#43 0x00000149b712 content::LaunchTests()
#44 0x00000145ec28 main
#45 0x7fdb929ba7ed __libc_start_main
#46 0x0000005612c5 <unknown>
Original issue's description:
> Establish MojoChildConnection from BrowserChildProcessHostImpl
>
> Rather than have individual BrowserChildProcessHostImpl users
> create their own connection, this moves all that junk into BCPHI
> and allows its users to configure it with a service name and
> instance ID.
>
> Also changes ChildProcessHost to support ChannelMojo connection
> via remote interfaces provided by its delegate, and uses this
> in conjunction with the BCPHI changes. Eliminates one more use
> of kMojoChannelToken.
>
> BUG=623396
> R=ben@chromium.org
>
> Committed: https://crrev.com/8efa71b85282fb4df1d3836a20d086d223df714f
> Cr-Commit-Position: refs/heads/master@{#410937}
TBR=ben@chromium.org,rockot@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=623396
Review-Url: https://codereview.chromium.org/2230283003
Cr-Commit-Position: refs/heads/master@{#411039}
Rather than have individual BrowserChildProcessHostImpl users
create their own connection, this moves all that junk into BCPHI
and allows its users to configure it with a service name and
instance ID.
Also changes ChildProcessHost to support ChannelMojo connection
via remote interfaces provided by its delegate, and uses this
in conjunction with the BCPHI changes. Eliminates one more use
of kMojoChannelToken.
BUG=623396
R=ben@chromium.org
Review-Url: https://codereview.chromium.org/2221153003
Cr-Commit-Position: refs/heads/master@{#410937}