//components/prefs in most places uses sequence_checker, so this component
is bound to sequence instead of dedicated thread.
But there are some usages of thread_checker inside component.
Migrate them to sequence_checker.
Change-Id: I660ae3024e6a1e823877d31935367939adcdcba6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3107010
Reviewed-by: Gabriel Charette <gab@chromium.org>
Commit-Queue: Sergey Kuznetsov <kuznetsovs@yandex-team.ru>
Cr-Commit-Position: refs/heads/main@{#915873}
This change removes the use of Value::GetAsString and replaces with
Value::is_string, Value::GetString(), Value::GetIfString().
This CL was uploaded by git cl split.
R=gab@chromium.org
Bug: 1187007
Change-Id: I87ece9233ac22b85a4be04245e4f83b71cc032ef
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3033194
Auto-Submit: Thomas Lukaszewicz <tluk@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#903028}
This change removes the use of Value::GetAsDouble
and replaces with Value::is_double(), Value::GetDouble(),
Value::GetIfDouble().
components/prefs/pref_value_map_unittest.cc
Bug: 1187006
Change-Id: Ib3cff397b9fbc9c7fecc2586d76662e1ea740d9f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3009321
Auto-Submit: Maksim Sadym <sadym@chromium.org>
Commit-Queue: Dominic Battré <battre@chromium.org>
Reviewed-by: Dominic Battré <battre@chromium.org>
Cr-Commit-Position: refs/heads/master@{#899124}
These indicate when a range-based for loop is using an index whose type
(value, pointer, or reference) doesn't match what the loop actually
extracts from the range. Fix by matching the actual type better.
This shouldn't cause any behavior/performance change, just be slightly
clearer about what's actually happening when reading the code.
Bug: 1223264
Change-Id: Ibd208ce026bc59de8e39e6bf0cbd0d046a9da079
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2984967
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Commit-Queue: Ted Choc <tedchoc@chromium.org>
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#895821}
Note that iOS and Android are excluded from this experiment.
This is the third change in a series of changes for setting up the
experiment in variations_field_trial_creator.cc. This experiment has
three groups: Control, WritePrefs, and SignalEarlyAndWritePrefs. Clients
in the control group have the status quo behavior. Clients in the
WritePrefs group synchronously write prefs to disk during startup. This
allows us to measure the time that this write takes. Clients in the
SignalEarlyAndWritePrefs group (a) signal that Chrome has not yet exited
cleanly before setting up field trials and (b) synchronously write prefs
to disk.
The motivation behind this experiment is that Variations Safe Mode is
not triggered for crashes that occur while setting up field trials or
shortly thereafter. The cause is twofold. First, we do not signal that
Chrome has not yet exited cleanly until some point after field trials
are set up. Second, we fail to persist two prefs relevant to determining
whether to run in safe mode if we crash while setting up field trials or
shortly thereafter: kStabilityExitedCleanly and kVariationsCrashCount.
To persist these prefs to disk, we add a new function:
CommitPendingWriteSynchronously(). An existing function,
CommitPendingWrite() cannot be used to write the prefs to disk during
startup because CommitPendingWrite() schedules a write by posting a
task. However, at the point in which we're setting up field trials,
Chrome has not yet started threads and is not yet running tasks.
For more information about Variations Safe Mode, please see this doc:
https://docs.google.com/document/d/17UN2pLSa5JZqk8f3LeYZIftXewxqcITotgalTrJvGSY/
Bug: b/184937096
Change-Id: Iea4c468faedb39cb7e1b5bf564eecc4e0efb69a0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2898323
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Alexei Svitkine <asvitkine@chromium.org>
Reviewed-by: Robert Liao <robliao@chromium.org>
Reviewed-by: Ilya Sherman <isherman@chromium.org>
Reviewed-by: Dominic Battré <battre@chromium.org>
Commit-Queue: Caitlin Fischer <caitlinfischer@google.com>
Cr-Commit-Position: refs/heads/master@{#891910}
- Remove it from headers that do not use base::ObserverList.
- Add it to files that do use base::ObserverList.
- Swap in base/observer_list_types.h in headers that only use
base::CheckedObserver.
Bug: 242216
Change-Id: If36b04a6eaa91e43a6f99003466f819c7c35af15
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2942205
Commit-Queue: Nico Weber <thakis@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Owners-Override: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#889921}
(A very tiny subset thereof)
This originally targeted just ListValue::AppendString(), but things
that append Strings to lists tend to also append other things to lists,
and also usually insert things into dictionaries, so the neighboring
code to the use of this API was adjusted to non-deprecated alternatives
as well, to avoid revisiting those spots repeatedly.
(This is done pretty locally, though, so some re-visits will likely still
happen).
Bug: 1187102
Change-Id: I9f640d8ac16bbe382c864f415a0590b080eec9b5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2880750
Reviewed-by: Dominic Battré <battre@chromium.org>
Reviewed-by: Filip Gorski <fgorski@chromium.org>
Reviewed-by: Yoshiki Iguchi <yoshiki@chromium.org>
Commit-Queue: Maksim Orlovich <morlovich@chromium.org>
Cr-Commit-Position: refs/heads/master@{#887198}
Add a base::Feature to turn it back on via field trials, in the unlikely
event this doesn't stick. The previously added temporary admin policy
may be used by administrators who need a little more time.
This also fixes up the tests in policy_network_browsertest.cc. I both
mistyped /title1.html and forgot to disable TLS 1.3 in the test server.
Those combined meant the server didn't notice the 3DES removal and was
actually just observing a 404. Oops.
In order to make the prefs and base::Feature interact correctly, this CL
also adds an IsDefaultValue() method to PrefMember.
For now, the default for //net is still to enable it, because not
everything honors the base::Feature. Once this change sticks in Chrome,
I'll go back and flip the default in //net as well. (Or just unwind
everything. M95 on trunk is pretty soon.)
Bug: 1203442
Change-Id: Iccd4f6ceaa31a000eefb6397e12f44df01a366ec
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2913000
Reviewed-by: Dominic Battré <battre@chromium.org>
Reviewed-by: Julian Pastarmov <pastarmovj@chromium.org>
Reviewed-by: Emily Stark <estark@chromium.org>
Commit-Queue: Julian Pastarmov <pastarmovj@chromium.org>
Auto-Submit: David Benjamin <davidben@chromium.org>
Cr-Commit-Position: refs/heads/master@{#886738}
base::size() has been moved to base/cxx17_backports.h, so .cc files that
use base::size(), but no other function from base/stl_util.h, can
directly include base/cxx17_backports.h and not base/stl_util.h.
Bug: 1210983
Change-Id: I445378492ab1193ea76ca0c0b9958e9cb9c4ca0f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2915464
Reviewed-by: Colin Blundell <blundell@chromium.org>
Reviewed-by: Greg Kerr <kerrnel@chromium.org>
Commit-Queue: Greg Kerr <kerrnel@chromium.org>
Auto-Submit: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#886365}
It's possible for the underlying PrefStores to be initialized before
SegregatedPrefStore registers its own PrefStore::Observers to track
initialization state.
Changes counter-based initialization state management to more explicit
checks on the underlying PrefStore::IsInitializationComplete(). Adds a
unit test that initializes the underlying PrefStores before constructing
SegregatedPrefStore to verify expected PrefStore::Observer behavior.
Also renames AggregatingObserver to UnderlyingPrefStoreObserver since we
use a separate Observer instance for each underlying store rather than a
single aggregating PrefStore::Observer for the entire
SegregatedPrefStore.
Bug: b/187429922
Test: components_unittests
Test: On chromecast enabled device.
Change-Id: I6d926ee8639fd1ca844bc762ab55c9668146d988
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2903743
Commit-Queue: Akira Baruah <akirabaruah@google.com>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Reviewed-by: Kenneth MacKay <kmackay@chromium.org>
Cr-Commit-Position: refs/heads/master@{#885642}
Repeatedly use grep to find all the files in components/ and ui/ that
includes base/stl_util.h but do not use any functions provided by
base/stl_util.h and base/cxx*_backports.h, and then remove the
base/stl_util.h include from them. Files that include base/stl_util.h,
but actually needs base/cxx*_backports.h, will be dealt with separately.
Bug: 1194078
Change-Id: I4b598b64de3aab1e3ee61fed81a31e35913e2ed1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2912134
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Owners-Override: Nico Weber <thakis@chromium.org>
Auto-Submit: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#885638}
Programmatically delete redundant metadata.
This CL is entirely machine-generated:
1. Export the metadata in the "original" and "reduced" forms:
dirmd read -form original > ~/tmp/dirmd/original.json
dirmd read -form reduced > ~/tmp/dirmd/reduced.json
2. Run reduce.py
Source code: https://gist.github.com/nodirg/a4803af94ffe258ba0a6e0a4807141d8
The script diffs the two JSON files and strips redundant
lines from DIR_METADATA files. If the file became empty, then
removes the file.
The results of the script was verified by diffing canonical
representation of `dirmd read -form full` before and after
the script: there is no diff.
Bug: 1179786
Change-Id: Ie5de3ba0962d266244ffb9b07c874b3dbbb69b9c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2795985
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Fred Mello <fredmello@chromium.org>
Owners-Override: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: Nodir Turakulov <nodir@chromium.org>
Cr-Commit-Position: refs/heads/master@{#883868}
This change removes the use of Value::GetAs* and replaces with
Value::is_*(), Value::Get*(), Value::GetIf*().
Bug: 1187007,1187003
Change-Id: I9779fe3d42508931d81a7357e2696e37495043ad
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2888488
Reviewed-by: Gabriel Charette <gab@chromium.org>
Commit-Queue: Ayu Ishii <ayui@chromium.org>
Cr-Commit-Position: refs/heads/master@{#882160}
Headers outside of base/ that do not reference base::Value and related
value classes have no reason to include base/values.h. Remove these
includes and fix up the broken parts of the build.
Bug: 242216
Change-Id: I432045cc94a63603b2298e56adc7a2d5bf3dc9be
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2857497
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Owners-Override: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#880255}
This change removes the use of Value::GetAsBoolean
and replaces with Value::is_bool(), Value::GetBool(),
Value::GetIfBool().
Bug: 1187003
Change-Id: I976fe594c0c3e5242641205060ca1b02a61149e0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2867834
Reviewed-by: Gabriel Charette <gab@chromium.org>
Commit-Queue: Ayu Ishii <ayui@chromium.org>
Cr-Commit-Position: refs/heads/master@{#879855}
These changes have been run against the trybots, but please
double-check that the conversions have been done appropriately
(in case any of these changes are not covered by tests).
In particular, make sure (1) non-equality is retained and that
(2) Values are being compared, not their pointers.
(1) !a.Equals(&b) -> a != b
(2) a->Equals(b) -> *a == *b
Thank you!
This CL was uploaded by git cl split.
R=battre@chromium.org
Bug: 1187018
Change-Id: I6a915a55865373adbffc196301c56b4f6afafab4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2875392
Auto-Submit: Austin Sullivan <asully@chromium.org>
Reviewed-by: Dominic Battré <battre@chromium.org>
Commit-Queue: Dominic Battré <battre@chromium.org>
Cr-Commit-Position: refs/heads/master@{#879772}
https://chromium-review.googlesource.com/c/chromium/src/+/2756943
sets //base:jni_java as public_deps for //base:base_java
This makes setting both //base:jni_java and //base:base_java as deps
of an android_library() redundant.
This CL was generated by the following Python script:
def main():
for root, dirs, files in os.walk("."):
for f in files:
if not f.endswith(".gn"):
continue
path = os.path.join(root, f)
previous_line = None
found = False
with open(path) as f:
for line in f.readlines():
stripped = line.strip()
if re.match(r'"//base:jni_java"[,]?', stripped) and re.match(r'"//base:base_java"[,]?', previous_line):
found = True
previous_line = stripped
if found:
subprocess.run(["sed", "-i", 's/"\/\/base:jni_java",//g', path])
subprocess.run(["sed", "-i", 's/"\/\/base:jni_java"//g', path])
BUG=953832
Change-Id: I97dcd4996b69c6bcf30367d6405d130540dcdf5f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2775795
Commit-Queue: Peter Kotwicz <pkotwicz@chromium.org>
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: Yaron Friedman <yfriedman@chromium.org>
Owners-Override: Yaron Friedman <yfriedman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#866468}
This CL switches depenendencies on the
//third_party/android_deps:androidx alias to refer to
//third_party/androidx instead.
This CL was generated via:
find . -name *.gn -exec sed -i 's/android_deps:androidx/androidx:androidx/g' {} +
BUG=1064277
Change-Id: I3238cd487298ef733939ade5edf5898dd374c5ec
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2693055
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Commit-Queue: Peter Kotwicz <pkotwicz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#853751}