0
Commit Graph

8 Commits

Author SHA1 Message Date
Sangbaek Park
23cea31a5d Fix use-of-uninitialized-value error by ChildProcessData on MSan tests
MSan test failed after landing crrev.com/c/5932764 with the error
message: `WARNING: MemorySanitizer: use-of-uninitialized-value`.
```
Uninitialized value was created by an allocation of 'child_process_data' in the stack frame
```

Failure CI bot link: https://ci.chromium.org/ui/p/chromium/builders/ci/Linux%20MSan%20Tests/51310/test-results?q=ExactID%3Aninja%3A%2F%2Fcomponents%3Acomponents_unittests%2FContentStabilityMetricsProviderTest.BrowserChildProcessObserverUtility+VHash%3Aa09c171ea35b3b9e

The landed CL is not the root cause of the MSan test failure but
just uncovered the potential `use-of-uninitialized-value` issue because
`ContentStabilityMetricsProvider::BrowserChildProcessCrashed()` reads
`sandbox_type` which was not set in the existing test cases.

Promoted `sandbox::mojom::Sandbox sandbox_type` as std::optional since
it can be invalid (or unknown) for some cases, plus the mojom
Enum doesn't have any proper one for invalid cases. `sandbox_type` can
be a lhs-value currently or in the future. For example, https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/ui/webui/sandbox/sandbox_handler.cc;drc=e6fc2038d73ef96ff47deda3146d94d25530e13b;l=47

Tests:
```
autoninja -C out\Default metrics_unittests
out\Default\metrics_unittests --single-process-tests --gtest_filter=ContentStabilityMetricsProviderTest.*

autoninja -C out\Default sandbox_unittests
out\Default\sandbox_unittests
```

Bug: b:368672525
Change-Id: I435f5a879b23f557d5b1456e3754366528ce8685
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5949437
Reviewed-by: Luc Nguyen <lucnguyen@google.com>
Reviewed-by: David Schinazi <dschinazi@chromium.org>
Reviewed-by: Will Harris <wfh@chromium.org>
Reviewed-by: Charlie Reis <creis@chromium.org>
Commit-Queue: Sangbaek Park <sangbaekpark@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1372950}
2024-10-23 21:43:11 +00:00
Avi Drissman
adac219925 Update header includes for /base/functional in /content
bind.h, callback.h, callback_forward.h, and callback_helpers.h
moved into /base/functional/. Update the include paths to
directly include them in their new location.

Bug: 1364441
Change-Id: I32ec425b9c0e52ec4b50047bf3290fecc5c905ff
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4148554
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Auto-Submit: Avi Drissman <avi@chromium.org>
Owners-Override: Avi Drissman <avi@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1091567}
2023-01-11 23:46:39 +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
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
Sebastien Marchand
db5895c0ac [PGO] Make the devtool protocol async
The synchronous version needs to use a nested run loop, which isn't
available on Android. Making the protocol asynchronous move the
responsibility of waiting for the profile dump request to be complete to
the caller. This means that Telemetry (main user of this protocol) will
be able to simply call this protocol and wait for it to complete (via
the reply callback) before terminating the browser process.

Bug: 1242138
Change-Id: Ic038f8fab186a40a0f5fe4423c70d2b18faf807e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3438767
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Sébastien Marchand <sebmarchand@google.com>
Cr-Commit-Position: refs/heads/main@{#973244}
2022-02-19 04:49:31 +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
Will Harris
6f5f50aba3 Only set profiling file for non-elevated browser child processes.
This CL moves the code that sets the profiling file from ChildProcess
into BrowserChildProcess.

It then no longer attempts to set the profiling file for elevated
browser child processes since it is not possible to pass a handle
to such a process as it is not permitted to duplicate a handle into
a process that cannot be opened, such as one running at a higher
integrity level.

This CL also has the consequence that the profiling file is no
longer passed to non-browser child processes which is just
chrome's ServiceUtilityProcessHost. Since this process is also
often running elevated (e.g. cloud print service) it is likely
this operation was never working correctly anyway.

BUG=1276198

Change-Id: I9684363ee4630583e90e31a4005cd1f26e60e050
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3313495
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Will Harris <wfh@chromium.org>
Cr-Commit-Position: refs/heads/main@{#948049}
2021-12-03 17:39:45 +00:00
Sebastien Marchand
113505a068 [PGO] Add a DevTool protocol to write the profiles to disk.
This will be used on Android to dump the profile files on disk at the
end of a benchmark.

Bug: 1242138
Change-Id: I811608501d9b8089d4ef241fccc029f3299cf73f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3237114
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Commit-Queue: Sebastien Marchand <sebmarchand@google.com>
Cr-Commit-Position: refs/heads/main@{#944213}
2021-11-22 20:14:47 +00:00