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.
Bug: 40580068
Change-Id: I72205fb77747957c6bf33dbea93656fd20085a42
Low-Coverage-Reason: OTHER Should-be-unreachable code
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6010008
Reviewed-by: Rick Byers <rbyers@chromium.org>
Owners-Override: Rick Byers <rbyers@chromium.org>
Commit-Queue: Peter Boström <pbos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1382618}
I need an owner's approval please for changes under:
components/proxy_config
This is a mechanical change. There are a few instances (but not all)
of empty user-defined constructors and destructors which can be
defaulted in the /components code.
This CL was uploaded by git cl split.
R=stevenjb@chromium.org
Bug: 371316188
Change-Id: Iab23b9f3f940b2d6983de54e16e27c50a488703e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5918673
Commit-Queue: Sorin Jianu <sorin@chromium.org>
Auto-Submit: Sorin Jianu <sorin@chromium.org>
Reviewed-by: Andreea Costinas <acostinas@google.com>
Cr-Commit-Position: refs/heads/main@{#1366817}
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: I92e83d0b564d44267f003147a1ce6ba3674621a4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5539175
Owners-Override: Lei Zhang <thestig@chromium.org>
Commit-Queue: Peter Boström <pbos@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1300923}
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: I89f0a4d7ddeb7c9585f3a0e5421aef8ce5a6f0f2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5455854
Reviewed-by: Taylor Bergquist <tbergquist@chromium.org>
Commit-Queue: Alison Gale <agale@chromium.org>
Owners-Override: Alison Gale <agale@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1287738}
This was actually being initialized at runtime, since the initializer
was not a constant expression. base::MakeFixedFlatMap is stricter and
requiring consteval, so fixing this consists of two parts:
- marking `name_to_extension_prefpath` itself as constexpr
- making all the pref constants as constexpr
Incidentally, this fix also makes the pref name constants actually
constant, as a `const char*` can still be assigned.
Note that using inline constexpr variables has some implications in
component builds: specifically, it is possible for the constants to be
built into multiple discrete components, breaking things that rely on
pointer identity. This dependency does not seem to be there in practice,
and Chrome should prioritize optimizing for production builds that ship
to users over developer-only component builds.
Bug: 41486252
Change-Id: Iec7ce681ec4e0054530a460363f1271a1159d56a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5375296
Reviewed-by: Pavol Marko <pmarko@chromium.org>
Reviewed-by: Finnur Thorarinsson <finnur@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1274207}
Currently extension-set proxies are intercepted by the
LacrosExtensionProxyTracker which sends the proxy config along with the
extension metadata to Ash using the NetworkSettingsService mojo service.
The NetworkSettingsService stores the new proxy config using the kProxy
pref, in the user store.
This CL changes the the NetworkSettingsService implementation in Ash
to (indirectly) use the Prefs mojo service to get the proxy config set
by the Lacros primary profile and modifies the
LacrosExtensionProxyTracker to only set and clear extension metadata.
This CL also removes all the logic which monitors proxy updates
outside of NetworkSettingsServiceAsh.
Bug: 1411949, b/267135604, b/192453302
Change-Id: I8fbf828eba88acdd20f536f8e8893239425d1a8b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4218357
Reviewed-by: Pavol Marko <pmarko@chromium.org>
Reviewed-by: Roland Bock <rbock@google.com>
Commit-Queue: Andreea Costinas <acostinas@google.com>
Reviewed-by: Kyle Horimoto <khorimoto@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1170082}
The DanglingPointerDetector is configured only when the test enters the
ContentMain function. See https://crbug.com/1400059
I would like to configure it no matter the kind of test. For this to
happen, we need to annotate every pre-existing dangling pointers.
This patch annotates the ones you can find by running targets depending
on the GoogleTest library.
Statistic:
This adds 1776 new DanglingUntriaged. Among them:
- 1288 are in unittests.
- 488 are in implementation.
To produce those numbers, I used the command:
```bash
git diff annotate-linux origin/main -- "*test*" | grep "DanglingUntriaged" | wc -l
```
This patch has been generated by:
1. Apply the "auto-annotator" patch:
https://chromium-review.googlesource.com/c/chromium/src/+/4474553
2. Compile the compiler again:
```bash
./tools/clang/scripts/build.py
```
3. List and run all the targets. You can use a bash script like:
https://docs.google.com/document/d/1AMMERcqy0eafFWopUCHYsIKIKEp3J8DFxqW9UIbzIHo
4. Concatenate output, filter by "Found dangling ptr", sort, remove
duplicate.
5. Apply the rewriter script from:
https://github.com/ArthurSonzogni/chrome-dangling-ptr-apply-edit
6. Revert the "auto-annotate" patch.
7. Apply `git cl format`
AX-Relnotes: n/a.
Bug: chromium:1400059
Change-Id: I217d5c0b925da5176fc53baf95919a3690f1e9a3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4570424
Reviewed-by: danakj <danakj@chromium.org>
Owners-Override: danakj <danakj@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1151859}
Following investigation of Proxy Config (b/256927321), the annotations
mentioning 'ProxyMode', 'ProxyServer', or 'ProxyPacUrl' policies should
be updated to ProxySettings. The former policies are deprecated.
'ProxySettings' encapsulates the former policies and can control
proxy settings.
Fixed: b:263157378
Change-Id: Ic932ca64b5adf1d6c4f713a0ee161e42ae50bd6e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4131463
Reviewed-by: Adam Rice <ricea@chromium.org>
Reviewed-by: Pavol Marko <pmarko@chromium.org>
Commit-Queue: Alex Chen <alexwchen@chromium.org>
Reviewed-by: Nicolas Ouellet-Payeur <nicolaso@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1091934}
This cl migrates ProxyConfigDictionary (see
components/proxy_config/proxy_config_dictionary.h) to use
base::Value::Dict, most of the changes are directly propagated from
there. Besides that it expands TestingPrefServiceBase (see
components/prefs/testing_pref_service.h) interface with setters taking
base::Value::Dict and base::Value::List which allows to avoid manual
conversion to the base::Value on the call side in many tests.
LOW_COVERAGE_REASON=Code Health type migration, nothing new to test
Bug: 1187061, 1187001
Change-Id: I0dbca1a78b3c0a4f313f364f3d2fc35378ccf273
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3922202
Reviewed-by: Colin Blundell <blundell@chromium.org>
Reviewed-by: Dominic Battré <battre@chromium.org>
Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Andrey Davydov <andreydav@google.com>
Cr-Commit-Position: refs/heads/main@{#1053030}
Semi-final step go/trust-your-prefs#heading=h.jjuz6fybcx8y
Introduce
- PrefService::GetDict and
- PrefService::GetList
as drop-in replacements for
- PrefService::GetValueDict and
- PrefService::GetValueList
and replace all known call sites via
sed -i 's/\bGetValueDict\b/GetDict/g' $(ag -l -s '\bGetValueDict\b')
sed -i 's/\bGetValueList\b/GetList/g' $(ag -l -s '\bGetValueList\b')
The final step will be to remove GetValueDict and GetValueList in a
follow-up CL.
Bug: 1334665
Test: Existing unit tests
Change-Id: I093e81af89628a02216501e59c1de7f1e5e22b9f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3887802
Auto-Submit: Roland Bock <rbock@google.com>
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@{#1045895}
This CL is pure refactoring.
This CL moves ConfiguredProxyResolutionService::CreateSystemProxyConfigService
to ProxyConfigService because:
- ConfiguredProxyResolutionService::CreateSystemProxyConfigService
creates *NOT* ConfiguredProxyResolutionService instance but ProxyConfigService instance depending on platforms.
- ConfiguredProxyResolutionService instance lives on the network service
but ProxyConfigService on the Browser UI thread.
Change-Id: I05869c5e479c39a6aadf9698a58a3287f28ee1a0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3692900
Reviewed-by: Pavol Marko <pmarko@chromium.org>
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Reviewed-by: Rainhard Findling <rainhard@chromium.org>
Reviewed-by: Gary Kacmarcik <garykac@chromium.org>
Reviewed-by: Matt Menke <mmenke@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1021990}
In proxy_policy_handler.cc kDeprecatedProxyPolicies was a mutable array.
Make it immutable so that hopefully the compiler will place it in a
read-only section of the binary.
Also make the kProxyModeValidationMap array constexpr while we are here.
BUG=1317612
Change-Id: I63bebeb043949b10626d260c690a02e1828573ba
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3615596
Commit-Queue: Pavol Marko <pmarko@chromium.org>
Auto-Submit: Adam Rice <ricea@chromium.org>
Reviewed-by: Pavol Marko <pmarko@chromium.org>
Cr-Commit-Position: refs/heads/main@{#998335}
This covers various files missed in previous CLs.
Reasons for using "unsafe" over type-checking versions:
- Handling multiple policies and types
- Need to differentiate between nullptr (unset) and type mismatch
Bug: 1294817, b/221918704
Change-Id: I064ae9c05899dad91f4c068407292d4ac0f33a1b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3546396
Reviewed-by: Nicolas Ouellet-Payeur <nicolaso@chromium.org>
Reviewed-by: Yuwei Huang <yuweih@chromium.org>
Reviewed-by: Owen Min <zmin@chromium.org>
Reviewed-by: Pavol Marko <pmarko@chromium.org>
Commit-Queue: Igor Ruvinov <igorruvinov@chromium.org>
Cr-Commit-Position: refs/heads/main@{#984827}
Most callers were already migrated via scripts, this is a split
of the remaining callers or comment-references that weren't caught
by those scripts.
@QA: This CL is a logical no-op.
This CL was uploaded by git cl split.
R=pmarko@chromium.org
Bug: 1026641
Change-Id: I07cd5353babf6ba9326a740422ba41a207306768
AX-Relnotes: n/a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3529750
Auto-Submit: Gabriel Charette <gab@chromium.org>
Reviewed-by: Pavol Marko <pmarko@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/main@{#982770}
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}
This inlines all remaining DISALLOW_* macros in components/. This is
done manually (vim regex + manually finding insertion position).
IWYU cleanup is left as a separate pass that is easier when these macros
go away.
Bug: 1010217
Change-Id: I2409b6250d85e74e8c4b6863fbeeaaeacc37733c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3194821
Commit-Queue: Peter Boström <pbos@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Owners-Override: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#927361}