0
Commit Graph

130 Commits

Author SHA1 Message Date
Ali Hijazi
a56154dd81 Extend MiraclePtr coverage to more containers
This rewrites the following containers:
std::list, std::unordered_set, base::flat_set, std::stack, std::queue.

This patch was generated by running
./tools/clang/rewrite_templated_container_fields/rewrite-multiple-platforms.sh

Binary size increase:
The increase is only (~9.5kB) above the per-patch limit (+16kB). This
is not a lot given the size of the rewrite. Increase of around 500kb was
approved for MiraclePtr.

AX-Relnotes: n/a.
Binary-Size: See commit description.
Bug: 325302189
Change-Id: I969ae345ef6d6117d5c1773773be913197ca2e73
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5306923
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Ali Hijazi <ahijazi@chromium.org>
Owners-Override: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1265100}
2024-02-26 10:21:17 +00:00
Roger McFarlane
cba0e90d4f Pass the histogram shared memory region on child process launch.
This CL, behind a flag, updates the create/share flow for the histogram shared memory region between the browser process and its child processes. This allows the child processes to immediately allocate metrics from the shared memory region instead of waiting until the first browser/child IPC.

For the renderer, the shared memory region and allocator are created before the child is launched. This was already the case for the other child processes.

In the browser, the child process hosts expose the shared memory region to the ChildProcessLauncher/Helper so that the handle to the shared memory region passed to the child process on launch.

In the child, the metrics service initializes its histogram allocator to use the shared memory, on seeing the --histogram-shared-memory-region parameter.

See:

  * go/improve-chrome-subprocess-metrics

Bug: 1028263, 1290457
Change-Id: I3dc7d59c42b6588dbf8ea31ca05254470d0a8b30
Low-Coverage-Reason: COVERAGE_UNDERREPORTED (crbug.com/1512202)
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4568968
Reviewed-by: Alexei Svitkine <asvitkine@chromium.org>
Reviewed-by: Camille Lamy <clamy@chromium.org>
Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Mark Seaborn <mseaborn@chromium.org>
Commit-Queue: Roger McFarlane <rogerm@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1251503}
2024-01-24 17:51:37 +00:00
Dave Tapuska
0189cf30e3 Remove AddFilter when legacy IPC is disabled in content
- Conditionally include browser_message_filter.h/cc in the build
- Remove unused imports of browser_message_filter.h
- Remove unused chrome::bad_message::ReceivedBadMessage
- Remove unused BrowserAssociatedInterface

Bug: 993189
Change-Id: Icf114631fbc495b660aafe1a148e716cc7a19f25
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5177633
Reviewed-by: David Bertoni <dbertoni@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Bo Liu <boliu@chromium.org>
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Dominic Farolino <dom@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1244658}
2024-01-09 15:06:14 +00:00
Matthew Denton
66b2fa5ba5 Linux/Cros: Proxy SetThreadType calls out of sandboxed processes
As a followup to https://crrev.com/c/4898004, this uses
content::mojom::ThreadTypeSwitcher mojo interface in the GPU and
utility processes by instantiating a SandboxedProcessThreadTypeHandler
in those processes.

Bug: 1317590
Change-Id: I195df85221dc087504f723bb51e046d9b72ff1c9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4918825
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Matthew Denton <mpdenton@chromium.org>
Reviewed-by: Francois Pierre Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1210563}
2023-10-17 00:54:22 +00:00
Patrick Monette
20997a2587 Migrate callers of Process::Set/isProcessBackgrounded
To keep ChildProcessLauncher in line with the base::Process API,
SetProcessBackgrounded is renamed to SetProcessPriority and its own
callers are updated. The change bubbles up to
BrowserChildProcessHostImpl

R=boliu@chromium.org

Bug: 1466479
Change-Id: I241a45cd3a7470577344bbcc1fc3b943ab4a3073
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4752878
Reviewed-by: Bo Liu <boliu@chromium.org>
Commit-Queue: Bo Liu <boliu@chromium.org>
Auto-Submit: Patrick Monette <pmonette@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1180383}
2023-08-07 17:30:17 +00:00
Patrick Monette
15f0847c6b Rename child_process_ to child_process_launcher_
This is a readability improvement that also makes it more in line with
the usage of ChildProcessLauncher in render_process_host_impl.cc.

