Using int32_t for the child process id can be fraught with peril.
Developers can mistake this for the PID. Bugs can be created by passing
in an invalid value by mistake. Using a strongly typed ChildProcessId
instead will allow the compiler to catch errors.
This change creates a ChildProcessId type and modifies
ChildProcessHost::GenerateChildProcessUniqueId to use this new type.
During the investigation, it was determined
GenerateChildProcessUniqueId should only be called on the UI thread,
so a check to ensure it's only called on the UI thread was added.
Follow-ups will be required to modify references.
Bug: 379869738
Change-Id: I3e3998a864a398c7323852969c01cc6186d89670
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6034112
Auto-Submit: Emily Andrews <emiled@microsoft.com>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Stefan Smolen <ssmole@microsoft.com>
Reviewed-by: Mike Wasserman <msw@chromium.org>
Commit-Queue: Mike Wasserman <msw@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1391188}
NOTREACHED() and NOTREACHED_IN_MIGRATION() are both CHECK-fatal now.
The former is [[noreturn]] so this CL also performs dead-code removal
after the NOTREACHED().
This CL does not attempt to do additional rewrites of any surrounding
code, like:
if (!foo) {
NOTREACHED();
}
to CHECK(foo);
Those transforms take a non-trivial amount of time (and there are
thousands of instances). Cleanup can be left as an exercise for the
reader.
This does clean up kCrashOnDanglingBrowserContext as both paths of the
kill switch are currently fatal. This has been rolled out for a long
time.
Bug: 40580068, 40062641
Change-Id: Ib88e710d003e2e48df3fc502ca54d2341d157a0e
Cq-Include-Trybots: luci.chromium.try:linux-dcheck-off-rel
Low-Coverage-Reason: OTHER Should-be-unreachable code
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5974816
Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org>
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Auto-Submit: Peter Boström <pbos@chromium.org>
Reviewed-by: Sam McNally <sammc@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1376522}
Suppress unsafe buffer usage on a file-by-file basis. Out of
approximately 5850 .cc and .h files only roughly 160 files fail
compilation with the unsafe buffers warning.
Suppress only, by inserting boilerplate into affected files. Do not
re-write any code to work around the issues. Properly fixing each file
will be done in follow-up CLs.
//content/ is not removed from unsafe_bufers_paths.txt file and will be
also done as a follow-up, so it makes potential reverts simpler.
Bug: 342213636
Change-Id: I4a936e63dea95a78951f7bfae6d5487708ae3c0b
AX-Relnotes: n/a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5608913
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Nasko Oskov <nasko@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1312393}
This was generated by replacing " NOTREACHED()" with
" NOTREACHED_IN_MIGRATION()" and running git cl format.
This prepares for making NOTREACHED() [[noreturn]] alongside
NotReachedIsFatal migration of existing inventory.
Bug: 40580068
Change-Id: I3b48b89911ac5e9ffcb211622992f917f8f9e8d9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5539619
Auto-Submit: Peter Boström <pbos@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Owners-Override: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Peter Boström <pbos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1301096}
The canonical bug format is TODO(crbug.com/<id>). TODOs of the
following forms will all be migrated to the new format:
- TODO(crbug.com/<old id>)
- TODO(https://crbug.com/<old id>)
- TODO(crbug/<old id>)
- TODO(crbug/monorail/<old id>)
- TODO(<old id>)
- TODO(issues.chromium.org/<old id>)
- TODO(https://issues.chromium.org/<old id>)
- TODO(https://issues.chromium.org/u/1/issues/<old id>)
- TODO(bugs.chromium.org/<old id>)
Bug id mapping is sourced from go/chrome-on-buganizer-prod-issues.
See go/crbug-todo-migration for details.
#crbug-todo-migration
Bug: b/321899722
Change-Id: Iabdfea2fd5393d6bbc54390ca0c995eb2c55bbaa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5469882
Reviewed-by: Darryl James <dljames@chromium.org>
Owners-Override: Alison Gale <agale@chromium.org>
Commit-Queue: Alison Gale <agale@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1290673}
Following the same pattern other child processes uses, this CL
adds support for histograms to app shim process using shared
memory. Histograms collected before the shared memory connection
is set up are transmitted using the ChildHistogramFetcher mojo
interface (and are lost if a connection is never established).
Histograms after are shared immediately via shared memory (but
are lost if the browser process crashes before they are processed,
matching behavior for other child processes).
See https://docs.google.com/document/d/19dANu83w-9q-Ft5PU1cxDHiKdZv4hDLyAdr2Zf3JgSc/edit?usp=sharing for more background.
Bug: 40281917
Include-Ci-Only-Tests: true
Change-Id: I0f00edba892bae3549293d46ab9af602dbf5176e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5363833
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Alexei Svitkine <asvitkine@chromium.org>
Commit-Queue: Marijn Kruisselbrink <mek@chromium.org>
Reviewed-by: Will Harris <wfh@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1288435}
This CL tweaks `RenderProcessHostImpl::OnChannelConnected` so that it
sends the `SetPseudonymizationSalt` mojo IPC earlier than before. It
also adds comments to `OnChannelConnected` implementation in
`RenderProcessHostImpl` and `ChildProcessHostImpl` that explain why this
mojo IPC needs to be sent earlier rather than later.
Bug: 1479308
Change-Id: Ife5f4d4a9996df2a0ba523138103eac196ec249d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5014194
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1221929}
Crashpad is not yet updated for the new location, so leave a
forwarding header to be removed later.
Skipping trybots. This is a Mac change, and it’s passing all
trybots except for android_optional_gpu_tests_rel that is
repeatedly failing on an unrelated issue.
NOTRY=true
Bug: 1444927
Cq-Include-Trybots: luci.chrome.try:mac-chrome
Change-Id: Iad0c903187b0e1e5584c68f2eb00b5b026085596
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4790744
Owners-Override: Avi Drissman <avi@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Auto-Submit: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1185029}
This allows us to leverage the existing path calculation logic in
ChildProcessHost::GetChildPath for determining all helper paths.
Change-Id: Ie22a0d548826e197441b737a57d4a14a58408d4a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4456752
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Marshall Greenblatt <marshall@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1134010}
This CL adds compile-time checks that the size parameter passed
to base::span either by the constructor or the base::make_span
function will fit into a size_t type and are not unsigned.
This is achieved by use of base::StrictNumeric parameter to the
methods and constructor.
This has no runtime overhead, as the checks are done at compile
time.
This CL also contains all the remaining mechanical changes needed
to convert signed numeric literal values to unsigned by adding
a 'u' on the end. Any functional or more complex changes have
already landed in other CLs tagged to this bug with separate
owner review.
This CL also adds no-compile tests for the new APIs.
BUG=1385166
Change-Id: Ic2dbd950842dd811a8dc40ac539c8b824ed983a1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4219636
Code-Coverage: Findit <findit-for-me@appspot.gserviceaccount.com>
Owners-Override: danakj <danakj@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Commit-Queue: danakj <danakj@chromium.org>
Commit-Queue: Will Harris <wfh@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1102320}