This CL had caused a build breakage on the linux-chromeos-chrome CI,
which is not public. These changes fix the case in question.
This is a reland of commit 479ba74184
Original change's description:
> Implementing DataDecoder ValueOrError with base::expected
>
> This CL removes DataDecoder's ValueOrError type for the use of
> base::expected. This will make the use of these interfaces not only
> simpler, but it will also remove the redundant, and bug prone presence
> of the optional value for the success path, which is mostly always
> assumed to be populated, whenever there's no error present.
>
> Change-Id: If6e80d510193f2be508d4e938752422877b3f388
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3757983
> Owners-Override: Robert Sesek <rsesek@chromium.org>
> Commit-Queue: Claudio DeSouza <cdesouza@igalia.com>
> Reviewed-by: Robert Sesek <rsesek@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1023818}
Change-Id: I83f44a40f2ce6b818ac0933a8660f09bd85775f1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3760789
Commit-Queue: Claudio DeSouza <cdesouza@igalia.com>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Owners-Override: Robert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1024404}
This CL removes DataDecoder's ValueOrError type for the use of
base::expected. This will make the use of these interfaces not only
simpler, but it will also remove the redundant, and bug prone presence
of the optional value for the success path, which is mostly always
assumed to be populated, whenever there's no error present.
Change-Id: If6e80d510193f2be508d4e938752422877b3f388
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3757983
Owners-Override: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Claudio DeSouza <cdesouza@igalia.com>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1023818}
The DataDecoder instance-based API says that callbacks "will only be
called if the parsing operation succeeds or fails before this
DataDecoder is destroyed." However, this is not what the implementation
currently does: nothing binds the lifetime of the DataDecoder instance
to the callback. That makes it potentially unsafe to store an instance
of a DataDecoder as a member variable and then bind Unretained
`this` pointers to the DataDecoder callbacks.
This change adds a cancellation flag to DataDecoder requests so that the
API guarantees are fulfilled.
Bug: 1327312
Change-Id: Ic973cb62c802c8f6fceb2d3fe4c826579cd6b0c5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3660173
Commit-Queue: Nasko Oskov <nasko@chromium.org>
Auto-Submit: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Ken Rockot <rockot@google.com>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1007974}
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}
This replaces DISALLOW_COPY_AND_ASSIGN with explicit constructor deletes
where a local script is able to detect its insertion place (~Foo() is
public => insert before this line).
This is incomplete as not all classes have a public ~Foo() declared, so
not all DISALLOW_COPY_AND_ASSIGN occurrences are replaced.
IWYU cleanup is left as a separate pass that is easier when these macros
go away.
Bug: 1010217
Change-Id: Iea478401b7580682c7b9f195f7af9cbbdb6ce315
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3167292
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Peter Boström <pbos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#923194}
This CL adds the following histograms/metrics:
- Security.DataDecoder.Image.DecodingTime
(time spent decoding an image, typically inside a utility process)
- Security.DataDecoder.Image.Isolated.EndToEndTime
(end-to-end time spent spawning a utility process, sending IPCs,
and decoding an image - as measured from within a browser process)
- Security.DataDecoder.Image.Isolated.ProcessOverhead
(the difference between Isolated.EndToEndTime and DecodingTime - this
covers the end-to-end time spent spawning a utility process and the
IPC overhead)
- Security.DataDecoder.Image.Reusable.EndToEndTime,
Security.DataDecoder.Image.Reusable.ProcessOverhead
(just as the 2 metrics above, but potentially reusing an already
existing utility process)
Bug: 1069271
Change-Id: Ide06c7819e7d5b17b23ec82d55b29591e2523850
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3116444
Reviewed-by: Chris Thompson <cthomp@chromium.org>
Reviewed-by: Jon Mann <jonmann@chromium.org>
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Reviewed-by: Justin DeWitt <dewittj@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Cr-Commit-Position: refs/heads/main@{#919930}
This is a step towards doing full IWYU of browser_test.h, which will
have other benefits.
Completely mechanical and already R+ed as part of r765923.
Tbr: sky
Bug: none
Change-Id: Icb7ab728098a6cf29c0920da4b524e96a7c024c2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2186411
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#766361}
Include this directly in relevant test files. This lets us convert the
HAS_OUT_OF_PROC_TEST_RUNNER checks in this file and
view_event_test_base.h into #errors, and force people to not even
include this file in files that can't use it.
Bug: none
Tbr: sky
Change-Id: I86626099eb047eb53e8b3611de38ba6bebc01a0b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2136117
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#765923}
This provides a new DataDecoder API in the data_decoder client library,
allowing for clients to use the service for isolated and batched
operations without any dependency on the Service Manager or the
cumbersome usage of batch IDs.
Only JSON parsing facilities are added to DataDecoder in this CL.
The JsonSanitizer API is cleaned up a bit too, as is some test code.
Bug: 977637
Change-Id: I5798982a500a403ddb345ab40db35d466dc6b7fc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1879792
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Sorin Jianu <sorin@chromium.org>
Reviewed-by: Colin Blundell <blundell@chromium.org>
Commit-Queue: Robert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#710438}