Bug: 1466479
Change-Id: I4fd20d994be0206becb7b2cac104010170292441
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4706725
Reviewed-by: Bo Liu <boliu@chromium.org>
Commit-Queue: Patrick Monette <pmonette@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1173814}
2023-07-22 03:53:20 +00:00
Irina Fedorova
57c8c928e1 [Code Health] remove ChildProcess.BadMessgeTerminated expired histogram
Removes ChildProcess.BadMessgeTerminated expired histogram and code
related to it.

Bug: 1384621
Change-Id: Ida688f01b8c5c11a1e3781fb126fb6ee99512044
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4386663
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Alexei Svitkine <asvitkine@chromium.org>
Commit-Queue: Alexei Svitkine <asvitkine@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1125358}
2023-04-03 15:07:34 +00:00
Patrick Monette
31020ea48d Reland "[MacOS] New feature to adjust the backgrounded state of the GPU process"
This is a reland of commit 246a72ce07

The major change is to the test. There used to be an interactive UI
test but it was flaky. To try to make the test more deterministic,
the OS notifications are simulated in a regular browsertest instead.

Original change's description:
> [MacOS] New feature to adjust the backgrounded state of the GPU process
>
> The new feature (named "AdjustGpuProcessPriority") ensures the
> backgrounded state of the GPU process mirrors the backgrounded state
> of the browser process.
>
> Bug: 1400472
> Change-Id: I284c21ef27536abe3548aa1338e1464e25ddde89
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4085787
> Commit-Queue: Patrick Monette <pmonette@chromium.org>
> Reviewed-by: Bo Liu <boliu@chromium.org>
> Reviewed-by: Kenneth Russell <kbr@chromium.org>
> Reviewed-by: Mark Mentovai <mark@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1100196}

Bug: 1400472
Change-Id: I1b2d2fafbd880c5abc3f97b74c9d7fdd0d3a7c42
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4219232
Reviewed-by: Francois Pierre Doray <fdoray@chromium.org>
Reviewed-by: Bo Liu <boliu@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Commit-Queue: Patrick Monette <pmonette@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1115500}
2023-03-10 01:48:31 +00:00
Meredith Lane
55cd159dde Revert "[MacOS] New feature to adjust the backgrounded state of the GPU process"
This reverts commit 246a72ce07.

Reason for revert: Speculative revert, suspected as cause of WebAppIntegration failures on multiple Mac bots, eg https://ci.chromium.org/ui/p/chromium/builders/ci/Mac10.14%20Tests/31178/blamelist

Original change's description:
> [MacOS] New feature to adjust the backgrounded state of the GPU process
>
> The new feature (named "AdjustGpuProcessPriority") ensures the
> backgrounded state of the GPU process mirrors the backgrounded state
> of the browser process.
>
> Bug: 1400472
> Change-Id: I284c21ef27536abe3548aa1338e1464e25ddde89
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4085787
> Commit-Queue: Patrick Monette <pmonette@chromium.org>
> Reviewed-by: Bo Liu <boliu@chromium.org>
> Reviewed-by: Kenneth Russell <kbr@chromium.org>
> Reviewed-by: Mark Mentovai <mark@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1100196}

Bug: 1400472
Change-Id: Ib60528cd0900e46b89c58cac0b083133026f5ff5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4216751
Reviewed-by: Meredith Lane <meredithl@chromium.org>
Auto-Submit: Meredith Lane <meredithl@chromium.org>
Owners-Override: Meredith Lane <meredithl@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Meredith Lane <meredithl@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1100268}
2023-02-02 04:11:42 +00:00
Patrick Monette
246a72ce07 [MacOS] New feature to adjust the backgrounded state of the GPU process
The new feature (named "AdjustGpuProcessPriority") ensures the
backgrounded state of the GPU process mirrors the backgrounded state
of the browser process.

Bug: 1400472
Change-Id: I284c21ef27536abe3548aa1338e1464e25ddde89
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4085787
Commit-Queue: Patrick Monette <pmonette@chromium.org>
Reviewed-by: Bo Liu <boliu@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1100196}
2023-02-02 00:36:49 +00:00
Will Harris
cd57b83d9f Move ChildProcessHost* from content/common to content/browser
This is a prerequisite for moving a browser-only API that is
used by ChildProcessHostImpl from common to browser.

BUG=1402942

