This CL extracts the inner class `URLLoader::FileOpenerForUpload` into a
standalone class `network::FileOpenerForUpload` located in its own
header and source files (`services/network/file_opener_for_upload.h`
and `.cc`).
The motivation for this change is to improve modularity and decouple
the logic for asynchronously opening files for upload from the main
`URLLoader` class. This makes both classes simpler and easier to
maintain.
Key changes include:
- Moved the `FileOpenerForUpload` class definition and implementation
to new files.
- Updated `URLLoader` to include and use the new standalone class.
- The request URL is now explicitly passed to the
`FileOpenerForUpload` constructor.
- The `LogUnblocked` call in `SetUpUpload` is now correctly tied
to the callback originating from `FileOpenerForUpload`.
- Removed the inner class definition and friend declaration from
`url_loader.h`.
- Added the new files to the `network_service` component build target.
- Updated `url_loader_unittest.cc` to include the new header and
use the correct scope for `kMaxFileUploadRequestsPerBatch`.
This CL also changes the TaskPriority which is used for closing the
files from USER_BLOCKING to USER_VISIBLE.
Other than that, no functional changes are intended.
Bug: 408106280
Change-Id: Ia07b367787adcc65df4afd13ccb8e0ff49a274e7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6428886
Commit-Queue: Tsuyoshi Horo <horo@chromium.org>
Reviewed-by: Adam Rice <ricea@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1443881}
Check for <meta> elements while checking each element instead of using
QuerySelectorAll which can be expensive and may invalidate style and
layout.
Also add more cases to unit tests to increase paid_content code coverage.
Change-Id: I76ae9ed65aa7e9647c650ee99bb8d51444e03e04
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6431533
Reviewed-by: Abigail Klein <abigailbklein@google.com>
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
Commit-Queue: Gary Klassen <gklassen@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1443880}
This change leverages the recently introduced `RegistrationObserver`
inside `ServiceWorkerTaskQueue`, to defer execution of
`ResetURLLoaderFactories()` until all in-flight service worker
registrations are completed (have been stored, or failed).
This fixes a bug that would cause registrations to fail with either
`kErrorStartWorkerFailed` or `kErrorNetwork`.
Design doc: http://go/defer-reset-url-loader-factories
Bug: 394523691
Change-Id: I03ff1206606e21f26389d7d7d09be8f95e937dab
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6370790
Reviewed-by: Justin Lulejian <jlulejian@chromium.org>
Commit-Queue: Andrea Orru <andreaorru@chromium.org>
Reviewed-by: Erik Chen <erikchen@chromium.org>
Reviewed-by: Devlin Cronin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1443866}
This change introduces `ServiceWorkerTaskQueue::RegistrationObserver` to
track service worker registration jobs that have been started, and when
all registration jobs are complete (i.e., either stored or failed).
The new observer allows Extensions API implementations to wait for the
completion of in-flight registrations before executing operations that
could be disruptive if run concurrently (e.g., how the Web Request /
Declarative Net Request APIs call `ResetURLLoaderFactories()` when a new
extension is installed so that they can begin intercepting requests).
Design doc: http://go/defer-reset-url-loader-factories
Bug: 394523691
Change-Id: I47781f68b39b59540b61127af5e6cc4edab014f5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6370807
Reviewed-by: Justin Lulejian <jlulejian@chromium.org>
Commit-Queue: Andrea Orru <andreaorru@chromium.org>
Reviewed-by: Devlin Cronin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1443865}
* Clears the timeout when the toast gets focus so that the toast will
not disappear while it has focus.
* Resets the timeout when focus is removed from the toast so that it
can auto-hide again.
Bug: 405773128
Change-Id: I0ccaf905aa777dba79395399598e9521f9445a10
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6435374
Commit-Queue: Riley Tatum <rtatum@google.com>
Reviewed-by: John Lee <johntlee@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1443863}
This method allows extensions to get a notice that the URLLoaderFactory
that will be used to fetch the extension's worker script is about to be
constructed.
This is useful to prevent WebRequestAPI extensions from calling
ResetURLLoaderFactories while worker script fetching is in progress,
which can cause service worker registrations to fail.
In addition, this method is necessary to deterministically trigger
the race condition in browsertests.
Design doc: http://go/defer-reset-url-loader-factories
Bug: 394523691
Change-Id: Iadfbcd1b76dbb7906a911f538f51b3e73b4de691
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6395758
Reviewed-by: Yoshisato Yanagisawa <yyanagisawa@chromium.org>
Commit-Queue: Andrea Orru <andreaorru@chromium.org>
Reviewed-by: Shunya Shishido <sisidovski@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1443858}
The Telemetry requires --connect-to-device-over-network for connecting
the remote adb host instead of the adb USB. Add
--connect-to-device-over-network with --device for running
run_benchmark. Remove --android which is not a valid parameter for
telemetry.
BUG=386710478, 403001171
TEST=Run generate_profile.py with
--android-hostname=<my disconnected networked adb device>
--run-public-benchmarks-only
Change-Id: Iae289cec2179eaf001d21db2fa378f2d5f518ea4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6420796
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Darren Wu <darrenwu@chromium.org>
Auto-Submit: Darren Wu <darrenwu@chromium.org>
Reviewed-by: Ben Pastene <bpastene@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1443854}
This is a reland of https://crrev.com/c/6415568, focusing only UMA for
CreateStream() to make a reland CL smaller and isolated.
The original CL causes a crash (https://crbug.com/408060617). The
underlying cause was that `create_stream_end_time_` was not cleared,
even though CreatStream() could be called multiple times. That may cause
a crash in populating LoadTimingInternalInfo later, hitting at:
CHECK_LE(create_stream_start_time_, create_stream_end_time_);
See also: https://crrev.com/c/6424639.
This CL makes sure to reset `end_time` when setting `start_time` to
prevent an inconsistent state.
Note this is a kind of speculative fix because I couldn't reproduce a
crash locally.
Bug: 393980912,408060617
Change-Id: I8eaf20c866f8239240c40e936bc4594e2979def1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6433371
Reviewed-by: Kenichi Ishibashi <bashi@chromium.org>
Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
Commit-Queue: Hayato Ito <hayato@chromium.org>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1443851}
The test is currently too big (too many Mocha test cases) causing it to
exceed the timeout threshold on certain bots.
- Split the "General" suite() to two parts. Use nested suite() calls to
make it easier to reuse common setup code for both suites.
- Move other suite() calls to dedicated test files.
- Put all common code between all 3 original suites in a new
power_bookmarks_list_test_util.ts file so that it can be reused.
Bug: 407730007
Change-Id: I33e06369d36ae43a64dab50a953f66cb7cd2b63f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6439615
Reviewed-by: John Lee <johntlee@chromium.org>
Commit-Queue: Demetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1443849}
Before this patch, an Android payment app developer could have a hard
time debugging why their IS_READY_TO_PAY service is not working because
of lack of debugging logs.
This patch adds information-level debug logs when IS_READY_TO_PAY
service is working correctly and error-level logs when there is an error
in an IS_READY_TO_PAY service.
In addition, this patch resolves the pre-submit error about not needing
a @VisibleForTesting annotation on methods that end with "ForTesting".
After this patch, Android payment app developers should have an easier
time developing and debugging IS_READY_TO_PAY services in their apps.
Bug: 409080031
Change-Id: I147670f535dec1c5bf9be23cf287a53f37dd419e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6440047
Reviewed-by: Kavita Soni <kavitasoni@chromium.org>
Commit-Queue: Rouslan Solomakhin <rouslan@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1443847}
CSSPrimitiveValue cannot resolve to a number in the presence of
sibling-index() and non-simplified sign() without a CSSLengthResolver.
Fixes a crash with sibling-index() in interest-target-show-delay.
Bug: 408234456, 408241044
Change-Id: Ia44e6270182666d65d279bf81f90fce1ae61548e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6433211
Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1443846}
ComponentLoader is now a profile keyed service and should be accessed
via ComponentLoader::Get(). This is part of the effort to reduce
dependencies on ExtensionService, which helps with extensions on
desktop Android because we can't port ExtensionService yet.
No functional changes.
Bug: 408495366
Change-Id: I50b4b737091439a8b7cf3145b95ede885c5d7c47
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6439621
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Yaron Friedman <yfriedman@chromium.org>
Commit-Queue: James Cook <jamescook@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1443845}
ComponentLoader is now a profile keyed service and should be accessed
via ComponentLoader::Get(). This is part of the effort to reduce
dependencies on ExtensionService, which helps with extensions on
desktop Android because we can't port ExtensionService yet.
Bug: 408495366
Change-Id: Id0cbdceb20e67c111d6ed7ac9ea643df222cae2a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6438896
Reviewed-by: Yaron Friedman <yfriedman@chromium.org>
Commit-Queue: James Cook <jamescook@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1443844}
This CL adds e2e browser test(learning LCP and apply it for a page)
for timing predictor in loading_predictor_browsertest.cc.
This CL modifies lcp_critical_path_predictor.mojom to prove some info
for testing and refactors it too.
This is a preparation for support All element type mode independently
for timing predictor.
Bug: 40285771
Change-Id: I0e2e4e882894aaa2cc32f9460c76435215bb23ef
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6396017
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Reviewed-by: Lingqi Chi <lingqi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1443839}
Recently VideoTransformation was fixed to label the rotation and
mirroring metadata of a video file, but lead to an underlying bug where
the renderer did not correctly handle mirrored videos in the case of 90
rotation and 270 rotation. This change allows the renderer to correctly
handle these cases.
Bug: 408830833
Change-Id: Ic1164d4dbc7ab01ff8c353f2b5bce63723e3a539
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6440068
Reviewed-by: Ted (Chromium) Meyer <tmathmeyer@chromium.org>
Commit-Queue: Syed AbuTalib <lowkey@google.com>
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1443838}
In these tab discard test, a seemingly arbitrary second tab is
spawned, such that the original tab can be discarded. The URL of the
second tab was changed from NTP to Version (which loads faster), but
this appears to have exposeed a race condition.
Restore all but one test to using NTP, as they did before. The one
test that remains using the Version page actually tests that it can
discard that page, so it can be treated separately. This lets us
enable the disabled flaky test, buying time to fix this properly.
Bug: 408399396
Change-Id: I4a2c8996a3fc7aa0b32897aa7fb92bdacbb9e95e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6438500
Reviewed-by: David Pennington <dpenning@chromium.org>
Commit-Queue: Christopher Grant <cjgrant@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1443837}
Currently, we check whether the server returned a permanent error to
know whether we should show a temporary or permanent error dialog to the
user. We instead need to check if the server returned a VCN permanent
error. This CL updates this logic.
Bug: 356443046
Change-Id: I86a7168500404de7bd145bc704c36cf5e9fd3dee
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6439691
Reviewed-by: Slobodan Pejic <slobodan@chromium.org>
Commit-Queue: Vinny Persky <vinnypersky@google.com>
Cr-Commit-Position: refs/heads/main@{#1443836}
Currently, the client parser expects differential objects to describe
the previous binary used as input via the "from"."sha256" field. But
the protocol and thus the server provides "previous"."sha256" instead.
Bug: 409090165
Change-Id: I53c59f88dfbd38bcb86818a378ff338d4606d2ff
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6438368
Reviewed-by: Joshua Pawlicki <waffles@chromium.org>
Commit-Queue: James Decker <deckerjames@google.com>
Reviewed-by: Noah Rose Ledesma <noahrose@google.com>
Cr-Commit-Position: refs/heads/main@{#1443834}
The contents of the EU trusted lists (used as the trust store for QWAC
issuers) was added to the chromium codebase in previous CLs, but this
change (in combination with crrev.com/c/6383917) is the first to make
use of the contents (they were previously being dropped by the linker).
Including these trust anchors in the binary increases the binary size,
but they are needed for eIDAS 2.0 compliance.
Bug: 392931067
Change-Id: I9ef97d72de7d46900c3bec2778eb298cf50fbab3
Binary-Size: Size increase is unavoidable (see above).
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6383918
Commit-Queue: Matt Mueller <mattm@chromium.org>
Auto-Submit: Nick Harper <nharper@chromium.org>
Reviewed-by: Joshua Pawlicki <waffles@chromium.org>
Commit-Queue: Nick Harper <nharper@chromium.org>
Reviewed-by: Matt Mueller <mattm@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1443833}