0
Commit Graph

1068 Commits

Author SHA1 Message Date
Clark DuVall
49ba4d43b2 Avoid launching a process for each image decode on Android
The Android NTP page and omnibox suggestions launch a process for each
image that needs decoding. This can lead to launching many processes on
startup or while typing in the omnibox. Process launching is very
expensive on Android, so this patch batches these decode requests
together to use the same process.

Bug: 1322594
Change-Id: If4872ff85df2753a7e59e660f031a8ffe7a84147
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3628164
Reviewed-by: Carlos Knippschild <carlosk@chromium.org>
Reviewed-by: Marc Treib <treib@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Kristi Park <kristipark@chromium.org>
Commit-Queue: Clark DuVall <cduvall@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1000128}
2022-05-05 22:29:44 +00:00
David Bertoni
995a14e06b [CodeHealth] Remove uses of ListValue::Append in /components/ntp_snippets.
This CL removes uses of the overload that accepts a
std::unique_ptr<base::Value>. It attempts to modernize code where
feasible and uses base::Value::FromUniquePtrValue where it's not.

This CL was uploaded by git cl split.

R=carlosk@chromium.org

Bug: 1187097
Change-Id: I4135df4d9c3ff39e87f438dc9eee8628b346803e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3626217
Auto-Submit: David Bertoni <dbertoni@chromium.org>
Reviewed-by: Carlos Knippschild <carlosk@chromium.org>
Commit-Queue: David Bertoni <dbertoni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#999983}
2022-05-05 18:06:03 +00:00
Gabriel Charette
bdd68018e8 [base] Remove unused post_task.h includes
This CL is a no-op.

