0
Commit Graph

990 Commits

Author SHA1 Message Date
Dan Harrington
b0ffac0a4b create components/feed/core/shared_prefs
Feed and Zine share two prefs, but these pref strings are currently
duplicated. This CL makes the pref sharing explicit.
I'm making this change now because I want a feed/core test to use these
prefs.

Bug: 1044139
Change-Id: I9917863385cf0c521ad10e2d6d3913b94f107354
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2025638
Reviewed-by: David Trainor <dtrainor@chromium.org>
Reviewed-by: Carlos Knippschild <carlosk@chromium.org>
Reviewed-by: Eric Noyau <noyau@chromium.org>
Commit-Queue: Dan H <harringtond@chromium.org>
Cr-Commit-Position: refs/heads/master@{#747910}
2020-03-06 22:56:36 +00:00
James Cook
faf1c10a7e Migrate from identity::ScopeSet to signin::ScopeSet
The mojo identity service (//services/identity) is not used in
production. However, a variety of chrome code uses the typedef
identity::ScopeSet when talking to the C++ IdentityManager and
related auth-token code.

Introduce signin::ScopeSet for these use cases.  It's just a
copy of identity::ScopeSet, which is a std::set<std::string>.
I didn't eliminate identity::ScopeSet in this CL due to existing
usage in //services/identity as well as typemapping code.

I'll delete the identity::ScopeSet version when I delete the
rest of the identity service.

TBR=rockot@chromium.org
TBR=droger@chromium.org

Bug: none

Change-Id: Ib938f08763eda81de22a1a79b460011e012a81ac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2076426
Reviewed-by: James Cook <jamescook@chromium.org>
Reviewed-by: Colin Blundell <blundell@chromium.org>
Commit-Queue: James Cook <jamescook@chromium.org>
Cr-Commit-Position: refs/heads/master@{#745049}
2020-02-27 15:23:20 +00:00
Gabriel Charette
dd8d5985e4 Mass-migrate users of base::ThreadPool() as a trait to base::ThreadPool:: API [a-c]
Split directories [a* - components] (%chrome + fuchsia) from
https://chromium-review.googlesource.com/c/chromium/src/+/2026350
as it had trouble landing in one go.

The following script was used to generate this CL (run on every C++
file in the codebase; processing .h before matching .cc/.mm):
https://bugs.chromium.org/p/chromium/issues/detail?id=1026641#c22
(intentionally ignores cleaning post_task.h for now).

TBR=fdoray@chromium.org

Bug: 1026641
Change-Id: I611ee5abce6daf14f80fbbf41e1fc14b6a1411d8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2075097
Reviewed-by: Gabriel Charette <gab@chromium.org>
Reviewed-by: François Doray <fdoray@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#744724}
2020-02-26 18:38:35 +00:00
Nico Weber
fb2cf665af Reformat all gn files in /components/
`gn format` recently changed its formatting behavior
for deps, source, and a few other elements when they
are assigned (with =) single-element lists to be consistent
with the formatting of updates (with +=) with single-element.

Now that we've rolled in a GN binary with the change,
reformat all files so that people don't get presubmit
warnings due to this.

This CL was uploaded by me.

Bug: 1041419
Change-Id: I4dc096337fe543a8ff2d027d95323f521989000f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2007768
Reviewed-by: Hans Wennborg <hans@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#732860}
2020-01-17 15:43:34 +00:00
Nicolas Zea
afcd1bad35 Remove zea@ from OWNERS files
zea@ is leaving Chrome, removing from OWNERS files

Change-Id: I4df1ad4b3545cca91489ab7f26f1c0edf0b99bf5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1986245
Commit-Queue: Nicolas Zea <zea@chromium.org>
Reviewed-by: Dmitry Titov <dimich@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#729586}
2020-01-09 01:29:33 +00:00
Ken Rockot
ebba6788aa 🚫Bind: components/ntp_snippets/
Migrates some directories off of deprecated base::Bind, base::Callback,
etc, and onto the newer APIs.

Specifically this covers components/ntp_snippets/

Fixed: 1007707
Change-Id: I309dfebb2306bbae5536fe526e5522ddab5e57b6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1977839
Reviewed-by: Patrick Noland <pnoland@chromium.org>
Commit-Queue: Ken Rockot <rockot@google.com>
Cr-Commit-Position: refs/heads/master@{#726855}
2019-12-20 18:22:24 +00:00
Ilia Samsonov
6cd734fc00 Add prefix to empty param tests.
googletest will no longer support empty prefix
for parameterized INSTANTIATE_TEST_SUITE_P.
Adding "All" prefix to existing empty prefix test suites.

This CL was uploaded by git cl split.

R=fgorski@chromium.org

Bug: 1023677
Change-Id: I76e426feaba62bb3732ce1c4d217add188d797cd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1924803
Commit-Queue: Ilia Samsonov <isamsonov@google.com>
Auto-Submit: Ilia Samsonov <isamsonov@google.com>
Reviewed-by: Filip Gorski <fgorski@chromium.org>
Cr-Commit-Position: refs/heads/master@{#717343}
2019-11-20 23:52:45 +00:00
Andrew Grieve
9ca0bce70e Fix a few instances of missing "const".
Found via SuperSize query:
  size_info.symbols.WhereFullNameMatches(r'\bk[A-Z]').WhereInSection('d')

TBR=agrieve  # Trivial refactor

Bug: 747064
Change-Id: Ib9615718e0f6cacb081f9ea2f5295348d32cdcb8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1901641
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#713557}
2019-11-07 20:15:10 +00:00
Chris Mumford
c4bf792690 ntp: Removed unnecessary use of test functor.
Several tests were using testing::CreateFunctor unnecessarily.
gmock's testing::Invoke() already supports a function pointer
as an argument. This change simplifies the tests and upcoming
refactoring to the functor implementation in gmock_mutant.h.

Bug: 1007833, 806952
Change-Id: Ifca2fdc2364b770761f2da9f6d2b36a95b5c1547
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1874050
Reviewed-by: Filip Gorski <fgorski@chromium.org>
Commit-Queue: Chris Mumford <cmumford@google.com>
Cr-Commit-Position: refs/heads/master@{#708377}
2019-10-22 22:13:00 +00:00
Tanmoy Mollik
bb0db7142e Refactor rest of the usecases of account id to CoreAccountId
With this cl it is now possible to build chrome without referencing any
instance of CoreAccountId as std::string.

Bug: 959157
Change-Id: I206ce350bde21d97161719690d0db243bbdbc0c7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1840236
Reviewed-by: Colin Blundell <blundell@chromium.org>
Reviewed-by: Parastoo Geranmayeh <parastoog@google.com>
Reviewed-by: Mihai Sardarescu <msarda@chromium.org>
Reviewed-by: Tatiana Gornak <melandory@chromium.org>
Reviewed-by: David Roger <droger@chromium.org>
Commit-Queue: Tanmoy Mollik <triploblastic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#705935}
2019-10-15 13:31:22 +00:00
Brandon Wylie
ec7a2be5c4 Fix crash in remote_suggestions_database and add unittests
Bug: 1006139
Change-Id: I50741f80d4c40290caef9e1814e26f5a409d4b3c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1829983
Commit-Queue: Brandon Wylie <wylieb@chromium.org>
Reviewed-by: Carlos Knippschild <carlosk@chromium.org>
Reviewed-by: Sky Malice <skym@chromium.org>
Cr-Commit-Position: refs/heads/master@{#701848}
2019-10-02 00:54:35 +00:00
Lucas Furukawa Gadani
0690260b7c Convert services/network/test/ to use URLResponseHead mojom types.
This CL converts files in services/network/test to use the
mojom::URLResponseHead type instead of the native ResourceResponseHead
struct.

Bug: 984550
Change-Id: I59e3900f9b3865b29e5b976226a249e8d47f2dad
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1808489
Reviewed-by: Tim Volodine <timvolodine@chromium.org>
Reviewed-by: Filip Gorski <fgorski@chromium.org>
Reviewed-by: Sorin Jianu <sorin@chromium.org>
Reviewed-by: Roger McFarlane <rogerm@chromium.org>
Reviewed-by: David Trainor <dtrainor@chromium.org>
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Reviewed-by: Alexei Svitkine <asvitkine@chromium.org>
Reviewed-by: Mihai Sardarescu <msarda@chromium.org>
Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Ben Greenstein <bengr@chromium.org>
Reviewed-by: Jamie Walch <jamiewalch@chromium.org>
Reviewed-by: J Kardatzke <jkardatzke@chromium.org>
Reviewed-by: Nathan Parker <nparker@chromium.org>
Reviewed-by: Michael Giuffrida <michaelpg@chromium.org>
Reviewed-by: Marc Treib <treib@chromium.org>
Reviewed-by: Vadym Doroshenko <dvadym@chromium.org>
Reviewed-by: Drew Wilson <atwilson@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Justin Cohen <justincohen@chromium.org>
Reviewed-by: Rohit Rao <rohitrao@chromium.org>
Commit-Queue: Lucas Gadani <lfg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#700847}
2019-09-27 20:44:27 +00:00
Evan Stade
075f7e9039 Update ScopedObserver declarations in //components
These were found by attempting to compile the chrome target
on Linux.

Bug: 998625
Change-Id: I61be77960234119c587a055b9613ab31e4030bfc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1788199
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Evan Stade <estade@chromium.org>
Cr-Commit-Position: refs/heads/master@{#696814}
2019-09-16 16:04:19 +00:00
Jan Wilken Dörrie
d322b291d9 [base] Replace GetList().{emplace,push}_back with Append in //components
This change replaces usages of base::Value::GetList() followed by either
emplace_back() or push_back() with base::Value::Append(). This is
because of the upcoming change to GetList() to return a base::span
instead, which does not support either emplace_back() or push_back().

This is a completely mechanical change. Steps to reproduce:
- sed -i 's/GetList().push_back/Append/g'
- sed -i 's/GetList().emplace_back/Append/g'
- git cl format

Bug: 646113
Change-Id: Ia29bc02040a056e518737f2b11f1cd0b66b0e0f3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1796430
Reviewed-by: Colin Blundell <blundell@chromium.org>
Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org>
Cr-Commit-Position: refs/heads/master@{#695530}
2019-09-11 09:03:49 +00:00
Gabriel Charette
c30de0a2df Backport some tests in /components/ntp_snippets to SingleThreadTaskEnvironment
These tests were previously migrated from single-threaded MessageLoop to
a multi-threaded TaskEnvironment (then named ScopedTaskEnvironment) as
part of crbug.com/891670.

//base OWNERS decided in retrospect that it was better to keep a
single-threaded option for TaskEnvironment and introduced
SingleThreadTaskEnvironment. This CL retrofits that decision for
/components/ntp_snippets.

This CL is a no-op if it passes CQ.

This CL was uploaded by git cl split.

R=noyau@chromium.org

Bug: 891670
Change-Id: Ib3206c1a7c5241a2f8f6d515f7f321be5058519f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1787205
Auto-Submit: Gabriel Charette <gab@chromium.org>
Reviewed-by: Eric Noyau <noyau@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#695326}
2019-09-10 21:19:12 +00:00
Peter Kasting
7eadc53194 Replace nested min/max calls with base::ClampToRange() in components/.
Bug: 1000055
Change-Id: I18e9dda2079ac4634abcb4cadd35fbcb11b82c08
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1793257
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Commit-Queue: Colin Blundell <blundell@chromium.org>
Reviewed-by: Colin Blundell <blundell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#695188}
2019-09-10 16:02:45 +00:00
Dan Harrington
51ddbe737a Enable NTPRemoteSuggestionsOptionalImages by default
This has been verified to work with the updated server.

Bug: 984787
Change-Id: Ie65f593fa885e759f62550fa53f53d2370124cc0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1782972
Reviewed-by: Dmitry Titov <dimich@chromium.org>
Commit-Queue: Dan H <harringtond@chromium.org>
Cr-Commit-Position: refs/heads/master@{#692884}
2019-09-03 22:19:45 +00:00
Gabriel Charette
c710874894 Reland "[TaskEnvironment] Complete migration with header rename"
This is a reland of 18947083c7

The move_source_file.py script's formatting rules incorrectly
formatted services/device/generic_sensor/platform_sensor_and_provider_unittest_win.cc
after all. But we also can't rely 100% on git cl format (crbug.com/997063)
so I ended up performing a git cl format && git add -up
(+interactive addition of missing blank line after foo.h when included
from top of foo.cc)

Also added
$ tools/git/move_source_file.py net/test/test_with_scoped_task_environment.h net/test/test_with_task_environment.h

Original change's description:
> [TaskEnvironment] Complete migration with header rename
>
> This is merely:
>
> $ tools/git/move_source_file.py base/test/scoped_task_environment.h base/test/task_environment.h
> $ tools/git/move_source_file.py base/test/scoped_task_environment.cc base/test/task_environment.cc
> $ tools/git/move_source_file.py base/test/scoped_task_environment_unittest.cc base/test/task_environment_unittest.cc
> $ tools/git/move_source_file.py content/public/test/test_browser_thread_bundle.h content/public/test/browser_task_environment.h
> $ tools/git/move_source_file.py content/public/test/test_browser_thread_bundle.cc content/public/test/browser_task_environment.cc
> $ tools/git/move_source_file.py content/public/test/test_browser_thread_bundle_unittest.cc content/public/test/browser_task_environment_unittest.cc
> $ tools/git/move_source_file.py ios/web/public/test/test_web_thread_bundle.h ios/web/public/test/web_task_environment.h
> $ tools/git/move_source_file.py ios/web/test/test_web_thread_bundle.cc ios/web/test/web_task_environment.cc
>
> and a few manual renames in DEPS files missed by the script
>
> This CL uses --bypass-hooks to avoid having to git cl format because
> many headers are being reordered by git cl format and it's too many to
> figure out in a no-op CL which ones are okay with it.
> windows.h for one should typically be first and another one of the
> reorderings in PS3 even caused a compile failure:
> https://chromium-review.googlesource.com/c/chromium/src/+/1764962/3/components/services/font/font_loader_unittest.cc
>
> TBR=dcheng@chromium.org
>
> Bug: 992483
> Change-Id: I32a4afd43ef779393c95d9873c157be2d3da1dd1
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1764962
> Reviewed-by: Gabriel Charette <gab@chromium.org>
> Reviewed-by: Daniel Cheng <dcheng@chromium.org>
> Commit-Queue: Gabriel Charette <gab@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#689778}

TBR=dcheng@chromium.org

Bug: 992483
Change-Id: I6179dd1329a4d30bf5c65450ea893537f31e6f85
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1767658
Reviewed-by: Gabriel Charette <gab@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#689794}
2019-08-23 03:31:40 +00:00
Gabriel Charette
b69fcd4f6e Revert "[TaskEnvironment] Complete migration with header rename"
This reverts commit 18947083c7.

Reason for revert: broke Win

Original change's description:
> [TaskEnvironment] Complete migration with header rename
> 
> This is merely:
> 
> $ tools/git/move_source_file.py base/test/scoped_task_environment.h base/test/task_environment.h
> $ tools/git/move_source_file.py base/test/scoped_task_environment.cc base/test/task_environment.cc
> $ tools/git/move_source_file.py base/test/scoped_task_environment_unittest.cc base/test/task_environment_unittest.cc
> $ tools/git/move_source_file.py content/public/test/test_browser_thread_bundle.h content/public/test/browser_task_environment.h
> $ tools/git/move_source_file.py content/public/test/test_browser_thread_bundle.cc content/public/test/browser_task_environment.cc
> $ tools/git/move_source_file.py content/public/test/test_browser_thread_bundle_unittest.cc content/public/test/browser_task_environment_unittest.cc
> $ tools/git/move_source_file.py ios/web/public/test/test_web_thread_bundle.h ios/web/public/test/web_task_environment.h
> $ tools/git/move_source_file.py ios/web/test/test_web_thread_bundle.cc ios/web/test/web_task_environment.cc
> 
> and a few manual renames in DEPS files missed by the script
> 
> This CL uses --bypass-hooks to avoid having to git cl format because
> many headers are being reordered by git cl format and it's too many to
> figure out in a no-op CL which ones are okay with it.
> windows.h for one should typically be first and another one of the
> reorderings in PS3 even caused a compile failure:
> https://chromium-review.googlesource.com/c/chromium/src/+/1764962/3/components/services/font/font_loader_unittest.cc
> 
> TBR=dcheng@chromium.org
> 
> Bug: 992483
> Change-Id: I32a4afd43ef779393c95d9873c157be2d3da1dd1
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1764962
> Reviewed-by: Gabriel Charette <gab@chromium.org>
> Reviewed-by: Daniel Cheng <dcheng@chromium.org>
> Commit-Queue: Gabriel Charette <gab@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#689778}

TBR=dcheng@chromium.org,gab@chromium.org

Change-Id: I9aa8ff558d1ff78cebe0c25e559c017578ad4f53
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 992483
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1767657
Reviewed-by: Gabriel Charette <gab@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#689780}
2019-08-23 02:13:29 +00:00
Gabriel Charette
18947083c7 [TaskEnvironment] Complete migration with header rename
This is merely:

$ tools/git/move_source_file.py base/test/scoped_task_environment.h base/test/task_environment.h
$ tools/git/move_source_file.py base/test/scoped_task_environment.cc base/test/task_environment.cc
$ tools/git/move_source_file.py base/test/scoped_task_environment_unittest.cc base/test/task_environment_unittest.cc
$ tools/git/move_source_file.py content/public/test/test_browser_thread_bundle.h content/public/test/browser_task_environment.h
$ tools/git/move_source_file.py content/public/test/test_browser_thread_bundle.cc content/public/test/browser_task_environment.cc
$ tools/git/move_source_file.py content/public/test/test_browser_thread_bundle_unittest.cc content/public/test/browser_task_environment_unittest.cc
$ tools/git/move_source_file.py ios/web/public/test/test_web_thread_bundle.h ios/web/public/test/web_task_environment.h
$ tools/git/move_source_file.py ios/web/test/test_web_thread_bundle.cc ios/web/test/web_task_environment.cc

and a few manual renames in DEPS files missed by the script

This CL uses --bypass-hooks to avoid having to git cl format because
many headers are being reordered by git cl format and it's too many to
figure out in a no-op CL which ones are okay with it.
windows.h for one should typically be first and another one of the
reorderings in PS3 even caused a compile failure:
https://chromium-review.googlesource.com/c/chromium/src/+/1764962/3/components/services/font/font_loader_unittest.cc

TBR=dcheng@chromium.org

Bug: 992483
Change-Id: I32a4afd43ef779393c95d9873c157be2d3da1dd1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1764962
Reviewed-by: Gabriel Charette <gab@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#689778}
2019-08-23 02:05:33 +00:00
Gabriel Charette
dfa3604eca [TaskEnvironment] Mass-migrate away from ScopedTaskEnvironment
(second half of
 https://chromium-review.googlesource.com/c/chromium/src/+/1756247)

This is step  of the mass migration. Some of these will be
backported to SingleThreadTaskEnvironment in a later phase.

scoped_task_environment.h will also only move in a follow-up CL.

TBR=dcheng@chromium.org

Bug: 992483
Change-Id: Ie80f083eeeb209180ab3c2884f1b566f73549cc6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1756248
Reviewed-by: Gabriel Charette <gab@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#688142}
2019-08-19 17:30:11 +00:00
Tanmoy Mollik
40dfc6ee74 Change json_request to use CoreAccountId as account_id
JsonRequest::Builder::SetAuthentication gets CoreAccountId as a parameter
from identity_manager. CoreAccountId is its own stand alone class and
should not be interchangeable with std::string.

Bug: 959157
Change-Id: I5704a54c9c62e0eb1fc2463f0ba7089cc298d650
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1735158
Reviewed-by: Eric Noyau <noyau@chromium.org>
Commit-Queue: Tanmoy Mollik <triploblastic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#685959}
2019-08-12 12:12:34 +00:00
Sami Kyostila
14ca764f15 components: Always specify thread affinity when posting tasks
*** Note: There is no behavior change from this patch. ***

The PostTask APIs will shortly be changed to require all tasks to explicitly
specify their thread affinity, i.e., whether the task should run on the thread
pool or a specific named thread such as a BrowserThread. This patch updates all
call sites with thread affinity annotation. We also remove the "WithTraits"
suffix to make the call sites more readable.

Before:

    // Thread pool task.
    base::PostTaskWithTraits(FROM_HERE, {...}, ...);

    // UI thread task.
    base::PostTaskWithTraits(FROM_HERE, {BrowserThread::UI, ...}, ...);

After:

    // Thread pool task.
    base::PostTask(FROM_HERE, {base::ThreadPool(), ...}, ...);

    // UI thread task.
    base::PostTask(FROM_HERE, {BrowserThread::UI, ...}, ...);

This patch was semi-automatically prepared with these steps:

    1. Patch in https://chromium-review.googlesource.com/c/chromium/src/+/1635827
       to make thread affinity a build-time requirement.
    2. Run an initial pass with a clang rewriter:
       https://chromium-review.googlesource.com/c/chromium/src/+/1635623
    3. ninja -C out/Debug | grep 'requested here' | cut -d: -f1-3 | sort | \
           uniq > errors.txt
    4. while read line; do
         f=$(echo $line | cut -d: -f 1)
         r=$(echo $line | cut -d: -f 2)
         c=$(echo $line | cut -d: -f 3)
         sed -i "${r}s/./&base::ThreadPool(),/$c" $f
       done < errors.txt
    5. GOTO 3 until build succeeds.
    6. Remove the "WithTraits" suffix from task API call sites:

       $ tools/git/mffr.py -i <(cat <<EOF
       [
         ["PostTaskWithTraits",                            "PostTask"],
         ["PostDelayedTaskWithTraits",                     "PostDelayedTask"],
         ["PostTaskWithTraitsAndReply",                    "PostTaskAndReply"],
         ["CreateTaskRunnerWithTraits",                    "CreateTaskRunner"],
         ["CreateSequencedTaskRunnerWithTraits",           "CreateSequencedTaskRunner"],
         ["CreateUpdateableSequencedTaskRunnerWithTraits", "CreateUpdateableSequencedTaskRunner"],
         ["CreateSingleThreadTaskRunnerWithTraits",        "CreateSingleThreadTaskRunner"],
         ["CreateCOMSTATaskRunnerWithTraits",              "CreateCOMSTATaskRunner"]
       ]
       EOF
       )

This CL was uploaded by git cl split.

R=blundell@chromium.org

Bug: 968047
Change-Id: Ie7157527c1c36286c321800db5ecac024e8124c6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1728557
Commit-Queue: Sami Kyöstilä <skyostil@chromium.org>
Auto-Submit: Sami Kyöstilä <skyostil@chromium.org>
Reviewed-by: Colin Blundell <blundell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#683238}
2019-08-01 17:52:25 +00:00
Victor Hugo Vianna Silva
6438571b22 [Refactor] Remove FaviconServerFetcherParams
We move the platform specific logic to be injected on construction of
LargeIconServiceImpl in the factories.

Change-Id: Ied1bc8d640d38d2a5ceca6dd91358f910decd6ba
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1715690
Commit-Queue: Kristi Park <kristipark@chromium.org>
Auto-Submit: Victor Vianna <victorvianna@google.com>
Reviewed-by: Kristi Park <kristipark@chromium.org>
Reviewed-by: Peter Kotwicz <pkotwicz@chromium.org>
Reviewed-by: Wei-Yin Chen (陳威尹) <wychen@chromium.org>
Reviewed-by: Rohit Rao <rohitrao@chromium.org>
Reviewed-by: Jenny Zhang <jennyz@chromium.org>
Reviewed-by: Nicolas Zea <zea@chromium.org>
Reviewed-by: Mikel Astiz <mastiz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#682812}
2019-07-31 18:05:42 +00:00
Victor Hugo Vianna Silva
ee1975ac2d Use single size to request from favicon server in LargeIconService
Currently LargeIconService allows callers to decide the size of the
favicon they wish to download from the favicon server. Depending on
which UI surface the user opens first, a different size is downloaded,
which can cause displaying upscaled icons and decrease in quality. We
solve this by downloading a single sufficiently big size (chosen based
on existing values used by callers), aiming to only have downscaling.

Bug: 982810
Change-Id: Ibad636d4c4d63791e9eb62d99221d9f35c9cb375
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1695268
Commit-Queue: Victor Vianna <victorvianna@google.com>
Reviewed-by: Wei-Yin Chen (陳威尹) <wychen@chromium.org>
Reviewed-by: Kristi Park <kristipark@chromium.org>
Reviewed-by: Mikel Astiz <mastiz@chromium.org>
Reviewed-by: edchin <edchin@chromium.org>
Reviewed-by: Nicolas Zea <zea@chromium.org>
Cr-Commit-Position: refs/heads/master@{#681751}
2019-07-29 09:37:48 +00:00
Yutaka Hirano
3d80498323 Reland "Unify allow_credentials and credentials_mode on network::ResourceRequest"
This is a reland of 1ccc5eeed0

Original change's description:
> Unify allow_credentials and credentials_mode on network::ResourceRequest
>
> Remove allow_credentials, map allow_credentials: false to
> credentials_mode: kOmit and map allow_credentials: true to
> credentials_mode: kInclude.
>
> network::URLLoader cannot handle kSameOrigin. This CL doesn't change
> that. CORSURLLoader translates the value to either kOmit or kInclude.
>
> This works correctly even when OOR-CORS is disabled because in that
> case load flags are set in the renderer. One caveat is we will not
> be able to remove the load flags until we remove the blink-side CORS
> code (M78? M79?) with this change.
>
> This CL removes a validity check for credentials related settings in
> CorsURLLoaderFactory. Originally the check was introduced to check the
> inconsistency between credentials_mode and load flags. After that
> allow_credentials was introduced, and at
> https://crrev.com/c/chromium/src/+/1443976 the logic was changed to
> check the inconsistency between credentials_mode and allow_credentials.
> Now they are merged and we don't need the check.
>
> Bug: 799935
> Change-Id: Ic05b2d41456d91fd3f48416a3a3e8fc98e235756
> Tbr: bsimonnet@chromium.org, dimich@chromium.org, groby@chromium.org, markusheintz@chromium.org, olka@chromium.org, satorux@chromium.org, tbansal@chromium.org
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1695341
> Commit-Queue: Yutaka Hirano <yhirano@chromium.org>
> Reviewed-by: Tom Sepez <tsepez@chromium.org>
> Reviewed-by: Greg Levin <glevin@chromium.org>
> Reviewed-by: Nico Weber <thakis@chromium.org>
> Reviewed-by: Nicolas Ouellet-Payeur <nicolaso@chromium.org>
> Reviewed-by: Friedrich [CET] <fhorschig@chromium.org>
> Reviewed-by: Marc Treib <treib@chromium.org>
> Reviewed-by: Sylvain Defresne <sdefresne@chromium.org>
> Reviewed-by: Vasilii Sukhanov <vasilii@chromium.org>
> Reviewed-by: Alexei Svitkine <asvitkine@chromium.org>
> Reviewed-by: Matt Menke <mmenke@chromium.org>
> Reviewed-by: Kyle Milka <kmilka@chromium.org>
> Reviewed-by: Wei-Yin Chen (陳威尹) <wychen@chromium.org>
> Reviewed-by: Mark Pearson <mpearson@chromium.org>
> Reviewed-by: Rebekah Potter <rbpotter@chromium.org>
> Reviewed-by: Emily Stark <estark@chromium.org>
> Reviewed-by: John Rummell <jrummell@chromium.org>
> Reviewed-by: Ganggui Tang <gogerald@chromium.org>
> Reviewed-by: Michael Martis <martis@chromium.org>
> Reviewed-by: Mathias Carlen <mcarlen@chromium.org>
> Reviewed-by: Tsuyoshi Horo <horo@chromium.org>
> Reviewed-by: Patrick Noland <pnoland@chromium.org>
> Reviewed-by: Tommy Nyquist <nyquist@chromium.org>
> Reviewed-by: Matt Reynolds <mattreynolds@chromium.org>
> Reviewed-by: Scott Violet <sky@chromium.org>
> Reviewed-by: Roman Sorokin [CET] <rsorokin@chromium.org>
> Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
> Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
> Reviewed-by: David Benjamin <davidben@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#681698}

TBR=sky@chromium.org,horo@chromium.org,mpearson@chromium.org,davidben@chromium.org,thakis@chromium.org,toyoshim@chromium.org,nyquist@chromium.org,markusheintz@chromium.org,vasilii@chromium.org,jrummell@chromium.org,asvitkine@chromium.org,groby@chromium.org,bsimonnet@chromium.org,noel@chromium.org,rsorokin@chromium.org,glevin@chromium.org,yhirano@chromium.org,dimich@chromium.org,mmenke@chromium.org,nhiroki@chromium.org,sdefresne@chromium.org,tsepez@chromium.org,treib@chromium.org,estark@chromium.org,tbansal@chromium.org,gogerald@chromium.org,mattreynolds@chromium.org,wychen@chromium.org,olka@chromium.org,satorux@chromium.org,rbpotter@chromium.org,pnoland@chromium.org,fhorschig@chromium.org,martis@chromium.org,kmilka@chromium.org,jselover@chromium.org,nicolaso@chromium.org,mcarlen@chromium.org

Bug: 799935
Change-Id: Iec8067b3fed29bd6845077f5dc9c564d6640b6ff
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1722274
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Commit-Queue: Yutaka Hirano <yhirano@chromium.org>
Cr-Commit-Position: refs/heads/master@{#681719}
2019-07-29 06:41:34 +00:00
Noel Gordon
ae8f183fc9 Revert "Unify allow_credentials and credentials_mode on network::ResourceRequest"
This reverts commit 1ccc5eeed0.

Reason for revert: causing compile failures on the
linux-chromeos-google-rel builder.

https://ci.chromium.org/p/chrome/builders/ci/linux-chromeos-google-rel/5042



Original change's description:
> Unify allow_credentials and credentials_mode on network::ResourceRequest
> 
> Remove allow_credentials, map allow_credentials: false to
> credentials_mode: kOmit and map allow_credentials: true to
> credentials_mode: kInclude.
> 
> network::URLLoader cannot handle kSameOrigin. This CL doesn't change
> that. CORSURLLoader translates the value to either kOmit or kInclude.
> 
> This works correctly even when OOR-CORS is disabled because in that
> case load flags are set in the renderer. One caveat is we will not
> be able to remove the load flags until we remove the blink-side CORS
> code (M78? M79?) with this change.
> 
> This CL removes a validity check for credentials related settings in
> CorsURLLoaderFactory. Originally the check was introduced to check the
> inconsistency between credentials_mode and load flags. After that
> allow_credentials was introduced, and at
> https://crrev.com/c/chromium/src/+/1443976 the logic was changed to
> check the inconsistency between credentials_mode and allow_credentials.
> Now they are merged and we don't need the check.
> 
> Bug: 799935
> Change-Id: Ic05b2d41456d91fd3f48416a3a3e8fc98e235756
> Tbr: bsimonnet@chromium.org, dimich@chromium.org, groby@chromium.org, markusheintz@chromium.org, olka@chromium.org, satorux@chromium.org, tbansal@chromium.org
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1695341
> Commit-Queue: Yutaka Hirano <yhirano@chromium.org>
> Reviewed-by: Tom Sepez <tsepez@chromium.org>
> Reviewed-by: Greg Levin <glevin@chromium.org>
> Reviewed-by: Nico Weber <thakis@chromium.org>
> Reviewed-by: Nicolas Ouellet-Payeur <nicolaso@chromium.org>
> Reviewed-by: Friedrich [CET] <fhorschig@chromium.org>
> Reviewed-by: Marc Treib <treib@chromium.org>
> Reviewed-by: Sylvain Defresne <sdefresne@chromium.org>
> Reviewed-by: Vasilii Sukhanov <vasilii@chromium.org>
> Reviewed-by: Alexei Svitkine <asvitkine@chromium.org>
> Reviewed-by: Matt Menke <mmenke@chromium.org>
> Reviewed-by: Kyle Milka <kmilka@chromium.org>
> Reviewed-by: Wei-Yin Chen (陳威尹) <wychen@chromium.org>
> Reviewed-by: Mark Pearson <mpearson@chromium.org>
> Reviewed-by: Rebekah Potter <rbpotter@chromium.org>
> Reviewed-by: Emily Stark <estark@chromium.org>
> Reviewed-by: John Rummell <jrummell@chromium.org>
> Reviewed-by: Ganggui Tang <gogerald@chromium.org>
> Reviewed-by: Michael Martis <martis@chromium.org>
> Reviewed-by: Mathias Carlen <mcarlen@chromium.org>
> Reviewed-by: Tsuyoshi Horo <horo@chromium.org>
> Reviewed-by: Patrick Noland <pnoland@chromium.org>
> Reviewed-by: Tommy Nyquist <nyquist@chromium.org>
> Reviewed-by: Matt Reynolds <mattreynolds@chromium.org>
> Reviewed-by: Scott Violet <sky@chromium.org>
> Reviewed-by: Roman Sorokin [CET] <rsorokin@chromium.org>
> Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
> Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
> Reviewed-by: David Benjamin <davidben@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#681698}

TBR=sky@chromium.org,horo@chromium.org,mpearson@chromium.org,davidben@chromium.org,thakis@chromium.org,toyoshim@chromium.org,nyquist@chromium.org,markusheintz@chromium.org,vasilii@chromium.org,jrummell@chromium.org,asvitkine@chromium.org,groby@chromium.org,bsimonnet@chromium.org,rsorokin@chromium.org,glevin@chromium.org,yhirano@chromium.org,dimich@chromium.org,mmenke@chromium.org,nhiroki@chromium.org,sdefresne@chromium.org,tsepez@chromium.org,treib@chromium.org,estark@chromium.org,tbansal@chromium.org,gogerald@chromium.org,mattreynolds@chromium.org,wychen@chromium.org,olka@chromium.org,satorux@chromium.org,rbpotter@chromium.org,pnoland@chromium.org,fhorschig@chromium.org,martis@chromium.org,kmilka@chromium.org,jselover@chromium.org,nicolaso@chromium.org,mcarlen@chromium.org

Change-Id: I60b04dc48cd24370db18211d2870fae2f598c9d1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 799935
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1724029
Reviewed-by: Noel Gordon <noel@chromium.org>
Commit-Queue: Noel Gordon <noel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#681706}
2019-07-29 05:30:53 +00:00
Yutaka Hirano
1ccc5eeed0 Unify allow_credentials and credentials_mode on network::ResourceRequest
Remove allow_credentials, map allow_credentials: false to
credentials_mode: kOmit and map allow_credentials: true to
credentials_mode: kInclude.

network::URLLoader cannot handle kSameOrigin. This CL doesn't change
that. CORSURLLoader translates the value to either kOmit or kInclude.

This works correctly even when OOR-CORS is disabled because in that
case load flags are set in the renderer. One caveat is we will not
be able to remove the load flags until we remove the blink-side CORS
code (M78? M79?) with this change.

This CL removes a validity check for credentials related settings in
CorsURLLoaderFactory. Originally the check was introduced to check the
inconsistency between credentials_mode and load flags. After that
allow_credentials was introduced, and at
https://crrev.com/c/chromium/src/+/1443976 the logic was changed to
check the inconsistency between credentials_mode and allow_credentials.
Now they are merged and we don't need the check.

Bug: 799935
Change-Id: Ic05b2d41456d91fd3f48416a3a3e8fc98e235756
Tbr: bsimonnet@chromium.org, dimich@chromium.org, groby@chromium.org, markusheintz@chromium.org, olka@chromium.org, satorux@chromium.org, tbansal@chromium.org
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1695341
Commit-Queue: Yutaka Hirano <yhirano@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Greg Levin <glevin@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Nicolas Ouellet-Payeur <nicolaso@chromium.org>
Reviewed-by: Friedrich [CET] <fhorschig@chromium.org>
Reviewed-by: Marc Treib <treib@chromium.org>
Reviewed-by: Sylvain Defresne <sdefresne@chromium.org>
Reviewed-by: Vasilii Sukhanov <vasilii@chromium.org>
Reviewed-by: Alexei Svitkine <asvitkine@chromium.org>
Reviewed-by: Matt Menke <mmenke@chromium.org>
Reviewed-by: Kyle Milka <kmilka@chromium.org>
Reviewed-by: Wei-Yin Chen (陳威尹) <wychen@chromium.org>
Reviewed-by: Mark Pearson <mpearson@chromium.org>
Reviewed-by: Rebekah Potter <rbpotter@chromium.org>
Reviewed-by: Emily Stark <estark@chromium.org>
Reviewed-by: John Rummell <jrummell@chromium.org>
Reviewed-by: Ganggui Tang <gogerald@chromium.org>
Reviewed-by: Michael Martis <martis@chromium.org>
Reviewed-by: Mathias Carlen <mcarlen@chromium.org>
Reviewed-by: Tsuyoshi Horo <horo@chromium.org>
Reviewed-by: Patrick Noland <pnoland@chromium.org>
Reviewed-by: Tommy Nyquist <nyquist@chromium.org>
Reviewed-by: Matt Reynolds <mattreynolds@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Roman Sorokin [CET] <rsorokin@chromium.org>
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
Reviewed-by: David Benjamin <davidben@chromium.org>
Cr-Commit-Position: refs/heads/master@{#681698}
2019-07-29 03:54:15 +00:00
Justin DeWitt
7943cde031 [Zine] Sends display capability to server when requesting cards.
Bug: 984787
Change-Id: Id4210690f5a09e91af106df70c58965bbaee8898
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1709702
Commit-Queue: Justin DeWitt <dewittj@chromium.org>
Auto-Submit: Justin DeWitt <dewittj@chromium.org>
Reviewed-by: Patrick Noland <pnoland@chromium.org>
Reviewed-by: Dmitry Titov <dimich@chromium.org>
Cr-Commit-Position: refs/heads/master@{#680498}
2019-07-24 17:28:52 +00:00
Dan Harrington
94aa621aa8 Replace use of ClientPolicyController with global functions
This CL hides ClientPolicyController, and makes it a singleton. Access to
policy data is now provided through regular functions.

ClientPolicyController was already immutable, so making it a proper singleton
is just a mechanical change. This has a benefit that we no longer construct
multiple copies of ClientPolicyController, and no longer need to thread it
through so many interfaces.

A potential downside is that injecting fake policies for testing would have been
easier before this change. However, there's still several ways to do it, and
we haven't yet found a need for this.

Bug: 883559

Change-Id: I5b0919f9d91d91c53d9897b8469f9031d45c6996
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1678780
Commit-Queue: Dan H <harringtond@chromium.org>
Reviewed-by: Carlos Knippschild <carlosk@chromium.org>
Reviewed-by: Patrick Noland <pnoland@chromium.org>
Cr-Commit-Position: refs/heads/master@{#680061}
2019-07-23 18:08:46 +00:00
Miyoung Shin
23737f6ec0 Move all code in //components/signin that is in ::identity namespace to ::signin namespace
This CL replaces all ::identity namespace with ::signin namespace
in //components/signin and updates all related codes.

TBR=jochen@chromium.org

Bug: 984884
Change-Id: I14a74f2288b0eee1c039881596461558bd27e4e0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1712045
Commit-Queue: Miyoung Shin <myid.shin@igalia.com>
Reviewed-by: Colin Blundell <blundell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#679997}
2019-07-23 15:43:31 +00:00
Victor Hugo Vianna Silva
90bf97425b Remove minimum size field from FaviconServerFetcherParams
No caller of CreateForMobile sets this field above 16px, which is the
minimal value enforced by LargeIconService, so in fact all mobile UIs
that download from the favicon server use this default value. Behavior
is not changed for them.

For desktop UIs, this CL decouples the minimum_size from desired_size,
keeping the desired size of 16 DIP while decreasing the minimum size to
16px. We argue that this is beneficial for the UI because it improves
availability of icons. If any desktop UI in the future needs to enforce
the minimum size to display, it can do so when loading the icon from
local cache.

Bug: 982810
Change-Id: I1160316e93fd721cc977833aa9635d40971a2da6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1695366
Reviewed-by: Nicolas Zea <zea@chromium.org>
Reviewed-by: edchin <edchin@chromium.org>
Reviewed-by: Wei-Yin Chen (陳威尹) <wychen@chromium.org>
Reviewed-by: Kristi Park <kristipark@chromium.org>
Reviewed-by: Mikel Astiz <mastiz@chromium.org>
Reviewed-by: Jan Krcal <jkrcal@chromium.org>
Commit-Queue: Victor Vianna <victorvianna@google.com>
Cr-Commit-Position: refs/heads/master@{#678736}
2019-07-18 17:16:02 +00:00
Dan Harrington
75333a9f30 Allow zine suggestions without images
Zine will eventually start sending some suggestions without image URLs. This
change allows those articles to be retained and shown correctly on the NTP.

Bug: 984787
Change-Id: I96babe4488ac75def4067d88c2023e4ec121ca65
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1705021
Commit-Queue: Dan H <harringtond@chromium.org>
Reviewed-by: Justin DeWitt <dewittj@chromium.org>
Reviewed-by: Theresa <twellington@chromium.org>
Cr-Commit-Position: refs/heads/master@{#678415}
2019-07-17 19:53:30 +00:00
Dan Harrington
79f6fc370d add some offline pages members to ntp_snippets/OWNERS
As our team will be maintaining this in the future

Change-Id: I9382de5a7ef6fec6bdb517b12a9d952cf23f38bb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1706796
Reviewed-by: Nicolas Zea <zea@chromium.org>
Reviewed-by: Justin DeWitt <dewittj@chromium.org>
Commit-Queue: Nicolas Zea <zea@chromium.org>
Cr-Commit-Position: refs/heads/master@{#678371}
2019-07-17 18:16:17 +00:00
Gabriel Charette
21a47f0137 [ScopedTaskEnvironment] Migrate callers off MainThreadType::*MOCK_TIME
Using this regex:
(base::)?(test::)?ScopedTaskEnvironment::[\s\n]*MainThreadType::[\s\n]*(UI|IO)?_?MOCK_TIME

and mapping it to:
\1\2ScopedTaskEnvironment::MainThreadType::\3, \1\2ScopedTaskEnvironment::TimeSource::MOCK_TIME

and then deleting any
(base::)?(test::)?ScopedTaskEnvironment::MainThreadType::,

left behind + git cl format

Will TBR fdoray@ for mechanical change after LGTM
TBR=fdoray@chromium.org

Bug: 946657
Change-Id: I0ec0e9a307c629fcee6816b5443d37a7ab90c0d1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1702461
Reviewed-by: Gabriel Charette <gab@chromium.org>
Reviewed-by: François Doray <fdoray@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#677822}
2019-07-16 16:47:20 +00:00
Theresa
06efb67971 Remove dead contextual suggestions (EoC) code
Also marks the associated enterprise policy as deprecated.

BUG=938050

Change-Id: Ia10f8c23a887813e6dbd5daf21035f462004ddbe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1697315
Reviewed-by: Roman Sorokin [CET] <rsorokin@chromium.org>
Reviewed-by: Nicolas Zea <zea@chromium.org>
Reviewed-by: Ilya Sherman <isherman@chromium.org>
Reviewed-by: Brandon Wylie <wylieb@chromium.org>
Reviewed-by: Dan Beam <dbeam@chromium.org>
Commit-Queue: Theresa <twellington@chromium.org>
Cr-Commit-Position: refs/heads/master@{#677437}
2019-07-15 19:40:06 +00:00
Jeremy Roman
5c341f6dd1 Use in-class initializers for base::WeakPtrFactory in components/.
Generated by: https://chromium-review.googlesource.com/c/chromium/src/+/1689216

Bug: 981415
Change-Id: I706ec55f1f533ef616f400791d69a51e9a151da1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1699508
Commit-Queue: Jeremy Roman <jbroman@chromium.org>
Reviewed-by: Colin Blundell <blundell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#677340}
2019-07-15 15:56:10 +00:00
Eric Orth
c398f1e88a Convert NetworkChangeNotifier to new DNS config notifications
As per-platform differences are now separated out at a deeper level
(per-platform DnsConfigService inside SystemDnsConfigChangeNotifier),
unified the DNS config stuff to be located directly in
NetworkChangeNotifier rather than in per-platform subclasses. Required
some minor fixes to mock NCN usage, especially custom mocks that were
overriding NCN and now getting full DNS config changes (and added env
threading requirements that those tests were not setup to handle).

For now, HostResolverManager is still listening through
NetworkChangeNotifier.  It will be updated to directly use
SystemDnsConfigChangeNotifier in the next CL.

Bug: 971411
Change-Id: Ib0353041dbf60f311e993eb98f8d4b719ce0d2e4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1666288
Commit-Queue: Eric Orth <ericorth@chromium.org>
Reviewed-by: Alexei Svitkine <asvitkine@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Sky Malice <skym@chromium.org>
Reviewed-by: Charlie Harrison <csharrison@chromium.org>
Reviewed-by: Mihai Sardarescu <msarda@chromium.org>
Reviewed-by: anthonyvd <anthonyvd@chromium.org>
Reviewed-by: Nicolas Zea <zea@chromium.org>
Reviewed-by: Asanka Herath <asanka@chromium.org>
Cr-Commit-Position: refs/heads/master@{#675813}
2019-07-09 21:54:55 +00:00
Henrique Ferreiro
94eb46f95b Move IdentityManager to //components/signin
IdentityManager currently lives under //services/identity/public/cpp. Given
the evolution of the Identity Service which is backed by IdentityManager, with
IdentityManager being used directly by the browser, this code location no
longer makes sense.

This CL performs the following relocations:
* Public header files (e.g. identity_manager.h, access_token_fetcher.h), their
  implementations, and their unittests will move to
  //components/signin/public/identity_manager.
* Non-public headers, their implementations, and their unittests will move to:
  //components/signin/internal/identity_manager.

Design doc:
https://docs.google.com/document/d/1MiZmqvDFVcCOseAuViJqd8wLDILbykarX7PfwleNpAs

TBR=jochen@chromium.org,rockot@google.com,antrim@chromium.org

Bug: 952788
Change-Id: Ied8992f966f7373443fbb76b177ad4d71832145d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1669293
Reviewed-by: Henrique Ferreiro <hferreiro@igalia.com>
Reviewed-by: Colin Blundell <blundell@chromium.org>
Commit-Queue: Henrique Ferreiro <hferreiro@igalia.com>
Cr-Commit-Position: refs/heads/master@{#674455}
2019-07-03 14:38:56 +00:00
Gabriel Charette
6e9ca4b008 [ScopedTaskEnvironment] Non-zero initial NowTicks() under MOCK_TIME
This is a prerequisite for MOCK_TIME on ThreadPool because
base::internal::WorkerThread doesn't support TimeTicks::Now() being
zero.

And it's also a definite source of pain given the number of codesites
found which had to work around this.

Bug: 946657
Change-Id: I115b4af77e5095454b2d505915884215e82d7f9b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1677107
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Reviewed-by: James Cook <jamescook@chromium.org>
Reviewed-by: Sergey Volk <servolk@chromium.org>
Reviewed-by: David Staessens <dstaessens@chromium.org>
Reviewed-by: Alex Clarke <alexclarke@chromium.org>
Reviewed-by: Richard Knoll <knollr@chromium.org>
Reviewed-by: Justin DeWitt <dewittj@chromium.org>
Reviewed-by: Nicolas Zea <zea@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#673413}
2019-06-28 18:14:10 +00:00
Alexei Svitkine
1d820eff02 Migrate some uses of VariationParamsManager to ScopedFeatureList.
ScopedFeatureList is the preferred helper for setting up testing
feature params.

In addition to pure test changes, hats_finch_helper.cc is updated
to use the feature param APIs as opposed to variation params, so
that the params are associated with a feature and not a specific
field trial name. This is the best practice and also allows the
test to use ScopedFeatureList since the trial name it sets up is
not the feature name.

Bug: 974436
Change-Id: I39e763db246c88de7e4487439bc257f64c160064
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1655086
Commit-Queue: Alexei Svitkine <asvitkine@chromium.org>
Reviewed-by: Justin DeWitt <dewittj@chromium.org>
Reviewed-by: Chris Hamilton <chrisha@chromium.org>
Reviewed-by: Parastoo Geranmayeh <parastoog@google.com>
Reviewed-by: Sorin Jianu <sorin@chromium.org>
Reviewed-by: Collin Baker <collinbaker@chromium.org>
Reviewed-by: Jared Saul <jsaul@google.com>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Peter Kotwicz <pkotwicz@chromium.org>
Reviewed-by: Malay Keshav <malaykeshav@chromium.org>
Reviewed-by: Patrick Noland <pnoland@chromium.org>
Cr-Commit-Position: refs/heads/master@{#671024}
2019-06-20 20:12:32 +00:00
Jan Wilken Dörrie
45d34f4e64 [base] Replace Contains{Key,Value} with Contains in //components
This change replaces usages of base::ContainsKey() and
base::ContainsValue() with base::Contains() in //components.

Reproduction:
 - sed -i 's/\bbase::ContainsKey\b/base::Contains/g'
 - sed -i 's/\bbase::ContainsValue\b/base::Contains/g'
 - git cl format

This CL was uploaded by git cl split.

TBR=dvadym,danakj,droger,thestig,nparker,gogerald,vasilii,blundell

Bug: 970209
Change-Id: I123f52d739968fd2dc32859116f6d228dbda2568
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1648226
Reviewed-by: Jan Wilken Dörrie <jdoerrie@chromium.org>
Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org>
Auto-Submit: Jan Wilken Dörrie <jdoerrie@chromium.org>
Cr-Commit-Position: refs/heads/master@{#667447}
2019-06-08 09:40:54 +00:00
Caleb Raitto
c0a311ba76 Disable leaking components_unittests on LSAN.
See crrev.com/c/1590404 and the linked bug for context -- the goal is to
fix the broken memory-leak checking in Chromium's ASAN
(AddressSanitizer) trybots, which are supposed to also run LSAN
(LeakSanitizer).

Currently-leaking tests must be fixed or disabled before leak checking
can be enabled in the ASAN trybot.

WARNING: This will result in a loss of ASAN coverage for the affected
tests given that LSAN runs as part of the ASAN trybot.

If that's not acceptable, we can wait until the leaks are fixed before
fixing leak detection in trybots, but keep in mind that newly-introduced
leaks Chromium-wide won't be caught until then.

Bug: 961023
Change-Id: I1899fbea3d1ce8288c954c97d4d486bd3cda3371
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1638818
Commit-Queue: Caleb Raitto <caraitto@chromium.org>
Reviewed-by: Jared Saul <jsaul@google.com>
Reviewed-by: Ryan Sturm <ryansturm@chromium.org>
Reviewed-by: Patrick Noland <pnoland@chromium.org>
Reviewed-by: Robert Ogden <robertogden@chromium.org>
Cr-Commit-Position: refs/heads/master@{#666059}
2019-06-05 00:01:41 +00:00
Sylvain Defresne
ada1d8468a Convert SafeJsonParser to base::OnceCallback
The callback passed to SafeJsonParser will only be invoked once, so
change the definition of the callbacks to be base::OnceCallback<>
to make this explicit.

Convert client code to use base::BindOnce() when interacting with
SafeJsonParser instead of base::Bind() or base::BindRepeating().

TBR=sky@chromium.org

Bug: 842655, 964232, 714018
Change-Id: Id948c848f5c193959cc0da2c8eadb21cc55a841c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1624810
Reviewed-by: Sylvain Defresne <sdefresne@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Auto-Submit: Sylvain Defresne <sdefresne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#664288}
2019-05-29 15:54:46 +00:00
Victor Hugo Vianna Silva
f969d2a4a1 [Refactoring] Support trimming path in LargeIconService server query
We add a new parameter to LargeIconService's method
GetLargeIconOrFallbackStyleFromGoogleServerSkippingLocalCache to allow
querying the server by an url with trimmed path. No behavior is changed
in the existent callers.

Bug: 955475
Change-Id: I0741aed7d3a54f863f9afe9c35ce8dfc6d2bb5b4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1621923
Reviewed-by: Mikel Astiz <mastiz@chromium.org>
Reviewed-by: David Roger <droger@chromium.org>
Reviewed-by: Nicolas Zea <zea@chromium.org>
Commit-Queue: Victor Vianna <victorvianna@google.com>
Cr-Commit-Position: refs/heads/master@{#663528}
2019-05-27 13:18:32 +00:00
Sylvain Defresne
354d2db7de Remove unnecessary base::Passed() with base::BindOnce()
The documentation on base::Callback<...> (src/docs/callback.md)
recommends against using base::Passed(...) with base::BindOnce.

> Avoid using `base::Passed()` with `base::BindOnce()`, as `std::move()`
> does the same thing and is more familiar.

This CL was uploaded by git cl split.

Bug: 812523
Change-Id: I29cf2bede8555b73962acd62b6a0b56ebaba8bc6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1611834
Commit-Queue: Nicolas Zea <zea@chromium.org>
Reviewed-by: Patrick Noland <pnoland@chromium.org>
Reviewed-by: Nicolas Zea <zea@chromium.org>
Auto-Submit: Sylvain Defresne <sdefresne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#662676}
2019-05-23 16:36:04 +00:00
Sylvain Defresne
184fbe9ef2 Remove base::Unretained(this) in CachedImageFetcher
As noticed in https://crrev.com/c/1611834, it is probably unsafe to
use base::Unretained(this) when binding those methods, so instead
use a WeakPtr<CachedImageFetcher> to ensure no callback keep a stale
pointer.

Bug: none
Change-Id: I76bb04efcb8ed7461756fc4a62675e57c996bd42
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1624567
Auto-Submit: Sylvain Defresne <sdefresne@chromium.org>
Commit-Queue: Nicolas Zea <zea@chromium.org>
Reviewed-by: Brandon Wylie <wylieb@chromium.org>
Reviewed-by: Nicolas Zea <zea@chromium.org>
Cr-Commit-Position: refs/heads/master@{#662246}
2019-05-22 17:37:54 +00:00
Jesse Selover
591e041241 Remove LOAD_DO_NOT_* credentials flags and replace them with
allow_credentials, removing HTTP authentication data.

This CL is part of a larger project to remove the LOAD_DO_NOT_* privacy load
flags and replace them with the allow_credentials setting. See
https://crbug.com/799935,
https://docs.google.com/document/d/1ntn9N7Ce2jozvvpWI0XbzJ7lJdwUjJXK07wp7rxrIN4,
and
go/allow-credentials-tracker
for the motivation and progress of this change.

This CL handles a third of cases where LOAD_DO_NOT_SEND_COOKIES and
LOAD_DO_NOT_SAVE_COOKIES were set, but LOAD_DO_NOT_SEND_AUTH_DATA was not.
This CL will set allow_credentials = false instead, which will make two
changes to the requests:
- The request will no longer participate in HTTP auth if the server requests
  it. HTTP auth credentials identify the user, so private requests should
  not send them. Note this only affects server auth, not proxy auth. Unless
  the server your feature speaks to requests HTTP auth, this is a no-op.
- The request will be pooled with sockets used for uncredentialed requests,
  rather than credentialed requests. This is not expected to meaningfully
  change behavior.

If your code requires HTTP authentication, let me know. You may need to
allow credentials for your request.

Bug: 799935
Change-Id: Iaa33d56644b53f77701a8254fe7eb2b952eb0f18
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1580589
Reviewed-by: David Benjamin <davidben@chromium.org>
Reviewed-by: Patrick Noland <pnoland@chromium.org>
Reviewed-by: Cait Phillips <caitkp@chromium.org>
Reviewed-by: Ahmed Fakhry <afakhry@chromium.org>
Reviewed-by: rajendrant <rajendrant@chromium.org>
Reviewed-by: Jian Li <jianli@chromium.org>
Commit-Queue: Jesse Selover <jselover@chromium.org>
Cr-Commit-Position: refs/heads/master@{#660170}
2019-05-15 22:19:58 +00:00
Brandon Wylie
80a8988efe Remove Explore-on-Content code and obsolete relevant metrics
This removes Explore-on-Content production code, debugging code and
obsoletes histograms/actions/enums associated with it.

Bug: 938050
Change-Id: I3bb1a55c6acde07b21881319ac7d3bca1ee39b9a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1500773
Commit-Queue: Brandon Wylie <wylieb@chromium.org>
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Reviewed-by: Ken Rockot <rockot@google.com>
Reviewed-by: Christian Dullweber <dullweber@chromium.org>
Reviewed-by: Will Harris <wfh@chromium.org>
Reviewed-by: Robert Kaplow <rkaplow@chromium.org>
Reviewed-by: Filip Gorski <fgorski@chromium.org>
Reviewed-by: Theresa <twellington@chromium.org>
Cr-Commit-Position: refs/heads/master@{#658190}
2019-05-09 18:14:26 +00:00
Sylvain Defresne
16967248f9 Convert ntp_snippets::SuccessCallback to pass base::Value by value
The base::Value API redesign goal is to avoid passing base::Value
via std::unique_ptr<base::Value> but instead to pass it by value.
Change ntp_snippets::SuccessCallback to follow this pattern.

Convert use of deprecated base::JSONReader::ReadToValueDeprecated
method.

Bug: 646113
Change-Id: I428be08fce1ccd3e25fd1b3af133ce7492984552
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1594589
Reviewed-by: Nicolas Zea <zea@chromium.org>
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#658180}
2019-05-09 17:59:25 +00:00