Change-Id: I6eea0952e6bf1ef30498b6f465067e599ea0ff53
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4134795
Commit-Queue: Will Harris <wfh@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Owners-Override: Nasko Oskov <nasko@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1089401}
2023-01-05 20:03:10 +00:00
Patrick Monette
3ded71b389 Reland "Add BrowserChildProcessExitedNormally"
This is a reland of commit e97ada6c24

The revert did not fix the issue so I'm relanding it as-is. The
failing test was disabled in another CL.

Original change's description:
> Add BrowserChildProcessExitedNormally
>
> This new method allows an observer to get the ChildTerminationInfo data
> from a child process that terminates normally.
>
> Bug: 1313215
> Change-Id: Iafd41d9b54e3a47014d350aac0a7658d72ffa9b4
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3792828
> Commit-Queue: Patrick Monette <pmonette@chromium.org>
> Reviewed-by: John Abd-El-Malek <jam@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1050887}

Bug: 1313215
Change-Id: Idc623d03b1dde7fbc3f99913f5cecef99806c26e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3918751
Commit-Queue: Patrick Monette <pmonette@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1052399}
2022-09-28 14:53:04 +00:00
Alex Ilin
bbeb404a7c Revert "Add BrowserChildProcessExitedNormally"
This reverts commit e97ada6c24.

Reason for revert: BrowserChildProcessObserverBrowserTest.LaunchAndCrash is failing on builder "android-arm64-tests" (https://crbug.com/1368044)

Original change's description:
> Add BrowserChildProcessExitedNormally
>
> This new method allows an observer to get the ChildTerminationInfo data
> from a child process that terminates normally.
>
> Bug: 1313215
> Change-Id: Iafd41d9b54e3a47014d350aac0a7658d72ffa9b4
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3792828
> Commit-Queue: Patrick Monette <pmonette@chromium.org>
> Reviewed-by: John Abd-El-Malek <jam@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1050887}

Bug: 1313215, 1368044
Change-Id: Ice434214a1042b12df71251d1795c9d3a90423cf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3917852
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Alex Ilin <alexilin@chromium.org>
Owners-Override: Alex Ilin <alexilin@google.com>
Cr-Commit-Position: refs/heads/main@{#1051180}
2022-09-26 13:15:58 +00:00
Patrick Monette
e97ada6c24 Add BrowserChildProcessExitedNormally
This new method allows an observer to get the ChildTerminationInfo data
from a child process that terminates normally.

Bug: 1313215
Change-Id: Iafd41d9b54e3a47014d350aac0a7658d72ffa9b4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3792828
Commit-Queue: Patrick Monette <pmonette@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1050887}
2022-09-24 01:12:13 +00:00
Avi Drissman
4e1b7bc33d Update copyright headers in content/
The methodology used to generate this CL is documented in
https://crbug.com/1098010#c34.

No-Try: true
No-Presubmit: true
Bug: 1098010
Change-Id: I8c0f009d16350271f07d8e5e561085822cc9dd27
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3895935
Owners-Override: Avi Drissman <avi@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
Auto-Submit: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1047456}
2022-09-15 14:03:50 +00:00
Patrick Monette
025d46549b Fix BrowserChildProcessHostDisconnected
With this change, BrowserChildProcessHostDisconnected is no longer
called if BrowserChildProcessLaunchedAndConnected is never sent.

The only exception is in single process mode, where a launched and
connected notification doesn't make sense, yet
InProcessUtilityThreadHelper still depends on the disconnect
notification.

Another change is that IsProcessLaunched() now correctly handles the
case where SetProcess() is used instead of the launch helpers.

Bug: 1342943
Change-Id: Ib11fedf3d36e9781faef1723f8d3b5daea78f5ef
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3791225
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Patrick Monette <pmonette@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1029561}
2022-07-29 01:04:06 +00:00
Eriko Kurimoto
9c83b40ac0 [Resource file sharing]: Pass BrowserInitParams to Utility process as File Descriptor
This CL passes BrowserInitParams to Utility process as Memory FD.
FD map is contained in BrowserChildProcessHost::DataToPassAsFD with
files_to_preload.

This CL also changes files_to_preload field to limit only on posix
platforms.
Note that files_to_preload value was only used from posix even without
this CL, so it won't affect the behavior.

This change aims to let utility process be able to obtain ash dir from BrowserInitParams. This feature will be implemented in the later CL.
This is a part of resource file sharing work and doesn't affect the
behavior for now.

