0
Commit Graph

875 Commits

Author SHA1 Message Date
Jordan Bayles
27c3106041 [Cast Streaming] Migrate GVAFImpl to MojoGVAF
This patch moves the GpuVideoAcceleratorImpl to media/mojo/clients
and renames it to MojoGpuVideoAccelerator. This class can now be used
both in content and in components/mirroring.

Cast Streaming will be updated to use this implementation to enable
hardware mirroring in the media::cast::MediaVideoEncoderWrapper
implementation.

Googlers may view the related design doc at:
http://go/cast-streaming-media-videoencoder

Publicly published design documentation available at:
https://tinyurl.com/cast-streaming-mvew

Bug: 282984511
Change-Id: I91bba38ea55007d3f3626027308d800aeda0a383
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6095257
Commit-Queue: Jordan Bayles <jophba@chromium.org>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Frank Liberato <liberato@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1398421}
2024-12-18 22:40:49 -08:00
Sharon Yang
0f8372fb3f Add tracing for renderer initialization
Add a flow that shows the delay from the browser initializing the
renderer to when it happens in the renderer.

Bug: 382303496
Change-Id: Ief0615f94240db35b4a57f27f37192702842fad8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6072128
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Commit-Queue: Sharon Yang <yangsharon@chromium.org>
Reviewed-by: Mustafa Emre Acer <meacer@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1392410}
2024-12-05 18:37:05 +00:00
Patrick Monette
02fc0f9489 Add a trace event for renderer visibility.
There is already a trace event for this value, but it is part of
the much larger "toplevel" category.

Change-Id: I73b23c50fe1d111f692b8ee7274a148b60af8e44
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5982375
Reviewed-by: Etienne Pierre-Doray <etiennep@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Commit-Queue: Patrick Monette <pmonette@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1378743}
2024-11-06 05:03:24 +00:00
Patrick Monette
47cc13487e Show base::Process::Priority of renderer in tracing
While the process priority is mostly simplified to a
"backgrounded" or "foregrounded" boolean value, more priority
values will be used in the future and it'll be useful to know
in traces.

Change-Id: I5605560b8802ae47092b1251dbed75606514d69f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5722149
Reviewed-by: Etienne Pierre-Doray <etiennep@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Commit-Queue: Patrick Monette <pmonette@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1376864}
2024-11-01 14:46:03 +00:00
Joe Mason
afb31ba884 Fix and re-enable TransferSharedLastForegroundTime test
On some builders the death test was failing because an assert had an
unexpected message. Removed the death test: there's no need to test for
an invalid handle since it's blocked at the Mojo layer.

