0

457 Commits

Author SHA1 Message Date
2f4838b602 [TTS] Update the Contextual Search promo card appearance
Update the Contextual Search promo card appearance, and also update
Pref from boolean type to string type.

Lite screenshot:
https://screenshot.googleplex.com/6WYDtKCetXHyyKs
dark screenshot:
https://screenshot.googleplex.com/AU8ZNKGo2UzuCaC

Bug: 1245175
Change-Id: Iad45211d2137a1c89649f2e68836452010597c74
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3143107
Commit-Queue: Gang Wu <gangwu@chromium.org>
Reviewed-by: Theresa  <twellington@chromium.org>
Reviewed-by: Sinan Sahin <sinansahin@google.com>
Reviewed-by: Dominic Battré <battre@chromium.org>
Reviewed-by: Stefan Kuhne <skuhne@chromium.org>
Reviewed-by: Donn Denman <donnd@chromium.org>
Cr-Commit-Position: refs/heads/main@{#919518}
2021-09-08 23:29:50 +00:00
e5ee6dfdf9 [Code Health] Convert ListValue::AppendString to Value::Append
This was an automated change done with a slightly modified copy of
//tools/clang/value_cleanup.

Bug: 1187102
Change-Id: Ib36d52b05aedfc87676d301412b21b09497098a9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3131555
Reviewed-by: Jamie Walch <jamiewalch@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Colin Blundell <blundell@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: Clark DuVall <cduvall@chromium.org>
Cr-Commit-Position: refs/heads/main@{#916925}
2021-08-31 19:39:41 +00:00
15f04d2221 Completely migrate //components/prefs to sequence_checker.
//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}
2021-08-27 08:46:21 +00:00
f60c8d2b24 Merge //base/util/values into //base/json
This is part of merging all of //base/util back into //base.

Bug: 1227210
Change-Id: I86ecbe883d6fbc43641bbe90ede532555a9cead3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3049000
Commit-Queue: Albert J. Wong <ajwong@chromium.org>
Reviewed-by: Alan Cutter <alancutter@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#905613}
2021-07-27 07:25:26 +00:00
a0945de76d Write or schedule a write when updating kStabilityExitedCleanly.
Also, schedule a write when updating kVariationsCrashStreak.

Bug: b/184937096
Change-Id: Ib3c438a49de8087dcbe55adc2ff499eded460119
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3046638
Commit-Queue: Caitlin Fischer <caitlinfischer@google.com>
Reviewed-by: Ilya Sherman <isherman@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#904848}
2021-07-23 18:30:11 +00:00
b2777ce3ce More IWYU fixes.
Bug: 242216
Change-Id: I96c2b49a74cd74b15ae6018a5e1bbde118c97199
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3034496
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Owners-Override: danakj <danakj@chromium.org>
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#903588}
2021-07-20 18:28:54 +00:00
tom
f7decab76e CodeHealth: Remove use of Value::GetAsString from //components
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}
2021-07-19 16:32:09 +00:00
6176788bf0 CodeHealth: Remove use of DictionaryValue::Remove in /components
This change removes the use of DictionaryValue::Remove and replaces with
Value::RemovePath()/RemoveKey() or Value::ExtractPath()/ExtractKey().

Bug: 1187051
Change-Id: If5ab564af124659b32464bc9f223790b7406689e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3008176
Commit-Queue: Fangzhen Song <songfangzhen@bytedance.com>
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#902326}
2021-07-16 04:59:40 +00:00
a82378c430 Revert "Remove some unnecessary #includes."
This reverts commit 91aebec2c7.

Reason for revert: Closed tree (https://ci.chromium.org/ui/p/chromium/builders/ci/Win%20Builder/118924/overview)

Original change's description:
> Remove some unnecessary #includes.
>
> According to
> https://commondatastorage.googleapis.com/chromium-browser-clang/include-analysis.html
> these were responsible for 1,460,113,428 bytes of input to the compiler,
> or roughly 0.58% of the input used to build Chrome.
>
> Bug: 242216
> Change-Id: I154d2ec2ddbb50a26b94d9caf378cccfbe1d4769
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3025890
> Reviewed-by: danakj <danakj@chromium.org>
> Owners-Override: danakj <danakj@chromium.org>
> Commit-Queue: Peter Kasting <pkasting@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#901569}

Bug: 242216
Change-Id: Iea760a5eb05e167c0393c72148372db4b766f1e7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3028565
Auto-Submit: Dominique Fauteux-Chapleau <domfc@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Dominique Fauteux-Chapleau <domfc@google.com>
Owners-Override: Dominique Fauteux-Chapleau <domfc@google.com>
Cr-Commit-Position: refs/heads/master@{#901579}
2021-07-14 19:59:31 +00:00
91aebec2c7 Remove some unnecessary #includes.
According to
https://commondatastorage.googleapis.com/chromium-browser-clang/include-analysis.html
these were responsible for 1,460,113,428 bytes of input to the compiler,
or roughly 0.58% of the input used to build Chrome.

Bug: 242216
Change-Id: I154d2ec2ddbb50a26b94d9caf378cccfbe1d4769
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3025890
Reviewed-by: danakj <danakj@chromium.org>
Owners-Override: danakj <danakj@chromium.org>
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#901569}
2021-07-14 19:21:39 +00:00
745dad09cd CodeHealth: Remove DictionaryValue::RemovePath
This change removes the use of DictionaryValue::RemovePath and replaces
with Value::RemovePath() or Value::ExtractPath().

Bug: 1187053
Change-Id: I0dff15ce665043c8850a34c6e66447d4cf9c663f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3012435
Reviewed-by: danakj <danakj@chromium.org>
Reviewed-by: Dominic Battré <battre@chromium.org>
Reviewed-by: John Lee <johntlee@chromium.org>
Reviewed-by: Sam McNally <sammc@chromium.org>
Commit-Queue: Fangzhen Song <songfangzhen@bytedance.com>
Cr-Commit-Position: refs/heads/master@{#899862}
2021-07-09 04:42:50 +00:00
c0e3e30b99 CodeHealth: Remove use of Value::GetAsDouble
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}
2021-07-07 14:42:51 +00:00
838a5429ad Fix -Wloop-analysis warnings in components/.
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}
2021-06-24 23:13:06 +00:00
f4033a8a19 CodeHealth: Remove use of DictionaryValue::Set in /components/prefs
This change removes the use of DictionaryValue::Set and replaces with
Value::SetKey() or Value::SetPath().

This CL was uploaded by git cl split.

R=gab@chromium.org

Bug: 1187023
Change-Id: Ie390dc8085fb07414f4226088b3a33bb840396bc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2972150
Auto-Submit: Fangzhen Song <songfangzhen@bytedance.com>
Commit-Queue: Fangzhen Song <songfangzhen@bytedance.com>
Reviewed-by: Dominic Battré <battre@chromium.org>
Cr-Commit-Position: refs/heads/master@{#894591}
2021-06-22 09:12:42 +00:00
ce1e29491c Add a client-side experiment for extending Variations Safe Mode.
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}
2021-06-12 16:37:01 +00:00
668ead109e Clean up base/observer_list.h includes in headers.
- 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}
2021-06-07 20:25:43 +00:00
75af5f2e43 Code health: remove some deprecated {List,Dict}Value API use from deps of components_unittests
(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}
2021-05-27 17:02:19 +00:00
e8c2b5b89f Disable 3DES by default in //chrome
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}
2021-05-26 15:25:08 +00:00
d073f65fc0 Swap from base/stl_util.h to cxx17_backports.h in components/ .cc files.
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}
2021-05-25 17:43:06 +00:00
6e9da32e79 [prefs] Fix SegregatedPrefStore Observer state
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}
2021-05-21 20:24:09 +00:00
74745fa888 Remove unneeded base/stl_util.h includes in components/ and ui/.
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}
2021-05-21 20:18:20 +00:00
6dfb6d1acc [dirmd] Deduplicate directory metadata
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}
2021-05-18 09:06:24 +00:00
1156b5f891 components: Replace base::Optional and friends with absl counterparts
This replaces:
- base::Optional -> absl::optional
- include "base/optional.h"
  ->
  include "third_party/abseil-cpp/absl/types/optional.h"
