- Ensure that the view type is correct for guest views, this previously
was computed from the WebContents but we should use the RenderFrameHost
for this.
- Provide an API to get the owner RenderFrameHost before attachment.
Bug: 40202416
Change-Id: I351313f06cd7a221e9c9bae0e3c155e827b3be51
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6053978
Reviewed-by: Greg Thompson <grt@chromium.org>
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: David Bertoni <dbertoni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1390990}
This is a mechanical CL in the cross-device digital credentials flow.
Before this CL:
The request type in the request sent via the tunnel was hard-coded to
be `credential.get`.
After this CL:
A new struct CrossDeviceRequestInfo is introduced to capture all the
information of the cross-device digital credentials request including
the the request type.
This allows the calling sites to send different types of requests.
This is in preparation for supporting credential.create requests.
Bug: 378330032
Change-Id: I1f3e618cfc336be931561f31f51e71039cc3351f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6055571
Reviewed-by: Alexander Timin <altimin@chromium.org>
Commit-Queue: Mohamed Amir Yosef <mamir@chromium.org>
Reviewed-by: Adam Langley <agl@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1390982}
This CL adds a flag to `chrome://flags` for testing in order to simplify
the process of setting both the network- and blink-side flags.
Bug: 375224898
Change-Id: If5158529a0e78d91ae591073a3cd5b24bda78c28
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6062784
Reviewed-by: Yoav Weiss (@Shopify) <yoavweiss@chromium.org>
Commit-Queue: Mike West <mkwst@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1390867}
implementation on Viz.
This CL implements PeakGpuMemoryTracker interface in Viz allowing it to
track peak memory of GPU service for scrolling scenarios with
InputVizard.
Following are some of the high level implementation details:
* Starting/stopping tracking peak memory on Viz includes posting a task
to main thread (GpuMain), from VizCompositor thread where the tracking
is implemented.
* PeakGpuMemoryTrackerImpl's |sequence_num_| captures even numbers in
browser whereas odd numbers in Viz to avoid collisions while tracking.
* Adds tests for the PeakGpuMemoryTracker implementation in Viz.
Bug: b:365541296
Change-Id: I5ac23a39511a45f149e3117a0d9af9c0bc4c4a1a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5972645
Reviewed-by: Alexander Timin <altimin@chromium.org>
Commit-Queue: Aman Verma <amanvr@google.com>
Reviewed-by: Stephen Nusko <nuskos@chromium.org>
Reviewed-by: Jonathan Ross <jonross@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1390842}
Implement the constructor for `SharedStorageSetMethod`, etc. The
error handling logic mirrors the existing sharedStorage.set(), etc.
To allow code reuse, the sharedStorage.set(), etc. methods
now creates the object and early return on exceptions.
Note that even though we no longer explicitly call resolver->Reject()
for sharedStorage.set(), etc., Chrome still converts thrown
exceptions to rejected promises (to adhere to the specification [1]),
so the end result is the same.
This prepares for the implementation of the
`sharedStorage.batchUpdate(methods)` method, as part of the Web Lock
integration proposal:
- https://github.com/WICG/shared-storage/pull/199
- https://github.com/WICG/shared-storage/pull/205
[1] https://w3ctag.github.io/promises-guide/#always-return-promises
Bug: 373899210
Change-Id: Ie4edfedbe755afeb3db5ca557fd74482bac96138
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6054694
Commit-Queue: Yao Xiao <yaoxia@chromium.org>
Reviewed-by: Cammie Smith Barnes <cammie@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1390779}
This CL makes RWHVA handle scale override. Scale override is used
during tab casting, and it modifies ScreenInfo. RWHVB takes this
into account by using GetDeviceScaleFactor, but the current code
for Android uses GetDipScale() and GetPhysicalBackingSize which does
not include the override scale.
When override scale is set the expected behaviour is to scale the
buffer down (or up) to fit the size it would normally be shown at.
Bug: 352186941
Test: CQ, manual testing
Change-Id: I607e6958ddc06d7e746ee437d39c8ee9770ebbdb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6056709
Reviewed-by: Jinsuk Kim <jinsukkim@chromium.org>
Reviewed-by: Jonathan Ross <jonross@chromium.org>
Commit-Queue: Eliot Courtney <edcourtney@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1390739}
Before this CL, CDP events for prefetch are emitted from
Prefetcher, which implements SpeculationHostDevToolsObserver. Prefetch
ahead of prerender is managed by PrerendererImpl and some CDP events
in Network domain are not emitted.
This CL removes SpeculationHostDevToolsObserver and makes
PrefetchContainer directly emit. Note that
- CDP events are emitted only if the prefetch was triggered by Spec
Rules.
- CDP events are emitted only if the initiator document is alive.
By this removal, CDP events of Network domain are emitted for prefetch
ahead of prerender.
No behavioral changes if kPrerender2FallbackPrefetchSpecRules disabled.
Fixed: 342537094, 348139748
Change-Id: Ica11ce4ea62b4044d2503934ffd283b623ccdf91
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5632873
Commit-Queue: Ken Okada <kenoss@chromium.org>
Reviewed-by: Kent Tamura <tkent@chromium.org>
Reviewed-by: Danil Somsikov <dsv@chromium.org>
Reviewed-by: Lingqi Chi <lingqi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1390718}
Currently, addModule and createWorklet use the same code path in the
browser and are (mostly) indistinguishable there. In this CL, we send
an extra bit via mojom from the renderer to the browser so that
SharedStorageWorkletHost can definitively distinguish between worklets
that have been created using addModule and those created via
createWorklet. This is in preparation for updating our reports to
DevTools to distinguish between calls to addModule and calls to
createWorklet.
Bug: 381899615
Change-Id: Ice20558f1456fe860d698287c7445a07096de2f1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6064024
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Reviewed-by: Yao Xiao <yaoxia@chromium.org>
Auto-Submit: Cammie Smith Barnes <cammie@chromium.org>
Commit-Queue: Cammie Smith Barnes <cammie@chromium.org>
Reviewed-by: Giovanni Ortuno Urquidi <ortuno@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1390665}
This prepares for the batchUpdate() Web API change.
Explainer PR(s):
- https://github.com/WICG/shared-storage/pull/199
- https://github.com/WICG/shared-storage/pull/205
How:
- The SharedStorageBatchUpdate method first acquires the batch-level
lock if requested (`with_lock` is present). Then, under the
batch-level lock, it handles each method with any necessary
individual lock. Finally, it releases the batch-level lock and
invokes `callback`.
- Note that the batch lock is released as soon as all methods are
posted to the database, whereas the callback is invoked only after
the database responses are available. This aligns with the
established pattern for `SharedStorageUpdate` (i.e., we only
have a single database task queue, so releasing the lock "sooner"
still produces the correct behavior, and has better performance).
Bug: 373899210
Change-Id: Iaf2c1ea50ac11c3dd57624ee44004c35ccf5ecbb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6055330
Reviewed-by: Cammie Smith Barnes <cammie@chromium.org>
Commit-Queue: Yao Xiao <yaoxia@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1390564}
New class StylusHandwritingCallbackSinkWin implements
ITfHandwritingSink interface from shellhandwriting.h.
Shell Handwriting API will call ::FocusHandwritingTarget() requesting to
set focus to the most likely text control. To handle
ITfHandwritingSink::FocusHandwritingTarget, the browser will request
that focus be updated in the renderer based on the RECT from
ITfFocusHandwritingTargetArgs::GetPointerTargetInfo, which will be
handled via mojom::blink::FrameWidget::OnStartStylusWriting. Focus will
only be set on content eligible for handwriting. If focus cannot be set
on content eligible for handwriting with the RECT provided by
GetPointerTargetInfo, then focus will fallback to the eligible element
that was initially tapped.
::OnFocusedHandled()/::OnFocusFailed() notifies the Shell Handwriting
API whether the focus was set or not. If the browser fails to set the
focus, the handwriting will be abandoned and Shell Handwriting will
stop processing incoming pointer input events.
Also, the change improves handwriting controller browser tests by
utilizing new mocks of handwriting-related interfaces. This enables
testing the controller without the mocking the controller instance.
Bug: 355578906
Change-Id: I86e637ced9fbc679f11e65c66053ba7d54321577
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5882132
Commit-Queue: Yaroslav Shalivskyy <yshalivskyy@microsoft.com>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1390517}
Speculative fix for a Chrome OS crash whereby an extension may get a
tree update for which it hasn't previously received a full tree. The
hypothesis is that this could have been due to AccessibilityReset being
skipped for frames in the BF cache.
Bug: 368660753
Change-Id: Id2561a178075897992e7da74ad4510863bcae3be
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6054366
Reviewed-by: David Tseng <dtseng@chromium.org>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Commit-Queue: David Tseng <dtseng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1390395}
This will be re-used in a follow-up in SystemMetricsSampler.
This should also replaced copied code in blink::MemoryUsageMonitor.
This changes Linux's FillOSMemoryDump from GetResidentAndSharedPagesFromStatmFile() (proc/pid/statm) to ReadProcFileToTrimmedStringPairs() (proc/pid/status)
This drops supports for pre MAC_OS_X_VERSION_10_11 missing
phys_footprint: https://issues.chromium.org/issues/40669926
Change-Id: I2002e69abbe852e82d0d1cb37017e77602538d6b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6039432
Reviewed-by: Primiano Tucci <primiano@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Owners-Override: Gabriel Charette <gab@chromium.org>
Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1390345}
Previously, only "opaque ads" fenced frames could navigate the _unfencedTop target, but we should allow all fenced frames to
do so.
While writing the spec for `_unfencedTop`, we re-discovered this limitation, and it was unclear why it existed in the first place. I wrote the spec change to allow the new keyword in all fenced frame types, and this change updates the Chromium implementation to match.
Bug: 380896847
Change-Id: Id02563a3e217042f9c8ac136929f168a7c899d51
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6017449
Reviewed-by: Liam Brady <lbrady@google.com>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Dominic Farolino <dom@chromium.org>
Commit-Queue: Andrew Verge <averge@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1390314}
WebView.
This CL does the following:
* Disables feature kFocusRenderWidgetHostViewAndroidOnActionDown on
WebView since it can switch focus when scrolled in cases with multiple
views which can trigger HTML focus changes that aren't intended. See
crbug.com/378779896, crbug.com/373672168 for more details.
* Moves kFocusRenderWidgetHostViewAndroidOnActionDown feature from
//content/common to //content/public/common.
Bug: 381820236, b:340824076
Change-Id: If81f00507f7a099e30803bbb6caea4665011b2a7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6054735
Reviewed-by: Alex Mitra <alexmitra@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Peter Beverloo <peter@chromium.org>
Commit-Queue: Aman Verma <amanvr@google.com>
Cr-Commit-Position: refs/heads/main@{#1390266}
RenderInputRouterDelegate interface.
This CL simplifies RenderInputRouterDelegate interface by removing the
`GetLastRenderFrameMetadata()` method. This method was solely used to
provide delegated ink hovering information to the
RenderWidgetHostInputEventRouter.
The `IsDelegatedInkHovering()` method now directly provides this
information, improving the interface's clarity and focus.
Bug: b:331419617
Change-Id: I48fb68a41143b3828a37598cc0f569e1b8de3654
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6058409
Commit-Queue: Aman Verma <amanvr@google.com>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Reviewed-by: Stephen Nusko <nuskos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1390265}
The current implementation only deletes the types of storage available
when the API was introduced.
This change introduces a new set of APIs that will delete all storage
data. These methods will be exposed through the AndroidX library for
apps to use.
The existing implementation is renamed to indicate that it is used by
the Android framework.
Bug: 373558938
Change-Id: Iac61b2403fad73a3170904613e784915278185de
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5934451
Reviewed-by: Nate Fischer <ntfschr@chromium.org>
Commit-Queue: Peter Pakkenberg <pbirk@chromium.org>
Reviewed-by: Christian Dullweber <dullweber@chromium.org>
Reviewed-by: Adam Walls <avvall@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1390255}
This removes the "5-minute rule" for prefetches, where they ignore
normal HTTP cache semantics for 5 minutes and instead stay cached in the
HTTP cache. This applies to <link rel=prefetch>, NoStatePrefetch (i.e.
<link rel=prerender>), and speculation rules prefetch.
Note that for speculation rules prefetch, because there is the separate
in-memory speculation rules prefetch cache, 2xx responses without
caching headers will still be stored in that in-memory cache. They just
won't be HTTP cached, in a way that was counter to the website's
expressed preferences.
Shipping this was approved back in May 2023, with an accompanying Finch
study to check for regressions [1]. However, we forgot to actually
change the default.
This is of new urgency now because of the impact on speculation rules
prefetch, which is is causing web developer pain. A web platform test is
included for the specific painful scenario, which fails before this
change and passes afterward.
Most of this CL consists of test updates: many of our tests relied on
not needing caching headers to make <link rel=prefetch> or
<link rel=prerender> work, and so do things like assume there will never
be a second request to those URLs. The general fix is to apply caching
headers to the resources in question, as that represents the intended
real-world usage of <link rel=prefetch>. (And, to a lesser extent, the
nonstandard and hopefully-one-day-removed <link rel=prerender>.)
Notably, the WPT prefetch-document.html was failing in all browsers
before this, including in Firefox which has a highly spec-conformant
implementation. It should now be passing.
PrerendererImplBrowserTestPrefetchAhead.PrefetchSuccessPrefetchMatchResolverTimeoutPrerenderFailure
was disabled, since it appears to never have been working as expected,
with the HTTP caching hiding the real problem. Issue 372851198 tracks
fixing that test.
Tests specifically for the 5-minute rule were deleted.
[1]: https://groups.google.com/a/chromium.org/g/blink-dev/c/Zdo71C0k9C0
Bug: 40232065, 381099745, 356624471, 372851198
Change-Id: I7d42c43efd89486587d8b7fc8ddd4412b31ef0bf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6056830
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Domenic Denicola <domenic@chromium.org>
Reviewed-by: Adam Rice <ricea@chromium.org>
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1390213}
This CL moves `InitializeServiceWorkerClient()` from
`ServiceWorkerControlleeRequestHandler` to
`ServiceWorkerMainResourceLoaderInterceptor`, in order to:
- Collocate `CalculateStorageKeyForUpdateUrls` and `UpdateUrls`, and
- Centralize the logic needed for every redirect legs (even if there
are no controlling ServiceWorker) to
`ServiceWorkerMainResourceLoaderInterceptor`.
Bug: 368025734
Change-Id: I29ab7ecd31bcc519e19411a120896fb3d35c3566
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5871254
Reviewed-by: Keita Suzuki <suzukikeita@chromium.org>
Reviewed-by: Shunya Shishido <sisidovski@chromium.org>
Reviewed-by: Yoshisato Yanagisawa <yyanagisawa@chromium.org>
Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1390185}
Use the corresponding members of `ServiceWorkerClient` instead,
in order to decouple dependencies around
`ServiceWorkerControlleeRequestHandler`.
`service_worker_client_` null checks are added before accessing,
just in case it should become null.
Bug: 368025734
Change-Id: I008b9d86f636f549e7c99b6e917f805f307eea56
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5871256
Reviewed-by: Yoshisato Yanagisawa <yyanagisawa@chromium.org>
Reviewed-by: Shunya Shishido <sisidovski@chromium.org>
Reviewed-by: Keita Suzuki <suzukikeita@chromium.org>
Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1390184}
As per current design, a RenderWidgetHost input event observer which
listens to events from multiple widgets does not know which widget the
event came from. With this change we pass an extra arg to event
notification methods to provide this information.
In a follow up change we will be using this to make
TouchSelectionController an input event observer which would like to
see events in root widget coordinate system, and for this we would want
to provide RWH handle so that the event can be transformed to root
widget's coordinate system.
AX-Relnotes: n/a.
Bug: 366000885
Change-Id: Idc6c3fa9a19adc7e72b205b282e78e8c12370a9d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6040416
Commit-Queue: Kartar Singh <kartarsingh@google.com>
Reviewed-by: Victor Vianna <victorvianna@google.com>
Reviewed-by: Stephen Nusko <nuskos@chromium.org>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Reviewed-by: Colin Blundell <blundell@chromium.org>
Reviewed-by: Jonathan Ross <jonross@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1390170}
The Canary data showed extraordinarily high proportion of kNotYetCreated
when a spare renderer is not present. The CL adds more detailed reasons
to understand the situation.
Bug: 377808943
Change-Id: I809dd467951db4482488a18167b47bfaeb077f79
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6049679
Reviewed-by: Calder Kitagawa <ckitagawa@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Jiacheng Guo <gjc@google.com>
Cr-Commit-Position: refs/heads/main@{#1390161}
This reverts commit 8d86347f0c.
Reason for revert: GestureBegin/GestureEnd mismatches are causing the CHECK to fire, so abandoning this attempt at a fix.
Original change's description:
> Clear touchscreen gesture target on GestureTapCancel+GestureEnd.
>
> This CL modifies DispatchTouchscreenGestureEvent to clear the
> touchscreen gesture target pointer when it sees GestureTapCancel
> followed by a terminal GestureEnd (i.e. matching the first
> GestureBegin in a sequence). Such a sequence can happen, for
> example, after using a touchscreen longpress to activate a
> context menu, which takes over the gesture sequence and uses
> the events listed above to terminate the sequence for the
> renderer.
>
> If touchscreen_gesture_target_ isn't cleared, then it can
> cause subsequent bubbling of touchpad scroll sequences to be
> aborted, as the logic thinks the touchscreen sequence is
> still in progress.
>
> Bug: 346629231
> Change-Id: Ifa66448b52621234d07d0943aac03af3f6df5af0
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6038653
> Reviewed-by: Jonathan Ross <jonross@chromium.org>
> Reviewed-by: Robert Flack <flackr@chromium.org>
> Commit-Queue: James Maclean <wjmaclean@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1388875}
Bug: 346629231
Change-Id: I79dd40f7f9b0e2971597147acd640deb7661fa80
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6058653
Reviewed-by: James Maclean <wjmaclean@chromium.org>
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1389893}
pages.
Before this CL, all image with loading=lazy attribute will be loaded
if they are on invisible pages, including prerendering.
This is a trade-off between loading as many resources as possible for
invisible pages and saving as many resources are possible for invisible
pages as the viewport they are in is invisible.
The pros for the latter are: (credit to barrypollard@)
- saving users' network bandwidth.
- let the renderer processes focus on the most important work when they
are invisible to reduce contention.
- saving website's resources as some prerender pages may never be shown
to users.
Specification does not set restriction for UA, so we'd like to try
another path, to respect this attribute for prerendering pages and
all invisible pages.
This CL adds a three-valued feature parameter to allow us to
experiment and find the best behavior.
Bug: 381110833
Change-Id: I0899423d906b4b65b2d10545930e7218c3f2fc7a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6055522
Reviewed-by: Domenic Denicola <domenic@chromium.org>
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Commit-Queue: Lingqi Chi <lingqi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1389836}
This creates a new embedder delegate that allows the embedder to modify
the GrContextOptions passed to skia. Behind a flag that is disabled by
default, this CL disables mip map sharpening and sets MSAA sample count
to 0.
Bug: 364872963
Change-Id: Ifec3c530d0a9bf837b313b01ed7c41094446e483
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5982515
Reviewed-by: Peter Beverloo <peter@chromium.org>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Commit-Queue: Alex Mitra <alexmitra@chromium.org>
Reviewed-by: Vasiliy Telezhnikov <vasilyt@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1389835}