Bug: 1253280
Change-Id: Ibd92217974e2e763c58ab71af85ee50a13d2c03e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3599393
Reviewed-by: Bo Liu <boliu@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Hidehiko Abe <hidehiko@chromium.org>
Commit-Queue: Eriko Kurimoto <elkurin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1001877}
2022-05-11 02:36:32 +00:00
Xiaohan Wang
1ecfd006fd content: Use BUILDFLAG for OS checking
Use BUILDFLAG(IS_XXX) instead of defined(OS_XXX).

Generated by `os_buildflag_migration.py` (https://crrev.com/c/3311983).

R=thakis@chromium.org

Bug: 1234043
Test: No functionality change
Change-Id: Ia0eae6f9396065e190929d42600012c9324c07e9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3399774
Commit-Queue: Xiaohan Wang <xhwang@chromium.org>
Owners-Override: Xiaohan Wang <xhwang@chromium.org>
Auto-Submit: Xiaohan Wang <xhwang@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Owners-Override: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#961157}
2022-01-19 22:33:10 +00:00
Lei Zhang
0306cbaff6 Remove unneeded base/compiler_specific.h includes in //content and //ui.
Bug: 242216
Change-Id: Id89d638f8859731d00ab17b760f93dd77a2df7a1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3292226
Auto-Submit: Lei Zhang <thestig@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Owners-Override: Avi Drissman <avi@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#946514}
2021-11-30 17:32:28 +00:00
Keishi Hattori
0e45c020c4 Rewrite most Foo* field_ pointer fields to raw_ptr<Foo> field_.
DO NOT REVERT (unless absolutely necessary)! Report build breaks to keishi@(APAC)/glazunov@(EMEA)/sebmarchand@(NA) as soon as you see them. Fixes are expected to be trivial.

This commit was generated automatically, by running the following script: tools/clang/rewrite_raw_ptr_fields/rewrite-multiple-platforms.sh on commit fe74bc434e

For more information, see MiraclePtr One Pager [1], the PSA at chromium-dev@ [2], and the raw_ptr documentation in //base/memory/raw_ptr.md.

FYI This CL does not enable MiraclePtr protection and we expect no behavior change from this.

[1] https://docs.google.com/document/d/1pnnOAIz_DMWDI4oIOFoMAqLnf_MZ2GsrJNb_dbQ3ZBg/edit?usp=sharing
[2] https://groups.google.com/a/chromium.org/g/chromium-dev/c/vAEeVifyf78/m/SkBUc6PhBAAJ

Binary-Size: Increase of around 500kb was approved for MiraclePtr
Include-Ci-Only-Tests: true
No-Tree-Checks: true
No-Presubmit: true
Bug: 1272324, 1073933
Change-Id: I05c86a83bbb4b3f4b017f361dd7f4e7437697f69
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3305132
Commit-Queue: Keishi Hattori <keishi@chromium.org>
Reviewed-by: Bartek Nowierski <bartekn@chromium.org>
Owners-Override: Bartek Nowierski <bartekn@chromium.org>
Cr-Commit-Position: refs/heads/main@{#945735}
2021-11-27 09:25:52 +00:00
Lei Zhang
ed9be3a428 Remove many unneeded CONTENT_EXPORT entries.
Many classes within content don't need CONTENT_EXPORT because they are
not in content/public and they are not directly used from tests.

Change-Id: I22696b3840ab7a89371184e866b05d0b4980e7dc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3288753
Auto-Submit: Lei Zhang <thestig@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Owners-Override: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#942828}
2021-11-17 22:01:18 +00:00
Lei Zhang
7ab31375dd Do IWYU for content_export.h
Headers that use CONTENT_EXPORT should include content_export.h.

Change-Id: I66b65c9c3a963d1f4677172b12ef0966448e1609
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3282640
Commit-Queue: Lei Zhang <thestig@chromium.org>
Auto-Submit: Lei Zhang <thestig@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Owners-Override: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#942394}
2021-11-17 01:26:00 +00:00
Fabrice de Gans
24f4a80bee [field-trial] Refactor FieldTrial and add Fuchsia support
This refactors FieldTrial to simplify its public API and unify it
across all platforms so every public method has the same signature on
every platform.

This simplifies the call sites in the content layer by removing
per-platform specific call sites in favor of unified calls and moving
some of the logic done in //content to //base. In particular, command
line switches used only by FieldTrial have been moved to //base, from
//content. They are also no longer passed as parameters to the public
API of FieldTrial.

In addition, this adds supports for shared-memory distribution of
FieldTrial configuration to child processes on Fuchsia. This is
achieved by duplicating the handle for the VMO backing the FieldTrial
configuration in the parent process and passing it to the child
process startup handles.

This also changes the Windows child process launcher logic to make use
of the provided LaunchOptions argument, rather than initializing a new
object.

Finally, this cleans up header usage in //base/metrics/field_trial.h
and fixes missing includes in various parts of the code base.

Bug: 752368, 1262370
Change-Id: I9b0836b467790f1da96d85fe16a6e2c6d334f709
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3230582
Commit-Queue: Fabrice de Gans <fdegans@chromium.org>
Reviewed-by: Wez <wez@chromium.org>
Reviewed-by: Alexei Svitkine <asvitkine@chromium.org>
Reviewed-by: Primiano Tucci <primiano@chromium.org>
Reviewed-by: Theresa  <twellington@chromium.org>
Reviewed-by: Ken Rockot <rockot@google.com>
Reviewed-by: Will Harris <wfh@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Cr-Commit-Position: refs/heads/main@{#938902}
2021-11-05 19:57:14 +00:00
Patrick Monette
643cdf6190 Replace base/task/ temporary forward headers with their final locations
Note to QA: This merely changes includes and should not be blamed
for files it touched.

Bug: 1255932
Change-Id: I1ce4e31efd5792ebf2080812e665cae838a54972
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3226943
Reviewed-by: Gabriel Charette <gab@chromium.org>
Owners-Override: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/main@{#932153}
2021-10-15 19:13:42 +00:00
Patrick Monette
3d7d70920a Replace task-related headers to their equivalent in base/task/
This CL was generated by using tools/git/move_source_file.py to change
the includes for those files:
base/bind_post_task.h
base/deferred_sequenced_task_runner.h
base/post_task_and_reply_with_result_internal.h
base/sequenced_task_runner.h
base/sequenced_task_runner_helpers.h
base/single_thread_task_runner.h
base/task_runner.h
base/task_runner_util.h
base/updateable_sequenced_task_runner.h

Then formatted using "git cl format". DEPS files were fixed with a
simple search and replace script.

Bug: 1255932
Change-Id: I0d9b5ddd9260fde5e4581e6c6e0080bdb0ed2c44
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3209175
Reviewed-by: Gabriel Charette <gab@chromium.org>
Owners-Override: Gabriel Charette <gab@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/main@{#929867}
2021-10-08 20:27:23 +00:00
Ken Rockot
9836cfb755 Remove legacy IPC Channel for utility processes
This modifies Browser/ChildProcessHost and ChildThreadImpl to support
child processes which never establish a legacy IPC Channel, and
modifies UtilityProcessHost and UtilityThreadImpl to take advantage of
this.

This makes utility processes the first type of process to be completely
free of legacy IPC. GPU processes can follow shortly hereafter.

To facilitate this change, a few other details are modified here:

- BrowserChildProcessObserver no longer exposes a separate
  BrowserProcessHostConnected event. The only two consumers are
  migrated to BrowserChildProcessLaunchedAndConnected. This avoids
  potential re-entrancy issues when launching a process, since any
  hosts not using legacy IPC are considered to be connected
  synchronously as soon as launch is started.

- Browser/ChildProcessHost no longer acknowledges the PID received
  from the child process in IPC::Listener::OnChannelConnected,
  instead using the PID exposed directly from the
  ChildProcessLauncher. This is consistent whether or not the
  host creates a legacy IPC channel.

Bug: 616980, 993189
Change-Id: I881db61db335b70b658fe0dbf0c149703e7219e4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2959467
Commit-Queue: Ken Rockot <rockot@google.com>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Robert Kaplow <rkaplow@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Alex Gough <ajgo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#893209}
2021-06-16 23:16:02 +00:00
Ken Rockot
7f8a282a64 Move VizMain to its own interface pipe
VizMain is bound in the GPU process as an interface associated with the
main legacy IPC Channel. That Channel is no longer used for any other
purpose though, so the association serves no purpose. The only legacy
IPC Channels in use by the GPU process are created later, as an
implementation detail of Viz (via EstablishGpuChannel IPCs).

This changes the VizMain interface to use a regular interface pipe
instead of an associated interface.

Bug: None
Change-Id: Id6b3b6352f7d2327ab5c9808893155f2d5ce445a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2806255
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Reviewed-by: Ken Buchanan <kenrb@chromium.org>
Commit-Queue: Ken Buchanan <kenrb@chromium.org>
Auto-Submit: Ken Rockot <rockot@google.com>
Cr-Commit-Position: refs/heads/master@{#869760}
2021-04-06 23:27:52 +00:00
Jan Wilken Dörrie
aace0cfef2 [LSC] Replace base::string16 with std::u16string in //{chrome*,content}
This change replaces base::string16 with std::u16string in //chrome,
//chromecast, //chromeos and //content.

Reproduction steps:
$ git grep -lw 'base::string16' chrome* content | \
      xargs sed -i 's/\bbase::string16\b/std::u16string/g'
$ git cl format

Bug: 1184339
Change-Id: I8fae0ab25b5d9bf1cb416ae5f47d7f680fb8f3ea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2752229
Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Auto-Submit: Jan Wilken Dörrie <jdoerrie@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#862152}
2021-03-11 22:01:58 +00:00
Chinglin Yu
f4b1c65d37 Reland: "tracing: make PosixSystemProducer work in child processes on Posix."
This relands commit 305cf78bae with fixing
the flakiness of BackgroundTracingManagerBrowserTest.* in
content_browsertests. Fix by opening the socket to the system tracing
service on the right task runner.

Original change's description:
> The security sandbox forbids making socket connections directly from
> within most child processes (except the network utility process). Trace
> data for renderers are missing from a tracing session with Chrome data
> sources on non-Android Posix platforms.
>
> This change introduces a new Mojo interface, SystemTracingService, that
> is shared between the browser and child processes for making a socket
> connection to the system tracing service daemon. A child process
> receives a Mojo remote interface and then invokes the OpenProducerSocket
> method to open the socket connection in the browser process. The browser
> process then passes the socket connection to the child in the response.
> The child process then adopts the connected socket in initializing the
> connection in PosixSystemProducer.
>
> Full design doc: go/crosetto-chrome-producer-dd
>
> Bug: b/147789115
> Test: services_unittests: SystemTracingServiceTest.*,
>       SystemPerfettoTest.SandboxedOpenProducerSocket
> Change-Id: Id698dc656b7b9ede723e3a887532c33544914edc
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2435129
> Commit-Queue: Chinglin Yu <chinglinyu@chromium.org>
> Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
> Reviewed-by: Stephen Nusko <nuskos@chromium.org>
> Reviewed-by: Eric Seckler <eseckler@chromium.org>
> Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#844743}

Bug: 1169185
Test:content_browsertests --test-launcher-bot-mode \
--gtest_filter="BackgroundTracingManagerBrowserTest.*" \
--gtest_repeat=100

Change-Id: I02b4bc206013b9dbc91766b3d643d07d695ff87b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2643425
Reviewed-by: Ricky Liang <jcliang@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Eric Seckler <eseckler@chromium.org>
Commit-Queue: Chinglin Yu <chinglinyu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#847517}
2021-01-27 06:59:13 +00:00
Tommy Nyquist
c9f08fd70a Revert "tracing: make PosixSystemProducer work in child processes on Posix."
This reverts commit 305cf78bae.

Reason for revert: Crashing many browser tests, in particular BackgroundTracingManagerBrowserTest.*

Original change's description:
> tracing: make PosixSystemProducer work in child processes on Posix.
>
> The security sandbox forbids making socket connections directly from
> within most child processes (except the network utility process). Trace
> data for renderers are missing from a tracing session with Chrome data
> sources on non-Android Posix platforms.
>
> This change introduces a new Mojo interface, SystemTracingService, that
> is shared between the browser and child processes for making a socket
> connection to the system tracing service daemon. A child process
> receives a Mojo remote interface and then invokes the OpenProducerSocket
> method to open the socket connection in the browser process. The browser
> process then passes the socket connection to the child in the response.
> The child process then adopts the connected socket in initializing the
> connection in PosixSystemProducer.
>
> Full design doc: go/crosetto-chrome-producer-dd
>
>       SystemPerfettoTest.SandboxedOpenProducerSocket
>
> Bug: b/147789115
> Test: services_unittests: SystemTracingServiceTest.*,
> Change-Id: Id698dc656b7b9ede723e3a887532c33544914edc
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2435129
> Commit-Queue: Chinglin Yu <chinglinyu@chromium.org>
> Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
> Reviewed-by: Stephen Nusko <nuskos@chromium.org>
> Reviewed-by: Eric Seckler <eseckler@chromium.org>
> Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#844743}

TBR=kinuko@chromium.org,primiano@chromium.org,skyostil@chromium.org,eseckler@chromium.org,chinglinyu@chromium.org,nuskos@chromium.org,chromium-scoped@luci-project-accounts.iam.gserviceaccount.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: b/147789115, 1169185
Change-Id: Ibe932297b317fdee6cbd9ef5b09ad1aeffd2f1ad
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2643258
Reviewed-by: Tommy Nyquist <nyquist@chromium.org>
Reviewed-by: Primiano Tucci <primiano@chromium.org>
Commit-Queue: Tommy Nyquist <nyquist@chromium.org>
Cr-Commit-Position: refs/heads/master@{#845763}
2021-01-21 19:35:48 +00:00
Chinglin Yu
305cf78bae tracing: make PosixSystemProducer work in child processes on Posix.
The security sandbox forbids making socket connections directly from
within most child processes (except the network utility process). Trace
data for renderers are missing from a tracing session with Chrome data
sources on non-Android Posix platforms.

This change introduces a new Mojo interface, SystemTracingService, that
is shared between the browser and child processes for making a socket
connection to the system tracing service daemon. A child process
receives a Mojo remote interface and then invokes the OpenProducerSocket
method to open the socket connection in the browser process. The browser
process then passes the socket connection to the child in the response.
The child process then adopts the connected socket in initializing the
connection in PosixSystemProducer.

Full design doc: go/crosetto-chrome-producer-dd

      SystemPerfettoTest.SandboxedOpenProducerSocket

Bug: b/147789115
Test: services_unittests: SystemTracingServiceTest.*,
Change-Id: Id698dc656b7b9ede723e3a887532c33544914edc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2435129
Commit-Queue: Chinglin Yu <chinglinyu@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Stephen Nusko <nuskos@chromium.org>
Reviewed-by: Eric Seckler <eseckler@chromium.org>
Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
Cr-Commit-Position: refs/heads/master@{#844743}
2021-01-19 12:52:06 +00:00
Bo Liu
ae5b6def06 Dump gpu process on establish channel timeout
Android has a browser-side timeout for establish channel which is
usually the  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}
2020-06-01 19:44:51 +00:00
Lukasz Anforowicz
0d5c120800 Call DwoC synchronously from BrowserChildProcessHostImpl::OnMojoError.
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}
2020-03-18 21:10:05 +00:00
Ken Rockot
a7f8fed28b Reland "Move Utility processes off Service Manager"
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}
2019-12-04 06:17:31 +00:00
Ken Rockot
8dda8888b4 Reland "Reland "Move Renderer processes off Service Manager""
This reverts commit d10a4fc5f2.

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 "Reland "Move Renderer processes off Service Manager""
> 
> 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}

TBR=avi@chromium.org,boliu@chromium.org,rockot@google.com,nya@chromium.org,mbarbella@chromium.org,rsesek@chromium.org,yucliu@chromium.org

Change-Id: I69de741d907abd790bdad3019abeeb9a8ca231aa
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1028852, 977637
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1949778
Reviewed-by: Ken Rockot <rockot@google.com>
Commit-Queue: Ken Rockot <rockot@google.com>
Cr-Commit-Position: refs/heads/master@{#721377}
2019-12-04 05:56:22 +00:00
Shuhei Takahashi
d10a4fc5f2 Revert "Reland "Move Renderer processes off Service Manager""
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}
2019-12-03 13:35:16 +00:00
Shuhei Takahashi
bfca6c8096 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}
2019-12-03 13:33:33 +00:00
Ken Rockot
0a311ff4af 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}
2019-11-22 23:51:31 +00:00
Ken Rockot
881a65d746 Reland "Move Renderer processes off Service Manager"
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}
2019-11-22 22:49:07 +00:00
Ken Rockot
0885833dd1 Revert "Move Renderer processes off Service Manager"
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}
2019-11-22 01:06:50 +00:00
Ken Rockot
45cef59a78 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}
2019-11-22 00:20:58 +00:00
Ken Rockot
cbead33338 Move Tracing service off Service Manager
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}
2019-11-21 04:35:47 +00:00
Ken Rockot
692493fccf Move NaCl processes off Service Manager
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}
2019-11-18 22:36:57 +00:00
Ken Rockot
d7148c2084 Move Resource Coordinator off Service Manager (reland)
Original CL:
https://chromium-review.googlesource.com/c/chromium/src/+/1769102