- base::nullopt -> absl::nullopt
- base::make_optional -> absl::make_optional

Bug: 1202909
Change-Id: If697b7bf69b199c1796f873eedca3359cdb48c64
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2897151
Commit-Queue: Anton Bikineev <bikineev@chromium.org>
Owners-Override: Anton Bikineev <bikineev@chromium.org>
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#883296}
2021-05-15 22:35:36 +00:00
9dc373d511 CodeHealth: Remove use of ListValue::AppendStrings
This change removes the use of `ListValue::AppendStrings()`
and replaces with `Value::Append()`.

This CL was uploaded by git cl split.

R=gab@chromium.org

Bug: 1187103
Change-Id: I301632f6844e129d9b3f6b147fc212029aa96f1e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2891784
Auto-Submit: Anastasiia N <anastasiian@chromium.org>
Commit-Queue: Anastasiia N <anastasiian@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#882932}
2021-05-14 10:13:20 +00:00
e48b79405c CodeHealth: Remove use of Value::GetAsString/GetAsBoolean
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}
2021-05-12 18:03:18 +00:00
523eec14ad [Code Health] Remove uses of Value::CreateDeepCopy()
This CL was uploaded by git cl split.

R=gab@chromium.org

Bug: 1187013
Change-Id: Id2cbefc10635326c91cc545508ec8a360c74bafe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2873362
Auto-Submit: Austin Sullivan <asully@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Commit-Queue: Austin Sullivan <asully@chromium.org>
Cr-Commit-Position: refs/heads/master@{#881744}
2021-05-11 22:48:40 +00:00
12c5e9b91e [Code Health] Remove uses of Value::DeepCopy()
Uses have been replaced with Value::Clone(), wrapped with
base::Value::ToUniquePtrValue() when necessary.

Bug: 1187012
Change-Id: I1b52aa70f4f1e2a8e95dcd054db04b59f75cfad2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2873230
Commit-Queue: Austin Sullivan <asully@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#881291}
2021-05-10 23:00:32 +00:00
9d8947da89 CodeHealth: Remove use of DictionaryValue::empty in /components/prefs
This change removes the use of DictionaryValue::empty()
and replaces with Value::DictEmpty()

This CL was uploaded by git cl split.

R=battre@chromium.org

Bug: 1187020
Change-Id: I7aabf5d171332bd744e4c65b60363398e65fb474
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2881599
Auto-Submit: Fangzhen Song <songfangzhen@bytedance.com>
Commit-Queue: Fangzhen Song <songfangzhen@bytedance.com>
Reviewed-by: Dominic Battré <battre@chromium.org>
Cr-Commit-Position: refs/heads/master@{#880876}
2021-05-10 08:19:36 +00:00
5bd78192da CodeHealth: Remove use of DictionaryValue::size()
This change removes the use of DictionaryValue::size()
and replaces with Value::DictSize()

Bug: 1187019
Change-Id: I6bef7537fbd1bc7bd5e518c9ae7fcf51a8444e86
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2878269
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Commit-Queue: Fangzhen Song <songfangzhen@bytedance.com>
Cr-Commit-Position: refs/heads/master@{#880341}
2021-05-07 12:02:10 +00:00
ef1be33557 Remove obviously unneeded includes of base/values.h.
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}
2021-05-07 05:04:43 +00:00
2760ad672c CodeHealth: Remove use of Value::GetAsBoolean
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}
2021-05-06 16:10:14 +00:00
4f5009c4cc [Code Health] Remove uses of Value::Equals()
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}
2021-05-06 10:54:58 +00:00
0bf0ff5b03 Delete unused STL includes from components/ headers.
Headers that do not contain "std::" do not need STL includes.