Bug: 375065072
Change-Id: I09d0882e9a207b5440d3018edf5b2db8ab579980
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5953918
Commit-Queue: Nasko Oskov <nasko@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Auto-Submit: Joe Mason <joenotcharles@google.com>
Cr-Commit-Position: refs/heads/main@{#1372758}
2024-10-23 16:24:14 +00:00
Joe Mason
51eb828535 Transfer scenario shared memory handles in DocumentCoordinationUnit
Following a suggestion by Nasko in https://crrev.com/c/5867574, this
handles performance scenario shared memory completely in the blink and
components/performance_manager layers, getting rid of a shim through
content/ and chrome/.

This will unblock a followup CL to attach the browser-side
StructuredSharedMemory region to ProcessNode instead of
RenderProcessHost, which is blocked by the content/ shim accessing it
synchronously on the UI thread. The cost is an extra IPC roundtrip on
process startup.

Includes a partial revert of https://crrev.com/c/5867574 that returns
mojom::Renderer::TransferSharedMemoryRegions to TransferSharedLastForegroundTime.

Bug: 365586676
Change-Id: I681a3c941661ebba7c10b7abaf54aa5c4e430a9e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5949866
Commit-Queue: Joe Mason <joenotcharles@google.com>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Auto-Submit: Joe Mason <joenotcharles@google.com>
Cr-Commit-Position: refs/heads/main@{#1372300}
2024-10-22 20:51:49 +00:00
Frank Li
486a40271e [media] avoid heap-use-after-free in OverlayStateObserverImpl::Create
In PS38 of
https://chromium-review.googlesource.com/c/chromium/src/+/3403933/37..38,
`scoped_refptr<OverlayStateServiceProvider>` parameter of
`OverlayStateObserverImpl::Create()' was changed into
`OverlayStateServiceProvider*`. This causes the heap-use-after-free
issue described in https://issuetracker.google.com/issues/354824998.

This CL is to follow existing code pattern of producing `scoped_refptr`
in `RenderThreadImpl::GetStreamTextureFactory()`/
`RenderThreadImpl::GetDCOMPTextureFactor()` instead of returning a raw
pointer in `RenderThreadImpl::GetOverlayStateServiceProvider()`.

Bug: 354824998
Change-Id: Ic188bf18b28a5f024488bd92fb11f6fca6c5d05a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5910432
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Frank Li <frankli@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1368423}
2024-10-14 21:00:53 +00:00
François Doray
6ed98d8945 [blink + content] Add features to fine-tune memory pressure response in renderers.
This CL adds 3 features to selectively disable/enable parts of the
memory pressure response in renderers:

"ForwardMemoryPressureToBlinkIsolates"
Controls whether memory pressure is forwarded to Blink isolates, which
has for effect to trigger a GC (critical) or start incremental marking
(moderate).

"ReleaseResourceStrongReferencesOnMemoryPressure"
Controls whether `blink::MemoryCache` and `blink::ResourceFetcher`
release their strong references to resources in response to memory
pressure. This affects whether previously used resources can be found
in the `blink::MemoryCache` in the future.

"ReleaseResourceDecodedDataOnMemoryPressure"
Controls whether `blink::Resource` releases its decoded data in
response to response to critical memory pressure. This affects
whether the data has to be decoded again if the resource is
reused in the future.

A previous experiment disabled *all* memory pressure clients in
renderers on desktop, with good impact on LCP but some memory
increase (go/finch50-no-memory-purge-in-renderers-desktop). The new
features will be used to assess the impact of important memory pressure
client on the LCP and memory metrics in isolation.

Bug: 40287434
Change-Id: I920389c3cadf3f6e82b6836e484adebf10ef90a1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5913594
Reviewed-by: Charlie Reis <creis@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Francois Pierre Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1366859}
2024-10-10 15:31:53 +00:00
Joe Mason
0c9a90a047 Add a shared memory channel for performance scenarios
* Renames TransferSharedLastForegroundTime to
  TransferSharedMemoryRegions and uses it to transfer multiple region
  handles. Also updates it to allow optional handles (the mojo typemap
  will crash on invalid handles otherwise.)
* Adds functions to manage the browser side of the channel in
  components/performance_manager.
* Adds accessors to ContentBrowserClient to return performance
  scenario region handles. The default implementation returns invalid
  handles, but ChromeContentBrowserClient gets the handles from
  components/performance_manager.
* Adds a test for TransferSharedMemoryRegions.

Bug: 365586676
Change-Id: Ib0ff85e07459d768896ea571e357d687cb9e8243
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5867574
Reviewed-by: Robert Kaplow <rkaplow@chromium.org>
Reviewed-by: Olivier Li <olivierli@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Auto-Submit: Joe Mason <joenotcharles@google.com>
Commit-Queue: Joe Mason <joenotcharles@google.com>
Cr-Commit-Position: refs/heads/main@{#1359994}
2024-09-25 16:41:38 +00:00
Maggie Chen
80b7361d95 Convert SharedBitmap to SharedImage for Pepper Graphics 2D
Replace AllocateSharedBitmap() with CreateShareImage() in
Pepper Graphics 2D.

Bug: 40064122
Change-Id: Ib4307d71f34d8747cd2e7188aad3eb3c03e137f0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5868083
Commit-Queue: Maggie Chen <magchen@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Vasiliy Telezhnikov <vasilyt@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1357376}
2024-09-18 22:58:31 +00:00
Joe Mason
b305e9623c Add a StructuredSharedMemory wrapper
Adds a cleaner interface to ReadOnlySharedMemoryRegion /
SharedMemoryMapping, which specifies the type that's stored in the
memory when the memory is mapped rather than on every access.

Converts some simple users of shared memory to use
StructuredSharedMemory.

Bug: 357945779
Change-Id: I27105cf7feb2136c14c7e345617f7e2284f15e0c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5746992
Reviewed-by: Gabriel Charette <gab@chromium.org>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Commit-Queue: Joe Mason <joenotcharles@google.com>
Reviewed-by: Yuzhu Shen <yzshen@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1343748}
2024-08-19 20:55:39 +00:00
Dave Tapuska
acbd57fc4e Remove dead code - WebMemoryStatistics
I do not see this code used anywhere so remove it.

Change-Id: I685750aba2af9a742b468d31c1fad94233f7e2d7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5739730
Reviewed-by: Ian Vollick <vollick@chromium.org>
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1333697}
2024-07-26 18:44:17 +00:00
Etienne Pierre-doray
e531336ad9 [battery] Enable heavy AlignWakeUps under battery saver mode
- Add a feature kBatterySaverModeAlignWakeUps
- Add a signal to all child processes
- Call OverrideAlignWakeUpsState in browser,
  renderers and child processes

Bug: 40158967
Change-Id: I6588dfa20182fb5d410bf2b839588066f6f270a5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5347739
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org>
Reviewed-by: Francois Pierre Doray <fdoray@chromium.org>
Reviewed-by: Anthony Vallée-Dubois <anthonyvd@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1329769}
2024-07-18 20:07:24 +00:00
Maggie Chen
40a628aad4 Do not call EstablishGpuChannel if the gpu remote has been disconnected
The GPU channel cannot be established when gpu_remote is disconnected.
Stop calling RequestNewLayerTreeFrameSink because it's going to fail
again and it will be stuck in a forever loop of retries. This makes the
processes unable to be killed after Chrome is closed.

Bug: 336164423
Change-Id: Ie7db1df5531e178b2d06063c10c23ded917217b8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5676887
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Vasiliy Telezhnikov <vasilyt@chromium.org>
Commit-Queue: Maggie Chen <magchen@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1323390}
2024-07-04 16:19:36 +00:00
Etienne Pierre-doray
f886cee01f [contention] Connect ThreadPool Restricted size to renderers
Based on renderer priority.
go/chrome-workload-prioritization

Bug: b/350698335
Change-Id: I8a11d6291c6c2ce2303912d58c29bec753020b2b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5663898
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Francois Pierre Doray <fdoray@chromium.org>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1322225}
2024-07-02 16:19:26 +00:00
Lukasz Anforowicz
5fd0efb315 Remove unused, unsafe AgentGroupSchedulerImpl::broker_ field.
This field is:

* Unsafe in presence of Oilpan (see https://crbug.com/40261265)
* Not actually used - there are no callers of
  `AgentGroupScheduler::GetBrowserInterfaceBroker`.  This method was
  added in https://crrev.com/c/2677585 and AFAICT no callers have ever
  been added later - for example this command finds no other commits:
  `git log -S AgentSched -- content/browser/browser_interface_binders.cc`

Removing this field also helps to make progress on
https://crbug.com/41482945 - this field is related to 1 out of 5 callers
of `BrowserInterfaceBrokerProxy::Bind` and the linked bug requires
passing `ContextLifecycleNotifier` to `HeapMojoRemote`.  I note that
`AgentGroupSchedulerImpl::BindInterfaceBroker` seems to be the only
caller of `BrowserInterfaceBrokerProxy::Bind` which doesn't have a 1:1
relationship with a `ContextLifecycleNotifier` (which IIUC roughly
corresponds to the `ExecutionContext`).  The other callers are 1)
constructor of `WorkerGlobalScope`, 2) constructor of
`content::RenderFrameImpl`, 3)
`MojoBindingContext::SetMojoJSInterfaceBroker` (we ignore here
`GetEmptyBrowserInterfaceBroker` which doesn't actually need to bind an
actual mojo remote).

Fixed: 40261265
Bug: 41482945
Change-Id: Id07826bb008bea6157a30868a56ad05ad3bbc675
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5646657
Reviewed-by: Francois Pierre Doray <fdoray@chromium.org>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Auto-Submit: Łukasz Anforowicz <lukasza@chromium.org>
Reviewed-by: Emily Stark <estark@chromium.org>
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Reviewed-by: Scott Haseley <shaseley@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1319775}
2024-06-26 15:29:53 +00:00
Patrick Monette
7d8aca114d Pass the actual base::Process::Priority to the renderer instead
of a single boolean indicating if the process is backgrounded.

Currently a nop change as the enum is converted back to a single
boolean in the renderer, but it will be used in a later CL to
apply different interventions when a process is kUserVisible
versus kUserBlocking.

Bug: 41485666
Change-Id: Ide4130a1d7b9653ae434e0d0992d46f74fbb9e7f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5555305
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Patrick Monette <pmonette@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1314537}
2024-06-13 12:11:10 +00:00
Gabriel Charette
8becf3eed3 [metrics] Introduce UMA_HISTOGRAM_WITH_BEST_EFFORT_SUPPORT
It will support automatic ".BestEffort" suffixing in renderers for
metrics that rely on timing.

It uses shared memory to share read-only std::atomic<TimeTicks> state
between RenderProcessHostImpl and the renderer.

"HangWatcher.IsThreadHung.RendererProcess.*" will be the first metric to
test this out. There was a recent "regression" caused to it by a
mix-shift when shipping more aggressive backgrounding of best-effort
renderers on Mac, recovering from that is how we test that this works.

Local chrome://histograms test: https://snipboard.io/KjNzMa.jpg

Bug: 334983411
Change-Id: I78259ca47514059a74fb1b672192e90b24551e31
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5459762
Reviewed-by: Robert Kaplow <rkaplow@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Reviewed-by: Joe Mason <joenotcharles@google.com>
Reviewed-by: Olivier Li <olivierli@chromium.org>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Auto-Submit: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1311669}
2024-06-07 00:47:20 +00:00
Alison Gale
770f3fce37 Migrate TODOs referencing old crbug IDs to the new issue tracker IDs
The canonical bug format is TODO(crbug.com/<id>). TODOs of the
following forms will all be migrated to the new format:

- TODO(crbug.com/<old id>)
- TODO(https://crbug.com/<old id>)
- TODO(crbug/<old id>)
- TODO(crbug/monorail/<old id>)
- TODO(<old id>)
- TODO(issues.chromium.org/<old id>)
- TODO(https://issues.chromium.org/<old id>)
- TODO(https://issues.chromium.org/u/1/issues/<old id>)
- TODO(bugs.chromium.org/<old id>)

Bug id mapping is sourced from go/chrome-on-buganizer-prod-issues.
See go/crbug-todo-migration for details.

#crbug-todo-migration

Bug: b/321899722
Change-Id: Ibc66b8c440e4bcdef414e77fef4d9874d2ea9951
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5493800
Auto-Submit: Alison Gale <agale@chromium.org>
Commit-Queue: Alison Gale <agale@chromium.org>
Reviewed-by: Peter Boström <pbos@chromium.org>
Owners-Override: Alison Gale <agale@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1293330}
2024-04-27 00:39:58 +00:00
Maggie Chen
bee973bfe9 Plumb ShareImageInterface to VideoResourceUpdater::SoftwarePlaneResource
From blink::WebVideoFrameSubmitter to VideFrameResourceProvider then
VideoResourceUpdater::SoftwarePlaneResource. ShareImageInterface will
be used for creating SharedImage for software video resource.

Bug: b:40064122
Change-Id: I7c00552dfea37e9628183e55ef2672501c63450c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5251261
Commit-Queue: Vasiliy Telezhnikov <vasilyt@chromium.org>
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Reviewed-by: Vasiliy Telezhnikov <vasilyt@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Stefan Zager <szager@chromium.org>
Auto-Submit: Maggie Chen <magchen@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1267829}
2024-03-04 14:33:43 +00:00
Dave Tapuska
dc05c6ae74 Add a small cache to avoid synchronous IPC on iframe creation
Synchronous IPCs aren't ideal, we can add a small cache to avoid
them in most situations. The cache is first populated with 4 items
upon RenderThread initialization. When the cache has only two items
in it new ones are asynchronously requested from the browser. If
the cache is empty it will fall back to the synchronous request.
This is implemented as a feature flag since we'd like to conduct a
study to see if this impacts FCP/LCP.

Thanks to nasko@ who's discussion sparked this approach as opposed
to something more complex as discussed in
https://docs.google.com/document/d/1nu1aUc4_UiWeqwAQ0-mxTMP4S7pZmNBvs110GGMuZl8/edit

Bug: 41496222
Change-Id: I3ea33d63c1437f879fafa33ce85d5daa279df9bf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5249292
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1256479}
2024-02-05 23:28:03 +00:00
Vasiliy Telezhnikov
11731ea78b Cleanup after UseSharedImagesForPepperVideo
Bug: 986480
Change-Id: I11b293460f482e64383a560ae4e11026ce1de541
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5190891
Reviewed-by: Derek Schuff <dschuff@chromium.org>
Commit-Queue: Vasiliy Telezhnikov <vasilyt@chromium.org>
Reviewed-by: Colin Blundell <blundell@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Reviewed-by: Dominic Farolino <dom@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1252134}
2024-01-25 16:26:06 +00:00
Arthur Sonzogni
c686e8f4fd Rename {absl => std}::optional in //content/
Automated patch, intended to be effectively a no-op.

Context:
https://groups.google.com/a/chromium.org/g/cxx/c/nBD_1LaanTc/m/ghh-ZZhWAwAJ?utm_medium=email&utm_source=footer

As of https://crrev.com/1204351, absl::optional is now a type alias for
std::optional. We should migrate toward it.

Script:
```
function replace {
  echo "Replacing $1 by $2"
  git grep -l "$1" \
    | cut -f1 -d: \
    | grep \
      -e "^content" \
    | sort \
    | uniq \
    | grep \
      -e "\.h" \
      -e "\.cc" \
      -e "\.mm" \
      -e "\.py" \
    | xargs sed -i "s/$1/$2/g"
}
replace "absl::make_optional" "std::make_optional"
replace "absl::optional" "std::optional"
replace "absl::nullopt" "std::nullopt"
replace "absl::in_place" "std::in_place"
replace "absl::in_place_t" "std::in_place_t"
replace "\"third_party\/abseil-cpp\/absl\/types\/optional.h\"" "<optional>"
git cl format
```

# Skipping unrelated "check_network_annotation" errors.
NOTRY=True

Bug: chromium:1500249
Change-Id: Icfd31a71d8faf63a2e8d5401127e7ee74cc1c413
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5185537
Auto-Submit: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Owners-Override: Avi Drissman <avi@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1245739}
2024-01-11 08:36:37 +00:00
Dave Tapuska
29e8fb0d7a Convert RenderMessageFilter to a non-associated Receiver
This filter is bound on the IO thread and processes a single
synchronous message. It does not need to be an associated interface
because messages that depend on it are sent after the synchronous
response is returned to the renderer.

Bug: 993189
Change-Id: Ic43d3febc4d442dc50c0a91d04391c311e4eaab3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5174108
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1244249}
2024-01-08 20:50:36 +00:00
Dave Tapuska
2bf282ccbb Move HasGpuProcess to RendererHost from RenderMessageFilter
Having it on the RenderMessageFilter meant it was processed on the IO
thread, but ultimately it was posted to the UI thread anyways. So it is
much less complicated if the method is on a UI bound interface. This
method is only used by the GPU benchmarking extension.

Bug: 993189
Change-Id: Iab3de7769a894f3437371a3bff7b7827a2ed2de4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5170790
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1243535}
2024-01-05 19:23:04 +00:00
Dave Tapuska
728efd5462 Prune more legacy IPC code from RenderFrame, ChildThread, RenderThread
- Do not build RenderFrame as an IPC::Sender/Listener
- Remove public FromRoutingID lookup
- Remove requesting the routing ID from RenderFrame
- Do not build ChildThread as an IPC::Sender
- This leaves all the legacy IPC code in ChildThreadImpl the same.
- We still require legacy IPC for some associated channel interfaces (see
RenderThread::GetChannel callsites, and
RenderThreadObserver::RegisterMojoInterfaces).
- The scheduling differences between associated channel interfaces and
normal associated interfaces still also need to be resolved to disable legacy IPC over the wire.

Bug: 1502660
Change-Id: I6343377ee82a8284ce8a9734f6e5719f6ca102a9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5105871
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1242431}
2024-01-03 15:10:47 +00:00
Anthony Vallee-Dubois
4b3fb04b85 Battery Saver Mode V8 & blink tuning
This CL hooks up Battery Saver Mode to the renderer process, allowing
the tuning of the v8 garbage collector and aligning wake ups at 32ms
for the blink thread pool.

V8 dependent CL: https://chromium-review.googlesource.com/c/v8/v8/+/5046175

Bug: 
Change-Id: I9795c7b2def034891f78941d0862b3cedd9cd8b7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5046375
Reviewed-by: Brendon Tiszka <tiszka@chromium.org>
Commit-Queue: Anthony Vallée-Dubois <anthonyvd@chromium.org>
Reviewed-by: Francois Pierre Doray <fdoray@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Reviewed-by: Nate Chapin <japhet@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1239750}
2023-12-20 18:06:49 +00:00
Dave Tapuska
b0ffeb7ced RenderThread - Remove some dead code
Unused, redundant, a burden they bear, dragging down the program,
a weight to spare.

Bug: None
Change-Id: I12023f75caf98a751a9c5cd3147bbbadcd1c3437
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5088829
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1234010}
2023-12-06 17:24:03 +00:00
Dave Tapuska
a870bf9949 RenderThread - Remove dead code
https://crrev.com/0bdfacd2 removed usages of the pending_frames_
variable but still left the definitions around.

Bug: 1158869
Change-Id: I0da01b4aaaf79882175b0aec5f9bf4b0c596880b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5010673
Reviewed-by: danakj <danakj@chromium.org>
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1221110}
2023-11-07 19:42:02 +00:00
Dave Tapuska
3b10dd56a9 Remove a sync call to create a frame sink.
The browser always generates FrameSinks in the range of [0, INT_MAX]
Let the renderer generate the rest of the range, this eliminates the
need for a sync IPC.

Bug: 993189
Change-Id: I417a72e82a4be38d83d7d4edfc5f675fe20541e1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4995105
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Jonathan Ross <jonross@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1219029}
2023-11-02 19:19:54 +00:00
Joanne de Abreu
7cbed87a21 Attribution Reporting: Support disabled option for WebView
Change attribution support to be web_contents specific to support the
disabled option for WebView. This change ensures that when attribution
reporting is disabled for WebView, no calls are made (previously the
initial calls to the attribution server were made, although the result
was not logged).

OBSOLETE_HISTOGRAM[Conversions.AttributionSupport]=Replaced by Conversions.AttributionOsLevelApiState and Conversions.AttributionBehavior

Fixed: 1492081
Test: AttributionReportingTest
Change-Id: I0a1aceca88805a8446691aee98e2e5b7716dadb9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4966783
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Joanne de Abreu <jdeabreu@google.com>
Reviewed-by: Nan Lin <linnan@chromium.org>
Auto-Submit: Joanne de Abreu <jdeabreu@google.com>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Elly FJ <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1217264}
2023-10-30 23:25:26 +00:00
Michael Lippautz
cf847100c8 Expose APIs that are cross-origin-isolated with --disable-web-security
--disable-web-security is used to disable cross-origin isolation in
general. Various things like certain bindings (e.g.
performance.measureUserAgentSpecificMemory()) are gated behind the
WebIDL attribute 'CrossOriginIsolated'. This mostly depends on
Agent::CrossOriginIsolated(). Set this property directly on the renderer
process when --disable-web-security is provided.

The effect is that various otherwise gated APIs become usable which is
useful for debugging.

Bug: chromium:1486857
Change-Id: I146513a26d757118edb9be5f57fe6f7f1317b128
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4896878
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Yuki Shiino <yukishiino@chromium.org>
Reviewed-by: Camille Lamy <clamy@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1205080}
2023-10-04 06:59:27 +00:00
Victor Tan
8766147948 Remove UA reduction OT features for all requests
This CL removes support User-Agent reduction origin trial for Javascript
API and all subresource requests. Make sure all context use the default
user-agent function instead of checking whether response has a valid
origin trial token on User-Agent reduction/deprecation origin trial.

This CL also refactor corresponding tests to make sure the user-agent
returns the correct value when reduction features turns on.

This CL cleans up other one-off code we introduced to completed the
user-agent reduction origin trial.

Change-Id: I3f1c3213feffc8f3fc7de8dc5c23b9090f498e3a
Bug: 1258063
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4557684
Reviewed-by: Ari Chivukula <arichiv@chromium.org>
Commit-Queue: Victor Tan <victortan@chromium.org>
Reviewed-by: Clark DuVall <cduvall@chromium.org>
Reviewed-by: Yoav Weiss <yoavweiss@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1155100}
2023-06-08 21:38:41 +00:00
James Scott
f4b5766bf1 OriginTrialsSettingsProvider for disabled tokens in OT policy creation
Previously, during Origin Trial Policy creation, it pulled the disabled
tokens from the CLI flags. As reported in the linked bug, there is a
small limit to the number of disabled tokens that can be provided. This
CL changes where the policy gets the disabled tokens.

Now, when OriginTrialPolicyImpl is created, it will use
OriginTrialsSettingsProvider to get the settings previously set during
the start up of the browser or renderer.

---

When are the settings for OriginTrialsSettingsProvider set:

Browser: During the startup of chrome and android webview, it
will set the settings for blink::OriginTrialsSettingsProvider.

Renderer:  The settings are pushed to the renderer via
InitializeRenderer. Once that is called, the settings for
blink::OriginTrialsSettingsProvider are set

---
About blink::OriginTrialsSettingsProvider:

It stores the settings for the process. OriginTrialPolicyImpl can refer
to it to get the settings. In single process mode, the settings are only
set during browser startup and not during InitializeRenderer.



Bug: 1216609
Change-Id: Ibe1663463688344d20bcd62ca4952c1cfebedfbb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4424072
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: James Scott <jamescscott@google.com>
Reviewed-by: Jason Chase <chasej@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1145589}
2023-05-17 20:52:28 +00:00
Maggie Chen
49a25e6b5c No retry in SharedMainThreadContextProvider if the result is fatal
Early exit in RenderThreadImpl::SharedMainThreadContextProvider if
the context result is kFatalFailure. No need to retry.

Bug: 1434885
Change-Id: I6d65cf36fd46cda8113134471c9541facff50e35
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4501443
Commit-Queue: Maggie Chen <magchen@chromium.org>
Reviewed-by: Stefan Zager <szager@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1141059}
2023-05-08 21:26:20 +00:00
Andrew Paseltiner
a45d270b10 Build Attribution Reporting OS support on all platforms
Previously, build flags were used to restrict this to Android, but that
entailed significant complexity by infecting a lot of related code with
the need to itself be buildflag-protected. This will make it easier to
add OS support to other platforms in the future, if needed, and
increases test coverage.

This change introduces a no-op OS-level manager for platforms on which
OS support is disabled and removes layering violations between the
AttributionManager and AttributionOsLevelManager.

Change-Id: I7a984d6c77fd0312ad104c248d4278bb7666d99e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4480909
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Andrew Paseltiner <apaseltiner@chromium.org>
Reviewed-by: Nan Lin <linnan@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1139825}
2023-05-04 23:06:47 +00:00
Kenichi Ishibashi
b01812165d Add a way to clear renderer's in-memory cache from browser
This CL adds a method to the Renderer mojo interface so that:
* The blink memory cache is cleared when a user clears cache via
  chrome://settings/clearBrowserData.
* SplitCache tests reliably clear the blink memory cache even when
  tabs/shells share a process.

For simplicity, the method doesn't take a time range to clear caches.
This should be fine because the disk cache still retain resources
outside the time range. These resources will be served via the disk
cache.

Bug: 1434900,668114
Change-Id: I174e8af0e97b69989380a0e9c303d2f14ea58b36
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4486550
Commit-Queue: Kenichi Ishibashi <bashi@chromium.org>
Reviewed-by: Sam McNally <sammc@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1138084}
2023-05-01 23:33:27 +00:00
Nan Lin
bb2dbd9738 Allow web attribution to be independently configurable in OS-Support
https://github.com/WICG/attribution-reporting-api/pull/758

Web attribution is explicitly disabled for WebView. This CL extends
the OS support enum to allow web attribution to be independently
configurable, and the Attribution-Reporting-Support header will
indicate the support level accordingly.

If neither web nor os-level attribution is enabled, background
attributionsrc requests will not be made, and
the Attribuiton-Reporting-Eligible header will not be set on requests.
Note that this applies even when kAttributionReportingCrossAppWeb
feature is disabled to avoid bandwidth waste.

A virtual function is added to ContentBrowserClient to allow WebView
to disable web attribution. A follow-up CL will enable OS support and
disable web support on WebView.

Note that we cannot add web tests for the NoWebOrOsSupport DevTools
issue type as there is no way to override the OS support value there.

Side note: when both web and OS are supported, the header is updated
to "os, web" to align with the explainer.

Bug: 1432278
Change-Id: Id53852ed2891755ff05b74ea025ce40f44c08956
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4413547
Reviewed-by: Andrew Paseltiner <apaseltiner@chromium.org>
Commit-Queue: Nan Lin <linnan@chromium.org>
Reviewed-by: Kenichi Ishibashi <bashi@chromium.org>
Code-Coverage: Findit <findit-for-me@appspot.gserviceaccount.com>
Reviewed-by: Garrett Tanzer <gtanzer@chromium.org>
Reviewed-by: Ken Buchanan <kenrb@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Nate Chapin <japhet@chromium.org>
Reviewed-by: Charlie Harrison <csharrison@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1134960}
2023-04-25 01:05:18 +00:00
Nan Lin
6a63aa64a5 Move Attribution-Reporting-Support header setting to network service
This is one of the first steps to move attribution reporting request
and response logic to network service. It also makes it easier to
enforce the properties that the header is set if and only if the
corresponding feature is enabled and when the
Attribution-Reporting-Eligible is also present.

The feature flag and the mojom type are moved to
//services/network/public to be used by //services/network, blink and
browser. We will investigate removing all knowledge of the OS support
value from the renderer in the future.

The OS support enum is added to the resource request types to be
populated to the network service layer.

We will likewise move setting the Attribution-Reporting-Eligible header
to the network service in a future CL.

Bug: 1375791, 1425083
Change-Id: I6d0dc6154230963b376477a74239115b64c6ffae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4426530
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Andrew Paseltiner <apaseltiner@chromium.org>
Reviewed-by: Nate Chapin <japhet@chromium.org>
Reviewed-by: Garrett Tanzer <gtanzer@chromium.org>
Code-Coverage: Findit <findit-for-me@appspot.gserviceaccount.com>
Reviewed-by: David Bokan <bokan@chromium.org>
Reviewed-by: Brendon Tiszka <tiszka@chromium.org>
Reviewed-by: Kenichi Ishibashi <bashi@chromium.org>
Reviewed-by: Ken Buchanan <kenrb@chromium.org>
Commit-Queue: Nan Lin <linnan@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1131961}
2023-04-18 16:25:13 +00:00
Mark Rowe
432f10ecd7 Remove unused macOS system color change logic
Highlight colors are accessed via `WebSandboxSupport` rather than being
retrieved from AppKit. This means it is no longer necessary to write
them into user defaults. `LayoutThemeMac` still reads
`AppleAquaColorVariant` from user defaults on older OS versions so it
must still be written. It can be removed once Chromium drops support for
macOS 10.13.

Since colors are no longer retrieved from AppKit it is no longer
necessary to post notifications to let AppKit know that the system
colors have been changed.

Change-Id: I2838946feb1b45a07d9026db26df00c29b4bb7fc
Fixed: 1420647
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4381954
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Auto-Submit: Mark Rowe <markrowe@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1125711}
2023-04-03 23:59:37 +00:00
Takashi Sakamoto
02be616c8f Make UserLevelMemoryPressureSignal not to dispatch any signals for inert intervals after loading is finished.
Add |inert_interval| finch parameter to the feature and modify the code
to see RAILMode changes on render processes. If the current RAIL mode is
loading or is just changed to be not loading, we will consider that the
render process is running OnLoad or DOMContentLoaded event handler. The
process requires memory to finish the event handlers. So wait inert
interval after loading is finished and dispatch memory pressure signals
if any requests are arrived during the inert interval.

Bug: 1393283
Change-Id: Id12458659437b9ba74b038f9c1847c7799982672
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4333318
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Commit-Queue: Takashi Sakamoto <tasak@google.com>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1120355}
2023-03-22 03:20:42 +00:00
Nan Lin
555c9f6b0c Use async API to get measurement state and populate to renderers
Per crrev.com/c/4313359, MeasurementManagerFutures will be used and
therefore the Android API to get measurement state is asynchronous.

The measurement state is per device and can only change when the user
changes the setting on the device. The flag is cached as a global
variable and initialized once on startup. The value returned from JNI
will be populated to all renderer processes created earlier.

Bug: 1417278
Change-Id: Ideb3582849d9415acc3b7265a88d54f07a517b4d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4319466
Reviewed-by: Andrew Paseltiner <apaseltiner@chromium.org>
Reviewed-by: Ken Buchanan <kenrb@chromium.org>
Auto-Submit: Nan Lin <linnan@chromium.org>
Commit-Queue: Ken Buchanan <kenrb@chromium.org>
Reviewed-by: John Delaney <johnidel@chromium.org>
Reviewed-by: Bo Liu <boliu@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Garrett Tanzer <gtanzer@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1115853}
2023-03-10 19:36:07 +00:00
Yao Xiao
4890a29d66 Reland "[shared storage] move some mojom files to //third_party/blink/public/mojom"
This is a reland of commit 1ba1c1238b

Fixed missing include in interest_group_auction_reporter_unittest.cc.

Original change's description:
> [shared storage] move some mojom files to //third_party/blink/public/mojom
>
> We are looking into replacing the existing worklet environment with
> blink-style worklet, e.g. utilize WorkerThread/WorkletGlobalScope/
> etc. This requires moving relevant mojom files to blink, so that
> they are accessible from the new global_scope file (doesn't exist
> just yet).
>
> Design doc:
> https://docs.google.com/document/d/1swL8GedhL7UJ-aKam8seGfmSYWLgJQSK8I8AdFBWTJo
> Discussion thread: https://groups.google.com/a/chromium.org/g/platform-architecture-dev/c/E-wUhAi0Zz0
>
> Bug: 1414951
> Change-Id: I40bddefec08d401f14c3ccadffabaa14ea7a247e
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4241206
> Reviewed-by: Avi Drissman <avi@chromium.org>
> Reviewed-by: Dominic Farolino <dom@chromium.org>
> Reviewed-by: Daniel Cheng <dcheng@chromium.org>
> Commit-Queue: Yao Xiao <yaoxia@chromium.org>
> Reviewed-by: Ted Choc <tedchoc@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1110813}

Bug: 1414951
Change-Id: I4ba18fc5c3fb22f5de2c04036a182d4e02271755
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4295141
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Yao Xiao <yaoxia@chromium.org>
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1111267}
2023-02-28 23:52:47 +00:00
luci-bisection@appspot.gserviceaccount.com
0a2d66c7ff Revert "[shared storage] move some mojom files to //third_party/blink/public/mojom"
This reverts commit 1ba1c1238b.

Reason for revert:
LUCI Bisection identified this CL as the culprit of a build failure. See the analysis: https://luci-bisection.appspot.com/analysis/b/8787931147056133537

Sample failed build: https://ci.chromium.org/b/8787931147056133537

If this is a false positive, please report it at https://bugs.chromium.org/p/chromium/issues/entry?comment=Analysis%3A+https%3A%2F%2Fluci-bisection.appspot.com%2Fanalysis%2Fb%2F8787931147056133537&components=Tools%3ETest%3EFindit&labels=LUCI-Bisection-Wrong%2CPri-3%2CType-Bug&status=Available&summary=Wrongly+blamed+https%3A%2F%2Fchromium-review.googlesource.com%2Fc%2Fchromium%2Fsrc%2F%2B%2F4241206

Original change's description:
> [shared storage] move some mojom files to //third_party/blink/public/mojom
>
> We are looking into replacing the existing worklet environment with
> blink-style worklet, e.g. utilize WorkerThread/WorkletGlobalScope/
> etc. This requires moving relevant mojom files to blink, so that
> they are accessible from the new global_scope file (doesn't exist
> just yet).
>
> Design doc:
> https://docs.google.com/document/d/1swL8GedhL7UJ-aKam8seGfmSYWLgJQSK8I8AdFBWTJo
> Discussion thread: https://groups.google.com/a/chromium.org/g/platform-architecture-dev/c/E-wUhAi0Zz0
>
> Bug: 1414951
> Change-Id: I40bddefec08d401f14c3ccadffabaa14ea7a247e
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4241206
> Reviewed-by: Avi Drissman <avi@chromium.org>
> Reviewed-by: Dominic Farolino <dom@chromium.org>
> Reviewed-by: Daniel Cheng <dcheng@chromium.org>
> Commit-Queue: Yao Xiao <yaoxia@chromium.org>
> Reviewed-by: Ted Choc <tedchoc@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1110813}
>

Bug: 1414951
Change-Id: Ide41b5370d1286f31cd094504d2fbfccb713444d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4297655
Owners-Override: luci-bisection@appspot.gserviceaccount.com <luci-bisection@appspot.gserviceaccount.com>
Commit-Queue: luci-bisection@appspot.gserviceaccount.com <luci-bisection@appspot.gserviceaccount.com>
Bot-Commit: luci-bisection@appspot.gserviceaccount.com <luci-bisection@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#1110818}
2023-02-28 08:44:32 +00:00
Yao Xiao
1ba1c1238b [shared storage] move some mojom files to //third_party/blink/public/mojom
We are looking into replacing the existing worklet environment with
blink-style worklet, e.g. utilize WorkerThread/WorkletGlobalScope/
etc. This requires moving relevant mojom files to blink, so that
they are accessible from the new global_scope file (doesn't exist
just yet).

Design doc:
https://docs.google.com/document/d/1swL8GedhL7UJ-aKam8seGfmSYWLgJQSK8I8AdFBWTJo
Discussion thread: https://groups.google.com/a/chromium.org/g/platform-architecture-dev/c/E-wUhAi0Zz0

Bug: 1414951
Change-Id: I40bddefec08d401f14c3ccadffabaa14ea7a247e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4241206
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Dominic Farolino <dom@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Yao Xiao <yaoxia@chromium.org>
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1110813}
2023-02-28 08:19:22 +00:00
Nan Lin
284f6fa95c Refactor Attribution Reporting OS support routing
This is a follow up for crrev.com/c/4048260. As the Android API to get
the flag is synchronous, the flag can be obtained once and cached in
`AttributionOsLevelManagerAndroid` for later use. The renderer can be
initialized with the flag directly and there's no need to update the
existing renderers as we don't listen to the flag changes.

Note that the flag can only change when the user changes the setting
on the device and should be "static" for most part.

Bug: 1417278
Change-Id: I2ab954a2f9dcc5de043cc0a14d7cbaea9160b2e6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4284643
Commit-Queue: Nan Lin <linnan@chromium.org>
Reviewed-by: Andrew Paseltiner <apaseltiner@chromium.org>
Reviewed-by: Garrett Tanzer <gtanzer@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Joe Mason <joenotcharles@google.com>
Reviewed-by: Matt Menke <mmenke@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1109683}
2023-02-24 18:40:51 +00:00
Tsuyoshi Horo
e4698c759a [Extensions] Use blink::URLLoaderThrottle for CSS localization
Currently ExtensionLocalizationPeer is used to replace localization
templates in CSS files with the appropriate localized strings for
extensions [1].

ExtensionLocalizationPeer was introduced 13 years ago [2], and it is
using a mechanism of blink::WebRequestPeer to intercept and replace the
content body.

This mechanism of blink::WebRequestPeer is used only by
ExtensionLocalizationPeer now. And we can replace the content body using
the more widely used mechanism of blink::URLLoaderThrottle.

This CL introduces a new blink::URLLoaderThrottle named
ExtensionLocalizationThrottle, and replaces ExtensionLocalizationPeer
with it. This CL also removes the WebResourceRequestSenderDelegate which
is used only for ExtensionLocalizationPeer.

[1] https://developer.chrome.com/docs/extensions/reference/i18n/
[2] https://codereview.chromium.org/570007

Bug: 1417066, 1413912
Change-Id: I19b97bd745875f24f943d7cd9f93171de8ef627d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4257812
Reviewed-by: Tommy Nyquist <nyquist@chromium.org>
Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: David Bertoni <dbertoni@chromium.org>
Commit-Queue: Tsuyoshi Horo <horo@chromium.org>
Reviewed-by: Kenichi Ishibashi <bashi@chromium.org>
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1109362}
2023-02-24 00:49:46 +00:00
Takashi Sakamoto
9f5e41017d Make each render process provide its private memory footprint for browser process.
Because of the "hidepid=2" mount option for /proc on Android,
browser process cannot open /proc/{render process pid}/maps and
status, i.e. no such file or directory.
So add PrivateMemoryFootprintProvider, which uses MemoryUsageMonitor,
to third_party/blink/renderer/controller and provides the calculated
private memory footprint for browser process by using render_host.mojom.

Bug: 1393283

Change-Id: Ibb00262afc2ed0552e3f0c2ec5fb7449878b93c9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4124620
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Takashi Sakamoto <tasak@google.com>
Cr-Commit-Position: refs/heads/main@{#1096563}
2023-01-25 01:54:28 +00:00
Guocheng Wei
ab366b4a0b Reland "[fuchsia] Surfacing hardware decoder capabilities in GPU factories"
This is a reland of commit cbf66397e1

fuchsia dbg bots failed due to a linker issue. The fix is to add
export_class_attribute, export_define, and export_header params
in the fuchsia_media mojom target to include the dependency and avoid
possible runtime linker error.

Original change's description:
> [fuchsia] Surfacing hardware decoder capabilities in GPU factories
>
> Created CodecFactory to assist GpuVideoAcceleratorFactoriesImpl on
> hardware decoder and encoder functionalities. Its derived classes has
> different implementation to connect to hardware decoder resources.
>
> CodecFactoryFuchsia uses media::mojom::FuchsiaMediaCodecProvider to
> get the supported decoder configs and create a video decoder.
>
> Unit tests are added for GpuVideoAcceleratorFactoriesImpl.
>
> Bug: 1198266, 1207991, 1368710, 1134719
> Change-Id: I2babc333181c2a53e5aa85125d9d628d401f055d
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3936347
> Reviewed-by: Bryant Chandler <bryantchandler@chromium.org>
> Reviewed-by: Peng Huang <penghuang@chromium.org>
> Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
> Reviewed-by: Daniel Cheng <dcheng@chromium.org>
> Commit-Queue: Guocheng Wei <guochengwei@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1086434}

Bug: 1198266, 1207991, 1368710, 1134719
Change-Id: I66cacee1b0f0bf05494d57b6d8abe4f36666cc06
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4122748
Reviewed-by: Peng Huang <penghuang@chromium.org>
Reviewed-by: Bryant Chandler <bryantchandler@chromium.org>
Commit-Queue: Guocheng Wei <guochengwei@chromium.org>
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1089444}
2023-01-05 21:19:54 +00:00
Nicolas Ouellet-Payeur
9cef20b762 Revert "[fuchsia] Surfacing hardware decoder capabilities in GPU factories"
This reverts commit cbf66397e1.

Reason for revert: tree closure fuchsia-x64-dbg

Original change's description:
> [fuchsia] Surfacing hardware decoder capabilities in GPU factories
>
> Created CodecFactory to assist GpuVideoAcceleratorFactoriesImpl on
> hardware decoder and encoder functionalities. Its derived classes has
> different implementation to connect to hardware decoder resources.
>
> CodecFactoryFuchsia uses media::mojom::FuchsiaMediaCodecProvider to
> get the supported decoder configs and create a video decoder.
>
> Unit tests are added for GpuVideoAcceleratorFactoriesImpl.
>
> Bug: 1198266, 1207991, 1368710, 1134719
> Change-Id: I2babc333181c2a53e5aa85125d9d628d401f055d
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3936347
> Reviewed-by: Bryant Chandler <bryantchandler@chromium.org>
> Reviewed-by: Peng Huang <penghuang@chromium.org>
> Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
> Reviewed-by: Daniel Cheng <dcheng@chromium.org>
> Commit-Queue: Guocheng Wei <guochengwei@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1086434}

Bug: 1198266, 1207991, 1368710, 1134719
Change-Id: I2a1a3163bbd6926ca2bc40d51925e5c116389f80
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4121999
Commit-Queue: Nicolas Ouellet-Payeur <nicolaso@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Nicolas Ouellet-Payeur <nicolaso@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1086492}
2022-12-22 20:22:37 +00:00