PS2 is the original CL rebased. Diff PS2->PS11 to see the one-line fix
for bug 1000327. This is applied in addition to the base change in
https://chromium-review.googlesource.com/c/chromium/src/+/1810036 to fix
a more general race condition in render process host reuse.

This moves the Resource Coordinator Service off of Service Manager APIs
in favor of direct Mojo interface usage. A public browser API is exposed
to give content clients access to the service connection.

NOPRESUBMIT=true

Bug: 977637, 1000327
Change-Id: Id3742584f25b3891386e62789db1b4121b0d3007
TBR: dcheng@chromium.org
TBR: avi@chromium.org
TBR: yucliu@chromium.org
TBR: torne@chromium.org
TBR: erikchen@chromium.org
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1809098
Reviewed-by: François Doray <fdoray@chromium.org>
Reviewed-by: Ken Rockot <rockot@google.com>
Commit-Queue: Ken Rockot <rockot@google.com>
Cr-Commit-Position: refs/heads/master@{#697684}
2019-09-18 18:00:59 +00:00
François Doray
dfc6e947e5 Revert "Move Resource Coordinator off Service Manager"
This reverts commit 97afa4bd5c.

Reason for revert: https://crbug.com/1000327 - Causes failures in SelectFileDialogExtensionBrowserTest.*(CreateAndDestroy|DestroyListener)

Bug: 1000327

Original change's description:
> Move Resource Coordinator off Service Manager
>
> This moves the Resource Coordinator Service off of Service Manager APIs
> in favor of direct Mojo interface usage. A public browser API is exposed
> to give content clients access to the service connection.
>
> Bug: 977637
> Change-Id: I898228ad49e3be405e0bb746d00c23d057658680
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1769102
> Commit-Queue: Ken Rockot <rockot@google.com>
> Reviewed-by: François Doray <fdoray@chromium.org>
> Reviewed-by: Daniel Cheng <dcheng@chromium.org>
> Reviewed-by: Yuchen Liu <yucliu@chromium.org>
> Reviewed-by: Richard Coles <torne@chromium.org>
> Reviewed-by: Avi Drissman <avi@chromium.org>
> Reviewed-by: Erik Chen <erikchen@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#691742}

TBR=avi@chromium.org,dcheng@chromium.org,rockot@google.com,fdoray@chromium.org,torne@chromium.org,erikchen@chromium.org,yucliu@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

No-Presubmit: true
Bug: 977637
Change-Id: I225de1fa7214e3d4cb1dfe727c9c8e80d31bdffc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1782500
Commit-Queue: François Doray <fdoray@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#692765}
2019-09-03 19:14:27 +00:00
Ken Rockot
97afa4bd5c Move Resource Coordinator off Service Manager
This moves the Resource Coordinator Service off of Service Manager APIs
in favor of direct Mojo interface usage. A public browser API is exposed
to give content clients access to the service connection.

Bug: 977637
Change-Id: I898228ad49e3be405e0bb746d00c23d057658680
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1769102
Commit-Queue: Ken Rockot <rockot@google.com>
Reviewed-by: François Doray <fdoray@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Yuchen Liu <yucliu@chromium.org>
Reviewed-by: Richard Coles <torne@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Erik Chen <erikchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#691742}
2019-08-29 18:55:33 +00:00
Ken Rockot
8322a04ad5 Move Shape Detection off Service Manager
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}
2019-08-20 18:02:00 +00:00
Ken Rockot
4f8c3c3d0a Move Font Service off Service Manager
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}
2019-08-16 16:32:33 +00:00
Jeremy Roman
3bca4bf820 Use in-class initializers for base::WeakPtrFactory in content/.
Generated by: https://chromium-review.googlesource.com/c/chromium/src/+/1689216

Bug: 981415
Change-Id: I363f81e8c17cabfb6031666ca0846bcfcbf97b78
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1693602
Commit-Queue: Matt Falkenhagen <falken@chromium.org>
Reviewed-by: Matt Falkenhagen <falken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#676281}
2019-07-11 03:41:25 +00:00
Lucas Furukawa Gadani
0d5e714121 Remove more const interfaces from content/public.
Bug: 908139
Change-Id: Ib362d71f610a90fe094f3c4ed892ef578ebf85aa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1566417
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: Lucas Gadani <lfg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#652379}
2019-04-18 23:00:50 +00:00