Changing the list of files checked by CheckAssertAshOnlyCode to ignore
deleted files. Without ignoring deleted files, this presubmit check will
block any CL which moves or deletes a BUILD.gn file.
Bug: 1278154
Change-Id: Id3abc80a8da242b3224ce341cafb056e2ca28066
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3325066
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/main@{#950089}
Replace every shebang like /usr/bin/python[23] with /usr/bin/env
python[23] as appropriate in Chromium and Blink, except for WPT. Also,
add a presubmit check to disallow the former going forward.
build/print_python_deps.py is changed from using python2.7 to python2.
remoting/ python scripts are left out as they are meant to be run in
users' machines.
Bug: 1191100
Change-Id: If7ebf7bd8ad9b2695a471e0a403a592815a0d959
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2537832
Commit-Queue: Henrique Ferreiro <hferreiro@igalia.com>
Reviewed-by: Dirk Pranke <dpranke@google.com>
Reviewed-by: Colin Blundell <blundell@chromium.org>
Reviewed-by: Jamie Walch <jamiewalch@chromium.org>
Cr-Commit-Position: refs/heads/main@{#946427}
This CL adds assertions to check that the code in ash/,
chrome/browser/ash/ and chrome/browser/ui/ash/ is only used in Ash
builds.
Additionally, a presubmit check is added to verify that this assertion
is included in every BUILD.gn file contained in an ash/ directory at any
depth.
Change-Id: Id655e40ed8a6f3f01dfd0686b92a7f908d17844d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3301058
Commit-Queue: Henrique Ferreiro <hferreiro@igalia.com>
Reviewed-by: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/main@{#946216}
The CheckChromeOsSyncedPrefRegistration presubmit check had a wrong
regexp for matching the string 'chromeos' as a path component. This CL
fixes that and improves its test to catch this problem in the future.
Change-Id: I632e1c6c4e45253eb263e683fb34f7f41abab498
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3302111
Reviewed-by: Dirk Pranke <dpranke@google.com>
Commit-Queue: Henrique Ferreiro <hferreiro@igalia.com>
Cr-Commit-Position: refs/heads/main@{#946178}
The infra-try-recipes-tester can make cherry-picks of CLs used for
testing the recipes. The cherry-picks are not submitted, they are just
used as the target for builds ensure that the recipes perform correctly
running on branches as they diverge from trunk.
Bug: 1273255
Change-Id: If21897b6f0e36134899935ad3671194c350a864a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3300499
Reviewed-by: Dirk Pranke <dpranke@google.com>
Reviewed-by: Ben Pastene <bpastene@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@google.com>
Auto-Submit: Garrett Beaty <gbeaty@google.com>
Cr-Commit-Position: refs/heads/main@{#945031}
The hint points to base::WrapUnique, for when it's not possible to use
std::make_unique<T>() as suggested in existing hint.
Bug: None
Test: Trying to submit a CL with the given issue would show the new
error message.
Change-Id: Ifabfc5ebd2e46e3fe5ff0e6cc1adafd063b2dae6
Change-Id: I49045962b178b97584ad952f8e0117c17df5b849
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3296674
Auto-Submit: Yao Li <yaohuali@google.com>
Commit-Queue: Yao Li <yaohuali@google.com>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#944702}
Many checks are only relevant to certain files so we can
skip them when those files aren't modified.
This is particularly helpful for sparse checkouts where unrelated
tools and scripts might not be in the tree.
Bug: 1236623
Change-Id: I3e2979b846f420b81492d29f2f2d023215e447ad
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3294521
Reviewed-by: Dirk Pranke <dpranke@google.com>
Commit-Queue: Erik Staab <estaab@chromium.org>
Cr-Commit-Position: refs/heads/main@{#944371}
This removes DISALLOW_COPY(), DISALLOW_ASSIGN() and
DISALLOW_COPY_AND_ASSIGN() from base/macros.h. PRESUBMITs are also
updated to no longer check for these macros.
IWYU removal is left as a separate change just in case this needs to be
reverted.
Bug: 1010217
Change-Id: I9e0877f31df2cdd7fe4a850321866cb31fed64e7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3261552
Auto-Submit: Peter Boström <pbos@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Owners-Override: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#938828}
This removes the macro definition and presubmit checks and all existing
instances are inlined.
IWYU is left as a separate step until all DISALLOW_* macros are removed.
Bug: 1010217
Change-Id: Ibc4d90d6a1f244a01e65cd3c5a9c50e5419ea5a1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3257088
Reviewed-by: Lei Zhang <thestig@chromium.org>
Owners-Override: Lei Zhang <thestig@chromium.org>
Commit-Queue: Peter Boström <pbos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#937250}
To aid conversions, first removed "using base::TimeDelta;" and converted
TimeDelta to base::TimeDelta in the affected files. Then converted all
TimeDelta::FromX() and TimeDelta().FromX() (!) into X().
The changes in this CL were all performed by tools; no manual
interventions occurred.
Bug: 1243777
Change-Id: Iddcb80d7883fd494d2209d01945a6553f316ff95
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3202380
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Owners-Override: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Peter Boström <pbos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#928323}
This CL enables storing WASM code cache in cache_storage. Changes
include:
* Plumbing the cache_storage cache name through the various layers in
order to send the compiled data back to cache_storage.
* Making service workers load the cache_storage side data blob for
responses with a WASM mime type.
* Fixing a race condition in v8_wasm_response_extension.cc where it
could check for code cache before it was finished being loaded from
disk.
* Adds a test verifying the code cache was correctly generated and
used via devtools tracing. (Unfortunately the test hits a flaky
issue within the devtools framework and is marked SKIP for now.)
Bug: 1252950
Change-Id: Icf655e2c8b0792d6799d339e3753a56c2ab84436
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3199655
Commit-Queue: Ben Kelly <wanderview@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#927872}
This PRESUBMIT warning has some false positives, e.g.:
** Presubmit ERRORS **
The following files use std::unique_ptr<T>(). Use nullptr instead.
components/autofill_assistant/browser/basic_interactions.cc:548
base::DoNothingAs<void(std::unique_ptr<TriggerContext>)>());
While `nullptr` is nicer than `std::unique_ptr<T>()`, it is also not
serious enough of a problem to warrant blocking on false positives.
Bug: 1252980
Change-Id: I173db5be48991c2468e299eb26f505d54c2f6afa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3198472
Reviewed-by: danakj <danakj@chromium.org>
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/main@{#926920}
Many callsites migrated or were deleted since the original deprecation.
Allowing a final push to remove them all!
Removed ThreadRestrictions::
SetIOAllowed(bool allowed)
In favor of ScopedAllow/DisallowBlocking()
SetSingletonAllowed(bool allowed)
In favor of ScopedDisallowSingleton()
AssertSingletonAllowed()
Moved to internal::
DisallowWaiting()
In favor of scoper.
SetWaitAllowed(bool allowed)
In favor of ScopedAllow/DisallowBaseSyncPrimitives
Introducing PermanentThreadAllowance::Allow*() with friends for
the very few use cases that required permanent allowance.
Fixed many friends usage (some were even referring to deleted code..!)
This leaves only ScopedAllowIO to migrate under the old
"ThreadRestrictions" namespace!
Bug: 766678
Change-Id: I3b581eaa92992efa4ecf1a2db919062fc7c8fbb5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3153342
Commit-Queue: Gabriel Charette <gab@chromium.org>
Auto-Submit: Gabriel Charette <gab@chromium.org>
Reviewed-by: François Doray <fdoray@chromium.org>
Reviewed-by: Hidehiko Abe <hidehiko@chromium.org>
Owners-Override: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/main@{#923148}
When disabling tests based on some condition, sometimes developers
forget to add a MAYBE_ prefix to the test they're disabling. This
presubmit check warns when a #define MAYBE_* is found without a
corresponding TEST(MAYBE_...). A slightly modified version of the script
ran against all C++ tests found 16 cases (see crbug.com/1248543).
The check misses some cases where there is ambiguity (such as having
multiple instances of the same test or suite name in the file), and
there are rare false positives across the codebase (such as wrapping
test names in macros), but it should be good enough for a warning.
Fixed: 1246006
Change-Id: Idc330d61fb928baf4d45296ca2b9cd15ee03c284
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3169473
Reviewed-by: Dirk Pranke <dpranke@google.com>
Commit-Queue: Nina Satragno <nsatragno@chromium.org>
Cr-Commit-Position: refs/heads/main@{#922961}
This change creates a new app bundle named "GoogleSoftwareUpdate".
The bundle contains the replacement for the "ksadmin" tool, used by
Keystone's registration framework. The structure is as follows:
GoogleUpdater
Contents
Helpers
ksadmin
Info.plist
MacOS
GoogleSoftwareUpdate
PkgInfo
Note: As there are many references to GoogleSoftwareUpdate.bundle and
ultimately we are trying to provide an in-place replacement for it,
I had to change the "mac_app_bundle" template to support the production
of a ".bundle".
Bug: 1247725
Change-Id: Ib717aab5682a04d84e50334f5b63f458c98c8a33
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3149833
Commit-Queue: Mila Green <milagreen@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@google.com>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Joshua Pawlicki <waffles@chromium.org>
Cr-Commit-Position: refs/heads/main@{#920275}
Add a ksadmin binary for chrome mac updater in order to facilitate the use of the new updater from applications which are packaged with Keystone's Registration Framework, which delegates work to ksadmin.
Bug: 1244983
Fixed: 1244983
Change-Id: I9fe7a7d4190c54a0ed5cb2245a89f6707b9fb3b6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3046464
Commit-Queue: Mila Green <milagreen@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@google.com>
Reviewed-by: Sorin Jianu <sorin@chromium.org>
Reviewed-by: Joshua Pawlicki <waffles@chromium.org>
Cr-Commit-Position: refs/heads/main@{#918820}
This INFO log occurs once per instance of these components and thus is
not spammy. Especially for Runners and WebEngine, it can be useful to
confirm that there is not a version mismatch when installing a new
version.
This also ensures that the WebEngine version is logged (by web_instance)
in cases where ContextProvider is never used, such as when only using
the runners to create Contexts.
Bug: 1010222
Change-Id: I3dff5d85df40f50d642bb4960cb4e10e0d8a80fc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2863254
Reviewed-by: Wez <wez@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Auto-Submit: David Dorwin <ddorwin@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#912493}
We need these accounts for Lacros and skylab testing.
Using new accounts will give us finer-grained permissions.
These accounts will only submit cl to
testing/buildbot/variants.pyl and generated json files.
Bug: 1234067
Change-Id: Ie9eda8c48177e26af46bbec7437ca90156e6f7a1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3078495
Reviewed-by: Dirk Pranke <dpranke@google.com>
Commit-Queue: Sven Zheng <svenzheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#909896}
This makes RemoveAllChildViews default to deleting children that are not
set_owned_by_client(). A separate method,
RemoveAllChildViewsWithoutDeleting(), is added for pre-existing calls
that do not delete children. This method is marked as deprecated.
Removing explicit arguments to RemoveAllChildViews() is so far only done
in ui/views, follow-up CLs will remove them everywhere and eventually
remove the `delete_children` parameter from RemoveAllChildViews()
indicating that there should not be a way to remove children from a View
without either removing them or retaining their `unique_ptrs`.
Bug: 1044687
Change-Id: I0c823949dd0c32a6af7f6bfcc9c8bf1287cd3650
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3057500
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Allen Bauer <kylixrd@chromium.org>
Commit-Queue: Peter Boström <pbos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#906559}
This reverts commit 83a4552de0.
Reason for revert: Fixed to handle deleted files by specifying
include_deletes=False.
Original change's description:
> Revert "Fix build_config.h presubmit"
>
> This reverts commit 76c67f3bea.
>
> Reason for revert: This change causes the presubmit check to fail for changes that move files. AffectedFiles() includes a file's old name from before moving, so ReadFile() tries to read a file that doesn't exist.
>
> Example log: https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8843618273276417712/+/u/presubmit_py3/stdout
>
> Original change's description:
> > Fix build_config.h presubmit
> >
> > Chromium has a presubmit to make sure that nobody uses macros likes
> > OS_WIN without first including build/build_config.h. It's a good idea
> > but it had two flaws:
> >
> > 1) It only detects bugs in new lines of code. Existing abuses of the
> > OS_* macros are often ignored.
> > 2) It confirms that build/build_config.h is included, but it does not
> > confirm that it is included before the macro is used.
> >
> > Both of these issues appeared in
> > content/web_test/browser/web_test_download_manager_delegate.cc. This
> > source file uses some Windows types and it appeared to include
> > windows.h, but it actually didn't, because OS_WIN is used before it is
> > defined. This bug is being fixed separately.
> >
> > This change fixes both presubmit issues.
> >
> > Change-Id: I66b37f3d4ec528910d7240414c8acbe2c87d6e82
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2981136
> > Auto-Submit: Bruce Dawson <brucedawson@chromium.org>
> > Reviewed-by: Mike Pinkerton <pinkerton@chromium.org>
> > Commit-Queue: Mike Pinkerton <pinkerton@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#895132}
>
> Change-Id: Icd23cb27c73f448e88eabb27b903c66e0fd4b9c5
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2982304
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
> Reviewed-by: Mike Pinkerton <pinkerton@chromium.org>
> Commit-Queue: Ian Wells <iwells@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#895188}
Change-Id: I93f1909d02777732ad8174a26e7dd7fa00bb3adf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2982308
Reviewed-by: Mike Pinkerton <pinkerton@chromium.org>
Reviewed-by: Ian Wells <iwells@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#895588}
This reverts commit 76c67f3bea.
Reason for revert: This change causes the presubmit check to fail for changes that move files. AffectedFiles() includes a file's old name from before moving, so ReadFile() tries to read a file that doesn't exist.
Example log: https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8843618273276417712/+/u/presubmit_py3/stdout
Original change's description:
> Fix build_config.h presubmit
>
> Chromium has a presubmit to make sure that nobody uses macros likes
> OS_WIN without first including build/build_config.h. It's a good idea
> but it had two flaws:
>
> 1) It only detects bugs in new lines of code. Existing abuses of the
> OS_* macros are often ignored.
> 2) It confirms that build/build_config.h is included, but it does not
> confirm that it is included before the macro is used.
>
> Both of these issues appeared in
> content/web_test/browser/web_test_download_manager_delegate.cc. This
> source file uses some Windows types and it appeared to include
> windows.h, but it actually didn't, because OS_WIN is used before it is
> defined. This bug is being fixed separately.
>
> This change fixes both presubmit issues.
>
> Change-Id: I66b37f3d4ec528910d7240414c8acbe2c87d6e82
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2981136
> Auto-Submit: Bruce Dawson <brucedawson@chromium.org>
> Reviewed-by: Mike Pinkerton <pinkerton@chromium.org>
> Commit-Queue: Mike Pinkerton <pinkerton@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#895132}
Change-Id: Icd23cb27c73f448e88eabb27b903c66e0fd4b9c5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2982304
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: Mike Pinkerton <pinkerton@chromium.org>
Commit-Queue: Ian Wells <iwells@chromium.org>
Cr-Commit-Position: refs/heads/master@{#895188}
Chromium has a presubmit to make sure that nobody uses macros likes
OS_WIN without first including build/build_config.h. It's a good idea
but it had two flaws:
1) It only detects bugs in new lines of code. Existing abuses of the
OS_* macros are often ignored.
2) It confirms that build/build_config.h is included, but it does not
confirm that it is included before the macro is used.
Both of these issues appeared in
content/web_test/browser/web_test_download_manager_delegate.cc. This
source file uses some Windows types and it appeared to include
windows.h, but it actually didn't, because OS_WIN is used before it is
defined. This bug is being fixed separately.
This change fixes both presubmit issues.
Change-Id: I66b37f3d4ec528910d7240414c8acbe2c87d6e82
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2981136
Auto-Submit: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: Mike Pinkerton <pinkerton@chromium.org>
Commit-Queue: Mike Pinkerton <pinkerton@chromium.org>
Cr-Commit-Position: refs/heads/master@{#895132}
If the permissions are wrong for a file (for example:
tools/grit/minify_with_uglify_unittest.py is 644 instead of 755) and you
run `git cl presubmit` it will no longer fail. This failure is a python3
issue with subprocess returning binary arrays instead of strings.
Bug: 1221378
Change-Id: I30a9d4f8ae649415f236863dfe2199961083e76d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2972103
Reviewed-by: Dirk Pranke <dpranke@google.com>
Commit-Queue: Ari Chivukula <arichiv@chromium.org>
Cr-Commit-Position: refs/heads/master@{#893689}
Perhaps due to a recent git change (no longer showing \r\n line ending
differences) the recent fix to CheckForWindowsLineEndings still doesn't
work. This change uses input_api.ReadFile rather than f.ChangedContents
to get the file text and this reliably finds \r\n line endings.
Bug: 801033
Change-Id: I35d047bff4545664a2524990bf752de8a53af805
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2951931
Reviewed-by: Mike Pinkerton <pinkerton@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#891322}
CheckForWindowsLineEndings checks many different types of text files but
the list did _not_ include .h files, which naturally is where I have
hit problems. This change adds header files to the list.
This change also asks ChangedContents to preserve line endings, since
otherwise there won't be anything to check. That is, for a long time
CheckForWindowsLineEndings has been a NOP because it was getting lines
whose line endings were already trimmed. Note that the option to
preserve line endings was added recently in change crrev.com/c/2910488
and this change will not work with versions of depot_tools prior to
that change.
Bug: 801033
Change-Id: I91b9783ff7da72ef432854ce0cddd70abbce6860
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2911914
Reviewed-by: Mike Pinkerton <pinkerton@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#890266}
ScopedObserver is being deprecated in favor of two new classes:
- base::ScopedObservation for observers that only ever observe
a single source.
- base::ScopedMultiSourceObservation for observers that do or may
observe more than a single source.
Bug: 1145565
Change-Id: I3169858882de4efb16a63a847940a9e3bc249d96
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2944549
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Sigurður Ásgeirsson <siggi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#890208}
This CL finishes the changes for all files not in third_party.
Top level files were missed by the script, docs changes due to multiple entries on the same line which were not caught by script, but manually fixed up.
See this doc: go/chromium-coil-change for more info
BUG=1210385
Change-Id: I6d92e2e6fd244174cc370662399fa713a7b8abf5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2927090
Auto-Submit: John Palmer <jopalmer@chromium.org>
Commit-Queue: Jochen Eisinger <jochen@chromium.org>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#889685}