This CL is mechanically generated as follows:

INCL="algorithm|array|list|map|memory|queue|set|string|utility|vector"
git ls-files components | grep '\.h$' | xargs grep -L std:: | \
    xargs grep -El "#include <($INCL)>$" > to_process.txt

INCL_ESCAPED="$(echo $INCL|sed 's/|/\\|/g')"
cat to_process.txt | xargs sed -i "/^#include <\($INCL_ESCAPED\)>$/d"
cat to_process.txt | xargs sed -i '/^$/N;/^\n$/D'

Bug: 1200833
Change-Id: I3dd65ac6d5b7d2542df285d752af0bd7a9bd965d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2845086
Reviewed-by: Colin Blundell <blundell@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#877818}
2021-04-30 07:25:43 +00:00
cb833fdfd1 Replace non-existing UI>Browser>Preferences
This CL replaces the non-existing crbug.com component
UI>Browser>Preferences with Internals>Preferences and
Services>Safebrowsing to make sure that bug can be routed.


Bug: 1188055
Change-Id: I94f488e706d6b25d8085d5155283a962b6dfe7db
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2851599
Commit-Queue: Dominic Battré <battre@chromium.org>
Commit-Queue: Dominick Ng <dominickn@chromium.org>
Auto-Submit: Dominic Battré <battre@chromium.org>
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Reviewed-by: Varun Khaneja <vakh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#876947}
2021-04-28 07:28:36 +00:00
2fdfa8929a Fix header guards in components/.
Mostly generated mechanically as follows:

git ls-files '*.h' | grep '^components/' | \
    xargs parallel cpplint.py --filter=-,+build/header_guard -- 2>&1 | \
    grep build/header_guard | tools/apply_cpplint_header_guard.py

Except for files in components/policy/core/common/management/, which
were sufficiently wrong that they required manual fixing.

Bug: 1200694
Change-Id: I019b0d5cd2dfc9ca54d09b7085824b0ea9a7f579
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2839703
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#874980}
2021-04-22 02:15:43 +00:00
deb0a5f3ec Move SegregatedPrefStore to components/prefs
We want to use it in Chromecast for other purposes

Change-Id: I664554a451ca643689f4c3896a5ed163d553c956
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2826686
Reviewed-by: Gabriel Charette <gab@chromium.org>
Reviewed-by: Richard Coles <torne@chromium.org>
Commit-Queue: Kenneth MacKay <kmackay@chromium.org>
Cr-Commit-Position: refs/heads/master@{#874497}
2021-04-21 00:33:50 +00:00
6e9533c7a9 CodeHealth: Remove use of Value::GetAsInteger
This change removes the use of Value::GetAsInteger and replaces with
Value::is_int(), Value::GetInt(), Value::GetIfInt().

Bug: 1187004
Change-Id: Idbaa231784ab0ab3e1e9c0797e0467ab8dfa7f7a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2830665
Commit-Queue: Minoru Chikamune <chikamune@chromium.org>
Reviewed-by: Dominic Battré <battre@chromium.org>
Cr-Commit-Position: refs/heads/master@{#873626}
2021-04-17 07:13:40 +00:00
2913349181 CodeHealth: Remove use of Value::GetAsInteger
This change removes the use of Value::GetAsInteger and replaces with
Value::is_int(), Value::GetInt(), Value::GetIfInt().

Bug: 1187004
Change-Id: I853ab7b80ecd02cdd72c95515d12b30adff09dce
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2830060
Reviewed-by: Dominic Battré <battre@chromium.org>
Commit-Queue: Minoru Chikamune <chikamune@chromium.org>
Cr-Commit-Position: refs/heads/master@{#873577}
2021-04-17 02:21:47 +00:00
63d536bddc CodeHealth: Remove use of Value::GetAsInteger
This change removes the use of Value::GetAsInteger and replaces with
Value::is_int(), Value::GetInt(), Value::GetIfInt().

Bug: 1187004
Change-Id: I218a163f5a915e047eb36c54cf107286c80b9c2d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2831155
Reviewed-by: Dominic Battré <battre@chromium.org>
Commit-Queue: Minoru Chikamune <chikamune@chromium.org>
Cr-Commit-Position: refs/heads/master@{#873575}
2021-04-17 02:20:17 +00:00
08d1825198 CodeHealth: Remove use of Value::GetAsInteger
This change removes the use of Value::GetAsInteger and replaces with
Value::is_int(), Value::GetInt(), Value::GetIfInt().

Bug: 1187004
Change-Id: I400126f0ac7b4359b2ff15221c4cb93ad62c8555
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2831121
Reviewed-by: Dominic Battré <battre@chromium.org>
Commit-Queue: Minoru Chikamune <chikamune@chromium.org>
Cr-Commit-Position: refs/heads/master@{#873570}
2021-04-17 02:09:43 +00:00
8dcb6e93a5 CodeHealth: Remove use of Value::GetAsInteger
This change removes the use of Value::GetAsInteger and replaces with
Value::is_int(), Value::GetInt(), Value::GetIfInt().

Bug: 1187004
Change-Id: I0cf57008424988019e3a2562bb28cab1469eb8cf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2831154
Commit-Queue: Minoru Chikamune <chikamune@chromium.org>
Reviewed-by: Dominic Battré <battre@chromium.org>
Cr-Commit-Position: refs/heads/master@{#873555}
2021-04-17 00:54:26 +00:00
073d2b8266 [base] Remove base::Value::DEAD
Clean up an unused value, which was used for an investigation in the
past but not needed anymore.

R=jdoerrie@chromium.org

Bug: 859477
Change-Id: Ibdbc379e029b1ed6c9e41855aa18969229390dfa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2818163
Commit-Queue: Alexander Timin <altimin@chromium.org>
Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org>
Auto-Submit: Alexander Timin <altimin@chromium.org>
Reviewed-by: Jan Wilken Dörrie <jdoerrie@chromium.org>
Owners-Override: Jan Wilken Dörrie <jdoerrie@chromium.org>
Cr-Commit-Position: refs/heads/master@{#871549}
2021-04-12 18:13:07 +00:00
665b49d8d4 Apply modernize-make-unique to components/
This is a large-scale change: go/chromium-modernize-make-unique

Bug: 1194272
Change-Id: I25fbcee8692cf753abdff7a05c7b5f354eb243e7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2797551
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/master@{#869236}
2021-04-05 19:29:58 +00:00
0eca1eba43 [Build] Remove redundant //base:jni_java deps
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}
2021-03-25 05:55:57 +00:00
0409372615 [Build] Switch androidx dependencies to use //third_party/androidx
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}
2021-02-13 00:35:37 +00:00
e3c8381d59 Remove chouinard@ from OWNERS
Change-Id: I8dd5f14b109d59ca72196813bca4e6cd5efaf59e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2676424
Reviewed-by: Theresa  <twellington@chromium.org>
Commit-Queue: Natalie Chouinard <chouinard@chromium.org>
Cr-Commit-Position: refs/heads/master@{#850850}
2021-02-04 23:31:17 +00:00
a84513687c Work toward getting components_unittests building with u16string.
Bug: 911896
Change-Id: Id09a1f2304479794cbcbf4594ffed98c5d1af1a7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2659980
Commit-Queue: Colin Blundell <blundell@chromium.org>
Reviewed-by: Colin Blundell <blundell@chromium.org>
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#849100}
2021-02-01 14:18:04 +00:00
72c5651c7d Get views_unittests building with u16string.
Bug: 911896
Change-Id: I899e1d552f854f3ea5482298d1df32e100f2a0f9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2644155
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Jan Wilken Dörrie <jdoerrie@chromium.org>
Reviewed-by: Dominic Mazzoni <dmazzoni@chromium.org>
Reviewed-by: Kurt Catti-Schmidt <kschmi@microsoft.com>
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Reviewed-by: David Schinazi <dschinazi@chromium.org>
Reviewed-by: Colin Blundell <blundell@chromium.org>
Reviewed-by: Matthew Wolenetz <wolenetz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#847861}
2021-01-27 23:45:53 +00:00
28f9b6817b Migrate might_have_observer to empty in components/prefs and services/
Bug: 1155308
Change-Id: Ib42a0acc0a29beb35ced0e9cd717456c1d62a92e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2638540
Reviewed-by: Gabriel Charette <gab@chromium.org>
Commit-Queue: Mitsuru Oshima <oshima@chromium.org>
Cr-Commit-Position: refs/heads/master@{#845285}
2021-01-20 19:33:07 +00:00
986f0a6805 [base] Change #include for base::Contains [3/5]
This is a mechanical change replacing #includes of base/stl_util.h
with base/containers/contains.h for usages of base::Contains.

TBR=dcheng

Bug: 970209
Change-Id: I2e3362caa55a202db30131a0f997e4ad29cba466
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2579970
Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org>
Reviewed-by: Doug Steedman <dougsteed@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#835419}
2020-12-09 23:29:12 +00:00