Bug: 1026641
AX-Relnotes: n/a
Change-Id: If45d30e748b65097bb6be666dc305c27183d83ef
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3555247
Commit-Queue: Gabriel Charette <gab@chromium.org>
Auto-Submit: Gabriel Charette <gab@chromium.org>
Reviewed-by: Francois Pierre Doray <fdoray@chromium.org>
Commit-Queue: Francois Pierre Doray <fdoray@chromium.org>
Owners-Override: Francois Pierre Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/main@{#987328}
2022-03-31 04:00:05 +00:00
Gabriel Charette
d87f10f467 [base] IWYU for base::Time
This CL is a no-op.

Only fixing instances where base::Time (and Ticks/Delta) is used in
a statement (i.e. not as a parameter to avoid adding includes in mere
overrides). Skipping pointer and reference qualified instances.

i.e. matches this regex:
'(\n *[^/\n][^/\n][^/\n]*base::(Time|Thread)(Ticks|Delta)?\b[^*&][^)]*;)'

and skipping files that have any existing fwd-decl for any of the
variants.

This is a prereq to remove unused base/task/post_task.h includes in
https://chromium-review.googlesource.com/c/chromium/src/+/3555247

Bug: 1026641
Change-Id: I87b43a8dc92bdceb67f4bd59b327b54813aa72a6
AX-Relnotes: n/a.
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3557354
Commit-Queue: Gabriel Charette <gab@chromium.org>
Auto-Submit: Gabriel Charette <gab@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#987283}
2022-03-31 00:44:22 +00:00
Daniel Cheng
7b7aaecca4 Migrate base::{size,empty,data} to STL equivalents in //components.
Bug: 1299695
Change-Id: Ia2ef2239d649b2a50569cad9b3f293ca23510b68
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3491962
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Owners-Override: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#975484}
2022-02-26 17:57:25 +00:00
Morten Stenshorne
a5a7198cc8 CodeHealth: Modernize DictionaryValue::Set*() in components/ntp_snippets
Bug: 1187025, 1187026, 1187027, 1187028
Change-Id: I5e910301ce7dbda84a7f0ecd4cdc46fa3b26b90c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3452344
Reviewed-by: Dan H <harringtond@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/main@{#969527}
2022-02-10 17:49:07 +00:00
Daniel Cheng
91148c1c1e Migrate base::Value::GetList() to base::Value::GetListDeprecated(): 2/N.
GetList() will be reimplemented in a future CL with an updated
signature, so existing uses need to be renamed out of the way.

Unlike TakeList() and TakeDict(), GetList() is used quite widely. This
CL migrates a number of uses using the following set of automated steps:

sed -i "s|\.GetList()|.GetListDeprecated()|g" \
    $(git gs "GetList()" --name-only)
git checkout -- base/values.cc base/values.h
git checkout -- base/values_unittest.cc third_party/dom_distiller_js
git checkout -- tools/clang
git cl format

Bug: 1291666
Change-Id: I0413b4857cbf38943333988e36da53f44aab7a15
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3435727
Reviewed-by: danakj chromium <danakj@chromium.org>
Commit-Queue: danakj chromium <danakj@chromium.org>
Owners-Override: danakj chromium <danakj@chromium.org>
Cr-Commit-Position: refs/heads/main@{#966793}
2022-02-03 17:39:57 +00:00
Daniel Cheng
354945de1f Migrate base::Value::GetList() to base::Value::GetListDeprecated(): 1/N.
GetList() will be reimplemented in a future CL with an updated
signature, so existing uses need to be renamed out of the way.

Unlike TakeList() and TakeDict(), GetList() is used quite widely. This
CL migrates a number of uses using the following set of automated steps:

sed -i "s|->GetList()|->GetListDeprecated()|g" \
    $(git gs "GetList()" --name-only)
git checkout -- base/values_unittest.cc third_party/dom_distiller_js
git cl format

Bug: 1291666
Change-Id: I1b7a92fcb4874e7afb82d4bd092c1c9de2cc3d05
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3430698
Reviewed-by: danakj chromium <danakj@chromium.org>
Owners-Override: danakj chromium <danakj@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#966487}
2022-02-02 23:39:17 +00:00
Xiaohan Wang
bca91f9c4a components: Use BUILDFLAG for OS checking
Use BUILDFLAG(IS_XXX) instead of defined(OS_XXX).

Generated by `os_buildflag_migration.py` (https://crrev.com/c/3311983).

Bug: 1234043
Test: No functionality change
Change-Id: I0b8d92c2fe79a3904bcb2d22f12032424e32d576
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3391443
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Xiaohan Wang <xhwang@chromium.org>
Cr-Commit-Position: refs/heads/main@{#959660}
2022-01-15 19:56:21 +00:00
Victor Hugo Vianna Silva
0c9e780157 Adopt base::Reversed() in components/ iterator loops
No behavior is changed.

- Before
for (auto it = v.rbegin(); it != v.rend(); it++)
- After
for (const Foo& foo : base::Reversed(v))

Bug: 1287358
Change-Id: I41bdd38769d8c7364a8482f584d4181099b988fd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3386378
Auto-Submit: Victor Vianna <victorvianna@google.com>
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Commit-Queue: Victor Vianna <victorvianna@google.com>
Cr-Commit-Position: refs/heads/main@{#959272}
2022-01-14 18:07:18 +00:00
Michael Ershov
a4df5a408a [Code Health] Remove DictionaryValue::GetString
Replace deprecated DictionaryValue::GetString with a modern
alternative.

Bug: 1187036
Test: Compilation
Change-Id: I3bfaf6fba96bd9a64035931a95a94d9532cd8d1c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3377052
Reviewed-by: Dan H <harringtond@chromium.org>
Auto-Submit: Michael Ershov <miersh@google.com>
Commit-Queue: Michael Ershov <miersh@google.com>
Cr-Commit-Position: refs/heads/main@{#958497}
2022-01-13 10:01:59 +00:00
Austin Sullivan
7d219a2536 [Code Health] Refactor PrefService GetDict + GetList to use base::Value
LSC doc: go/prefservice-value-refactor

All type  changes are commented.

Bug: 1187001, 1187061, 1187062
Change-Id: Iafefe56f769b7cb4a05ed4afbfb6e9a561b4704a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3343526
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Owners-Override: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Austin Sullivan <asully@chromium.org>
Cr-Commit-Position: refs/heads/main@{#952919}
2021-12-20 14:55:31 +00:00
Keishi Hattori
0e45c020c4 Rewrite most Foo* field_ pointer fields to raw_ptr<Foo> field_.
DO NOT REVERT (unless absolutely necessary)! Report build breaks to keishi@(APAC)/glazunov@(EMEA)/sebmarchand@(NA) as soon as you see them. Fixes are expected to be trivial.

This commit was generated automatically, by running the following script: tools/clang/rewrite_raw_ptr_fields/rewrite-multiple-platforms.sh on commit fe74bc434e

For more information, see MiraclePtr One Pager [1], the PSA at chromium-dev@ [2], and the raw_ptr documentation in //base/memory/raw_ptr.md.

FYI This CL does not enable MiraclePtr protection and we expect no behavior change from this.

[1] https://docs.google.com/document/d/1pnnOAIz_DMWDI4oIOFoMAqLnf_MZ2GsrJNb_dbQ3ZBg/edit?usp=sharing
[2] https://groups.google.com/a/chromium.org/g/chromium-dev/c/vAEeVifyf78/m/SkBUc6PhBAAJ

Binary-Size: Increase of around 500kb was approved for MiraclePtr
Include-Ci-Only-Tests: true
No-Tree-Checks: true
No-Presubmit: true
Bug: 1272324, 1073933
Change-Id: I05c86a83bbb4b3f4b017f361dd7f4e7437697f69
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3305132
Commit-Queue: Keishi Hattori <keishi@chromium.org>
Reviewed-by: Bartek Nowierski <bartekn@chromium.org>
Owners-Override: Bartek Nowierski <bartekn@chromium.org>
Cr-Commit-Position: refs/heads/main@{#945735}
2021-11-27 09:25:52 +00:00
Anders Hartvoll Ruud
81e645c95f Eliminate DictionaryValue::GetInteger in components/ntp_[snippets,tiles]
Bug: 1187034
Change-Id: I076c5928ff8cf502e5a8dd548934d8f515e7f523
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3222964
Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org>
Reviewed-by: Dan H <harringtond@chromium.org>
Reviewed-by: Moe Ahmadi <mahmadi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#932961}
2021-10-19 12:16:01 +00:00
Patrick Monette
643cdf6190 Replace base/task/ temporary forward headers with their final locations
Note to QA: This merely changes includes and should not be blamed
for files it touched.

Bug: 1255932
Change-Id: I1ce4e31efd5792ebf2080812e665cae838a54972
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3226943
Reviewed-by: Gabriel Charette <gab@chromium.org>
Owners-Override: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/main@{#932153}
2021-10-15 19:13:42 +00:00
Mike West
800532c0bf Deprecate returning a GURL from GURL::GetOrigin().
This patch renames `GURL::GetOrigin()` to
`GURL::DeprecatedGetOriginAsURL()`. A subsequent patch will
reintroduce a `GURL::GetOrigin()` that returns a `url::Origin`
rather than a `GURL`.

This patch was brought to you by sed, followed by a little manual
work to deal with look-alike methods (most notably
`CascadePriority::GetOrigin()` and `NudgeTracker::GetOrigin()`) and
two or three spots that held pointers to GURLs:

```
git grep -n -l ".GetOrigin(" | \
  xargs -L1 sed -i '' \
    -e 's/\.GetOrigin(/.DeprecatedGetOriginAsURL(/g'
```

Bug: 512374
Change-Id: I03fb290650b8759d9849af0911cad9bdc92a5132
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3220292
Commit-Queue: Mike West <mkwst@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#931431}
2021-10-14 09:26:52 +00:00
Patrick Monette
3d7d70920a Replace task-related headers to their equivalent in base/task/
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}
2021-10-08 20:27:23 +00:00
Anders Hartvoll Ruud
96a300fa9a Eliminate DictionaryValue::GetDouble in components/
Bug: 1187035
Change-Id: I53b218e2cfb1b6e5fee7d2b9884fc3884a3e7929
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3205117
Reviewed-by: Marc Treib <treib@chromium.org>
Reviewed-by: Colin Blundell <blundell@chromium.org>
Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org>
Cr-Commit-Position: refs/heads/main@{#928670}
2021-10-06 15:15:23 +00:00
Peter Kasting
e5a38eddbd Migrate "base::TimeDelta::FromX" to "base:X".
All changes were done automatically with git grep, sed, xargs, etc.

No-Presubmit: true
No-Try: true
Bug: 1243777
Change-Id: I7cc197e9027f7837cd36afc67a209079f85ec364
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3198824
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@{#927512}
2021-10-02 03:06:35 +00:00
Peter Kasting
8b66732138 Fix some instances of -Wshadow.
Bug: 794619
Change-Id: Iad4f5423d7d69c9d8f41de530f73dded7a8dda25
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3146373
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Reviewed-by: Rohit Rao <rohitrao@chromium.org>
Commit-Queue: Rohit Rao <rohitrao@chromium.org>
Cr-Commit-Position: refs/heads/main@{#919382}
2021-09-08 19:36:37 +00:00
Clark DuVall
23192259d2 [Code Health] Remove ListValue::GetSize in //components
This was an automated change done with a slightly modified copy of
//tools/clang/value_cleanup.

Bug: 1187064
Change-Id: Ia4cad3eb393798a00a39577411076f3e614c1bb9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3138835
Auto-Submit: Clark DuVall <cduvall@chromium.org>
Commit-Queue: Colin Blundell <blundell@chromium.org>
Reviewed-by: Colin Blundell <blundell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#917646}
2021-09-02 13:46:33 +00:00
Clark DuVall
f138b4dac9 [Code Health] Remove ListValue::Append(Integer|Boolean)
This was an automated change done with a slightly modified copy of
//tools/clang/value_cleanup.

A small manual change was made to gin_java_method_invocation_helper.cc
which required casting to use the correct Append() override.

Bug: 1187102
Change-Id: I767dce49ac8322a5360ce1197db7e4b1f598d35d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3131662
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Colin Blundell <blundell@chromium.org>
Reviewed-by: Yuchen Liu <yucliu@chromium.org>
Reviewed-by: Steven Bennetts <stevenjb@chromium.org>
Reviewed-by: Jonathan Ross <jonross@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Jamie Walch <jamiewalch@chromium.org>
Auto-Submit: Clark DuVall <cduvall@chromium.org>
Commit-Queue: Clark DuVall <cduvall@chromium.org>
Cr-Commit-Position: refs/heads/main@{#917304}
2021-09-01 18:07:05 +00:00
Clark DuVall
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
David Levy
4e2d4aa910 Remove calls to deprecated DictionaryValue::GetBoolean.
Bug: 1187033
Change-Id: Ieee1d48ea56152aa9ef7e01da78b9cfac7109f0d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3114837
Reviewed-by: Dan H <harringtond@chromium.org>
Commit-Queue: David Levy <drl@google.com>
Cr-Commit-Position: refs/heads/main@{#914810}
2021-08-24 17:57:55 +00:00
David Bienvenu
a24088dc50 Fix DISALLOW_COPY_AND_ASSIGN and mock warnings in ntp_snippets
Use NiceMocks to silence uninteresting mock function call warnings.
Also fix cpp lint errors.

Bug: 1010217
Change-Id: Ia2f64a0412581c2bebd31e096b1db278177a8843
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3108645
Reviewed-by: Carlos Knippschild <carlosk@chromium.org>
Commit-Queue: David Bienvenu <davidbienvenu@chromium.org>
Cr-Commit-Position: refs/heads/main@{#913887}
2021-08-20 18:04:17 +00:00
Victor Hugo Vianna Silva
f85d8a74db [automated] Drop needless <vector> includes in /components/ntp_snippets
This is among the most costful includes for the Chromium build.
https://commondatastorage.googleapis.com/chromium-browser-clang/include-analysis.html

This batch of CLs attempts to detect and remove leftover includes with a
heuristic: choose files which don't contain 'std::vector' or 'push_back'.
This doesn't really guarantee that std::vector is not being used, as
shown by the snippets below, so please review carefully.
```
auto v = GetVector();
MyVectorAlias v = GetVector();
my_vector_ = GetVector();
```

This CL was uploaded by git cl split.

R=carlosk@chromium.org

Bug: 1233968
Change-Id: I13bff4a8779fff43676e027fbc6191ff2f26e75c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3059559
Commit-Queue: Victor Vianna <victorvianna@google.com>
Auto-Submit: Victor Vianna <victorvianna@google.com>
Reviewed-by: Carlos Knippschild <carlosk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#906493}
2021-07-29 00:51:13 +00:00
Avi Drissman
d383d0b3e4 Move most usages of base::ClampToRange to base::clamp
base::ClampToRange will return bogus results if `lo` is greater
than `hi`. This is a source of bugs. Because of this, base::clamp
CHECKs in that case. This CL moves users of base::ClampToRange
over if they pass their tests with base::clamp, preventing
errors in the future.

Bug: 1231569
Change-Id: Id12046d6cab2736f9f3c7df068345394f45fd01c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3045786
Commit-Queue: Avi Drissman <avi@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#905034}
2021-07-24 07:02:00 +00:00
Lei Zhang
4f52073ed2 Remove unneeded includes of optional.h from headers.
Headers that do not reference absl::optional do not need to include
third_party/abseil-cpp/absl/types/optional.h.

Bug: 1227131
Change-Id: Ibe634116da4a61260936be5b624fb1b9895505cf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3036368
Reviewed-by: Nico Weber <thakis@chromium.org>
Owners-Override: Nico Weber <thakis@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#903283}
2021-07-20 00:52:31 +00:00
Matt Menke
5096a86d5d Add missing includes to components/ and content/
This was split off of
https://chromium-review.googlesource.com/c/chromium/src/+/3025728,
which a large number of IWYU issues expecting SimpleURLLoader to
bring in url_response_head.mojom.h, which I'm trying to remove.

Bug: 1227131
Change-Id: I792339d9962f1ab0135dc512376abb2abdbb6828
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3035902
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Owners-Override: Jochen Eisinger <jochen@chromium.org>
Commit-Queue: Matt Menke <mmenke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#902838}
2021-07-17 20:30:00 +00:00
Kentaro Hara
ee5e6a9150 Remove inactive OWNERS from Chromium
This is an attempt to remove inactive OWNERS from Chromium.
In 2021 June, I wrote a tool to list potentially inactive OWNERS
in the past six months. I added the list to the spreadsheet
(https://docs.google.com/spreadsheets/d/1vkyGq1lAn_ZhbvzlZvQMKFBLcH9db0xBMFr-ZzWM7no/edit?)
and asked the listed people to flip "Drop me" to "Keep me" if
they want to stay as an OWNER. I sent the reminder email twice.
This CL removes OWNERS who are still marked as "Drop me".

Note: It's possible that someone couldn't respond to my emails
because they were on a long vacation etc. In that case, they can
simply add their name back. haraken@ will LGTM the change.

Bug: None
Change-Id: Iad57f8ea2308fd5c285b0ca79c19690c79f3d6dd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3010910
Commit-Queue: Kentaro Hara <haraken@chromium.org>
Owners-Override: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Yaron Friedman <yfriedman@chromium.org>
Reviewed-by: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Yuki Shiino <yukishiino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#902330}
2021-07-16 05:26:37 +00:00
tom
10f2987476 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=carlosk@chromium.org

Bug: 1187007
Change-Id: I1c8441a106f446ad5f409744462842a2aafbb8a0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3033164
Auto-Submit: Thomas Lukaszewicz <tluk@chromium.org>
Reviewed-by: Carlos Knippschild <carlosk@chromium.org>
Commit-Queue: Carlos Knippschild <carlosk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#902245}
2021-07-16 01:07:25 +00:00
Lei Zhang
a6fa14833a Swap from base/stl_util.h to cxx20_erase.h in components/.
base::Erase() and base::EraseIf() have been moved to
base/containers/cxx20_erase.h, so .cc files that use these functions,
but no other function from base/stl_util.h, can directly include
cxx20_erase.h and not stl_util.h.

Bug: 1211125
Change-Id: Ia8f213f1136ac4c5278cd096b1270002884b556d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2994779
Reviewed-by: Colin Blundell <blundell@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#897400}
2021-06-30 16:14:59 +00:00
Lei Zhang
d89b6cc9b1 Make include of <vector> in base/template_util.h conditional.
It is only required for specific GCC versions to work around a compiler
bug. This effectively removes the header from the file from the
perspective of most developers, since they build with Clang.

Then do IWYU for files that are missing STL includes to fix the build.

Change-Id: I3bc9aafdbe2a890d56c4a7d8dc0da26a59dc033d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2991855
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@{#896752}
2021-06-29 02:07:30 +00:00
Hans Wennborg
d3bd0a9748 Add includes in preparation for leaner mojom.h files (1/3)
In order to reduce build times, generated mojom.h files will use
forward declarations more aggressively after https://crrev.com/c/2932644

In particular, mojom.h files which define an interface may not provide
full definitions of method parameter types defined in other mojoms.
This reduces the size of those interfaces, but it means that
implementors and callers of such methods may have to include more
headers, as is done in this CL.

Bug: 242216
Change-Id: I2159c9a0bf0d085a49711628132c120318f8b4f5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2959875
Auto-Submit: Hans Wennborg <hans@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Owners-Override: Nico Weber <thakis@chromium.org>
Commit-Queue: Hans Wennborg <hans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#892528}
2021-06-15 11:34:01 +00:00
Scott Violet
a750b4b68c variations: requires explicit call to create VariationsIdsProvider
This way the constructor can be supplied an argument that configures
how signed-in state is treated. This is important for WebLayer as
the signed-in state doesn't make sense, and should be effectively
ignored.

BUG=1148350
TEST=covered by tests

Change-Id: Ia3e2d02ba28df41d3f3160ebd02379875bc1bdb0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2595519
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Reviewed-by: Rohit Rao <rohitrao@chromium.org>
Reviewed-by: John Wu <jzw@chromium.org>
Reviewed-by: Alexei Svitkine <asvitkine@chromium.org>
Commit-Queue: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#889895}
2021-06-07 19:39:21 +00:00
Tanmoy Mollik
aa34c12712 [Signin] Merge Make*PrimaryAccountAvailable() into a single method
There are currently two methods to make primary account available with
different consent level in identity_test_environment. This cl merges
these two method into one and adds a consent_level parameter to that
method.

Bug: 1176695
Change-Id: I567f30936aab4945b9e8de0fded6f5194b7c06f3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2887155
Commit-Queue: Tanmoy Mollik <triploblastic@chromium.org>
Reviewed-by: Colin Blundell <blundell@chromium.org>
Reviewed-by: Mihai Sardarescu <msarda@chromium.org>
Reviewed-by: James Cook <jamescook@chromium.org>
Reviewed-by: John Wu <jzw@chromium.org>
Reviewed-by: Mikel Astiz <mastiz@chromium.org>
Reviewed-by: David Roger <droger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#889261}
2021-06-04 13:12:29 +00:00
Justin DeWitt
7324cfb748 Actually update the Feed referrer.
It should be google.com by default.

Bug: 1195225
Change-Id: I58f1fc3cefcfe9dd42e44cb19ceb012d64f62e75
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2830125
Reviewed-by: Sky Malice <skym@chromium.org>
Reviewed-by: Dan H <harringtond@chromium.org>
Auto-Submit: Justin DeWitt <dewittj@chromium.org>
Commit-Queue: Justin DeWitt <dewittj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#887022}
2021-05-27 03:05:50 +00:00
Lei Zhang
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
Lei Zhang
b2ba72f730 Remove unneeded <string> includes from components/.
This CL is first mechanically generated as follows:

git ls-files components | grep '\.h$' | \
    xargs grep -l '^#include <string>' | \
    xargs grep -L -E 'std::(|w|u16|basic_)string' | \
    xargs grep -L std::char_traits > to_process.txt

cat to_process.txt | xargs sed -i "/^#include <string>$/d"
cat to_process.txt | xargs sed -i '/^$/N;/^\n$/D'

Bug: 1200833
Change-Id: I9e10b2dd04ada72540535649603171245bc8989a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2899212
Reviewed-by: Colin Blundell <blundell@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Auto-Submit: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#884134}
2021-05-18 20:51:39 +00:00
Anton Bikineev
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
Peter Kasting
cc07b335a3 Revert "[sheriff] Revert "Reduce usage of base::UTF8ToUTF16().""
This reverts commit d30ba32898.

The original CL exposed a pre-existing bug in the tests.  This fixes it.

Bug: 1189439
Change-Id: I832366e83092d39a6224f4ee75db2265886ff85a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2880897
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#880613}
2021-05-07 22:58:25 +00:00
Lei Zhang
12341b14c8 Remove unneeded base/files/file_path.h includes in headers.
Headers that do not reference base::FilePath do not need to include
base/files/file_path.h. This reduces the amount of data necessary to
build the chrome target by 175 MB.

Bug: 242216
Change-Id: I7abd8d9fc1862a2dca11292719ab5b9146ab04d1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2878909
Reviewed-by: Peter Boström <pbos@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Owners-Override: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#880501}
2021-05-07 18:59:39 +00:00
Sergey Poromov
d30ba32898 [sheriff] Revert "Reduce usage of base::UTF8ToUTF16()."
This reverts commit cfdeec995e.

Reason for revert: Failing gfx_unittests: https://ci.chromium.org/p/chromium/builders/ci/Linux%20MSan%20Tests

Sample run:
https://ci.chromium.org/ui/p/chromium/builders/ci/Linux%20MSan%20Tests/28335/overview

Original change's description:
> Reduce usage of base::UTF8ToUTF16().
>
> Bug: 1189439
> Change-Id: I6629f3bf416ee60bc479b5f0035f27a9a17adf31
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2876250
> Commit-Queue: Peter Kasting <pkasting@chromium.org>
> Commit-Queue: Lei Zhang <thestig@chromium.org>
> Auto-Submit: Peter Kasting <pkasting@chromium.org>
> Reviewed-by: Lei Zhang <thestig@chromium.org>
> Owners-Override: Lei Zhang <thestig@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#880227}

Bug: 1189439
Change-Id: Ieb04dbb47fb637cef9310b0b9cf685a031421c05
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2878747
Auto-Submit: Sergey Poromov <poromov@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Swapnil Gupta <swapnilgupta@google.com>
Reviewed-by: Sergey Poromov <poromov@chromium.org>
Reviewed-by: Swapnil Gupta <swapnilgupta@google.com>
Owners-Override: Sergey Poromov <poromov@chromium.org>
Cr-Commit-Position: refs/heads/master@{#880365}
2021-05-07 13:20:36 +00:00
Peter Kasting
cfdeec995e Reduce usage of base::UTF8ToUTF16().
Bug: 1189439
Change-Id: I6629f3bf416ee60bc479b5f0035f27a9a17adf31
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2876250
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Owners-Override: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#880227}
2021-05-07 03:06:21 +00:00
David Bertoni
4464e5f1d1 [CodeHealth] Remove uses of ListValue::begin()/end() in /components/ntp_snippets.
This CL removes calls to these deprecated member functions. It also
converts to the newer "for" loop syntax when possible, along with
other minor cleanup.

This CL was uploaded by git cl split.

R=carlosk@chromium.org

Bug: 1187107
Change-Id: Ia3764edd1f5f5376a1c53bfeb89816e476f1e23d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2877396
Auto-Submit: David Bertoni <dbertoni@chromium.org>
Commit-Queue: David Bertoni <dbertoni@chromium.org>
Reviewed-by: Carlos Knippschild <carlosk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#879976}
2021-05-06 18:54:29 +00:00
Lei Zhang
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
Lei Zhang
b49a213e32 Remove unneeded base/strings/stringprintf.h includes.
List of files to delete from generated using the following command:

git grep -l base/strings/stringprintf.h | \
    xargs grep -L 'StringPrint[fV]' | xargs grep -L StringAppend | \
    grep -E '(cc|mm|h)$'

Change-Id: Ibc72245f08730b4d25283e2d966235b61513c7ae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2849392
Reviewed-by: Peter Boström <pbos@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Owners-Override: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#876365}
2021-04-26 23:48:55 +00:00
Lei Zhang
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
Minoru Chikamune
b76cd6857b 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: I3658a0cad63c7c6ce17e1ac170bc63443c64e676
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2831236
Commit-Queue: Minoru Chikamune <chikamune@chromium.org>
Reviewed-by: Carlos Knippschild <carlosk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#874139}
2021-04-20 05:32:30 +00:00
Gauthier Ambard
21b2370e27 [iOS] Support NTPContentSuggestionsEnabled policy
This CL adds support for the NTPContentSuggestionsEnabled policy. If
the policy is not set or set to true, the user has the possibility to
toggle the articles for you. If it is set to false, the articles are
disabled and the user cannot override the setting.

Bug: 1169183
Change-Id: Ie68909ee9bf6141632b85bbebcd9656e5bf27d55
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2642150
Reviewed-by: Fabio Tirelo <ftirelo@chromium.org>
Reviewed-by: Julian Pastarmov <pastarmovj@chromium.org>
Reviewed-by: Rohit Rao <rohitrao@chromium.org>
Reviewed-by: Dan H <harringtond@chromium.org>
Reviewed-by: Tina Wang <tinazwang@chromium.org>
Reviewed-by: Guillaume Jenkins <gujen@google.com>
Commit-Queue: Julian Pastarmov <pastarmovj@chromium.org>
Auto-Submit: Gauthier Ambard <gambard@chromium.org>
Cr-Commit-Position: refs/heads/master@{#873324}
2021-04-16 16:11:27 +00:00