0
Commit Graph

781 Commits

Author SHA1 Message Date
Michael Wilson
dfe2041bbd Clean up minor inconsistencies with WebAudioDevice
The following is done:
- Make WebAudioDevice a pure virtual interface base class
- Move initialization code out of
  RendererBlinkPlatformImpl::CreateAudioDevice() and into
  RendererWebAudioDeviceImpl::Create()

These changes will make RendererWebAudioDeviceImpl easier to
understand and work with.

This should cause no functional change.

Change-Id: Ia2885f56711037e7e63e06e0617eccab02936ef4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5507060
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Michael Wilson <mjwilson@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1295423}
2024-05-02 13:39:10 +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
Alison Gale
923a33e9d5 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: Ib028de8bb63c99e5a81d90e24e422cf88061ad05
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5469583
Owners-Override: Alison Gale <agale@chromium.org>
Reviewed-by: Darryl James <dljames@chromium.org>
Commit-Queue: Alison Gale <agale@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1290952}
2024-04-22 23:34:28 +00:00
Alison Gale
81f4f2c793 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: Iee14d10d544e9f0ec046117cc4ec8a55c427adc0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5469947
Reviewed-by: Darryl James <dljames@chromium.org>
Owners-Override: Alison Gale <agale@chromium.org>
Commit-Queue: Alison Gale <agale@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1290838}
2024-04-22 19:33:31 +00:00
Olga Sharonova
bf7a6d79e8 Revert "Remove resampler from AudioDestination"
This reverts commit ac42aafa79.

Conflicts resolved:

* content/renderer/media/renderer_webaudiodevice_impl.cc
* third_party/blink/renderer/platform/audio/audio_destination.cc

The rest is a clean revert.

Details: see https://docs.google.com/document/d/11fJRBGFQy00zH391ARfeiyIw193ej0yDqt-f-0Y1k1s/r/0-FFZnnH-ca0Bf8JFLomtnCw/edit?tab=t.0

Bug: 331836623
Change-Id: I3312436464447b6312c9cb1f3f6fd12d36c61308
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5424641
Commit-Queue: Michael Wilson <mjwilson@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Hongchan Choi <hongchan@chromium.org>
Reviewed-by: Michael Wilson <mjwilson@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1283434}
2024-04-05 22:33:28 +00:00
Joshua Pius
12dde4dd44 Introduce finch feature flags for toggling HW Decoding and Encoding
Convert kDisableWebRtcHWDecoding and kDisableWebRtcHWEncoding from
switch flags to s/finch/feature flags.

Hardcode WebEngine to disable HW decode acceleration for WebRTC.

Bug:b/324886757,b/326282208

Change-Id: Ic341dcfcc385ee1eb2306b99738382213d2cc595
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5310457
Commit-Queue: Joshua Pius <joshuapius@google.com>
Reviewed-by: Theresa Sullivan <twellington@chromium.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1265380}
2024-02-26 19:53:43 +00:00
Olga Sharonova
ac42aafa79 Remove resampler from AudioDestination
This CL removes the resampling function from
AudioDestination and make the WebAudio use the underlying
resampler in the audio infra.

Bug: 1503735
Change-Id: Ie79fa7e177e52e543a23ceb7c8f9010f37c9eba8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5241060
Reviewed-by: Hongchan Choi <hongchan@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Michael Wilson <mjwilson@chromium.org>
Commit-Queue: Olga Sharonova <olka@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1258424}
2024-02-09 10:17:44 +00:00
Lei Zhang
0b228c21d0 Use CHECK_IS_TEST() in content::RendererBlinkPlatformImpl
Replace comments that claim content::RenderThreadImpl::current() only
returns nullptr in tests with checks that validate the claim.

Change-Id: I085b2409e6fdb655c1b372e26eb44b3d4e47f5a9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5247320
Reviewed-by: Stefan Zager <szager@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1254096}
2024-01-30 19:24:42 +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
Tsuyoshi Horo
2455e70001 Use network::ResourceRequest instead of WebURLRequest in ResourceFetcher
blink::WebURLRequest is used for the argument of
URLLoaderThrottleProvider::CreateThrottles() method after [1]. But we
are planing to call this method from the background thread where we
don't use blink::WebURLRequest [2]. Also we are planing to deprecate
blink::WebURLRequest, and planing to use network::ResourceRequest
instead [3].

So this CL changes the argument type of CreateThrottles() from
blink::WebURLRequest to network::ResourceRequest.
A network::ResourceRequest is created in ResourceLoader::Start(). So we
pass the reference of the structure through ResourceFetcher::
CreateURLLoader().

In frames:
  ResourceLoader::Start()
  -> ResourceFetcher::CreateURLLoader()
    -> LoaderFactoryForFrame::CreateURLLoader()
    |-> URLLoaderThrottleProvider::CreateThrottles()
    |-> ServiceWorkerNetworkProviderForFrame::
    |     GetSubresourceLoaderFactory()
    |-> URLLoaderFactory::CreateURLLoader()

In workers:
  ResourceLoader::Start()
  -> ResourceFetcher::CreateURLLoader()
    -> LoaderFactoryForWorker::CreateURLLoader()
    |-> WebWorkerFetchContext::CreateThrottles()
    | -> WebServiceWorkerFetchContextImpl::CreateThrottles() or
    |    DedicatedOrSharedWorkerFetchContextImpl::CreateThrottles()
    |  -> URLLoaderThrottleProvider::CreateThrottles()
    |-> URLLoaderFactory::CreateURLLoader()

mojom::blink::RequestContextType in blink::WebURLRequest is checked in
the code path. But this type member is not in network::ResourceRequest.
network::ResourceRequest has a network::mojom::RequestDestination
member. And some of these checks of mojom::blink::RequestContextType can
be safely converted to network::mojom::RequestDestination without any
behavior change. But the check in ResourceFetcher::CreateURLLoader()
needs the mojom::blink::RequestContextType. Also we need to pass
`service_worker_race_network_request_token` to
LoaderFactoryForWorker::CreateURLLoader(), and
`is_from_origin_dirty_style_sheet` flag to
ServiceWorkerNetworkProviderForFrame::GetSubresourceLoaderFactory().
So this CL adds these three arguments to CreateURLLoader() methods.

[1]: https://crrev.com/c/994152
[2]: https://crrev.com/c/5113665
[3]: https://groups.google.com/a/chromium.org/forum/#!topic/platform-architecture-dev/ntSzerId4gw

Bug: 1379780
Change-Id: I6e0a987d779b1fb428a4b27b813b3f53f2d1d781
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5121813
Reviewed-by: Erik Chen <erikchen@chromium.org>
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Reviewed-by: Sean Topping <seantopping@chromium.org>
Reviewed-by: Richard (Torne) Coles <torne@chromium.org>
Commit-Queue: Tsuyoshi Horo <horo@chromium.org>
Reviewed-by: David Song <wintermelons@google.com>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Devlin Cronin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1245656}
2024-01-11 01:58:45 +00:00
Dibyajyoti Pal
0ddc941b4c [Code Health Rotation] Spanification of VisitedHashLink
This CL converts the const char* canonical_url and its size into a
std::string_view throughout the stack, from the blink/ layer all the
way up to chrome/ and components/.

This change should be a no-op, since it just changes the way data
is sent through the stack instead of making any logic changes.

More context on Spanification: https://docs.google.com/document/d/1rV6zYT5l5oUeCcF149eTjIG3E4ukecvoUQpiMtB3wk0/edit?resourcekey=0-sHZDaXR51dCRy-3XiTbiGg&tab=t.0

Bug: 1490484
Change-Id: Iaed5ae06bf4bb95202c015af5af14a4f397967ab
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5169058
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Nate Fischer <ntfschr@chromium.org>
Commit-Queue: Dibyajyoti Pal <dibyapal@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1244847}
2024-01-09 20:36:34 +00:00
Dave Tapuska
3a7845d552 Set background state of isolate on creation
When a main thread isolate is created ask the platform whether it should
start in the background state or not. Extension processes always start
in the background state to conserve memory.

Bug: 263412
Change-Id: Ieb7e2c8854dc0de63f580ea53f61bfa5cda72514
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5078440
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1233413}
2023-12-05 17:20:49 +00:00
Joone Hur
e6f4248690 WebGPU: Establish the GpuChannel asynchronously
Since WebGPU RequestAdapter works asynchronously, we use
EstablishGpuChannel() instead of EstablishGpuChannelSync()
to avoid blocking the main thread.

Bug: 1333560
Change-Id: I88b9aa558fc89bb390546fe034a6c4c8c4f2350a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5041936
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Joone Hur <joone@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1229760}
2023-11-28 06:35:34 +00:00
kylechar
1ba1540909 Remove duplicate ContextProviderCommandBuffer params
There is a constructor param and ContextCreationAttrib that both
specified if GrContext should be created. Remove the constructor param
and just use the existing ContextCreationAttrib everywhere.

Fixed: 1498606
Change-Id: I1a1804435df5e70d0fe5a77074b54a7d3d872b81
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4998546
Reviewed-by: Henrik Boström <hbos@chromium.org>
Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org>
Reviewed-by: Luke Halliwell <halliwell@chromium.org>
Commit-Queue: Kyle Charbonneau <kylechar@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Vasiliy Telezhnikov <vasilyt@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1222517}
2023-11-09 20:57:52 +00:00
Zhenyao Mo
1a56241fc5 Collect WebGL's ANGLE implementation histogram.
It's recorded at each WebGL context's first draw call time. Enums
are distinguished between WebGL1 and WebGL2.

This is an effort to evaluate if we retire D3D9, how many users will
be impacted.

TEST=manual,about:histograms

R=kbr@chromium.org

Bug: 1499059
Change-Id: I09e7ab125d4d2782e420393f5696b46914c89cd1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5002609
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Commit-Queue: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Luc Nguyen <lucnguyen@google.com>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1219826}
2023-11-04 00:36: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
Takashi Sakamoto
c341cbe9ef Add UserLevelMemoryPressureSignalOn3GbDevices feature.
Assigned temporal values to the 3Gb feature parameters.
The parameters will be updated after running its finch
experiment.
Also added base::SysInfo::IsAndroidXGbDevice() based
on ram_targeting and replaced
UserLevelMemoryPressureGenerator to use the methods.

Bug: 1393283
Change-Id: Iaeb74c3604cb07f94db02231b761fd95eca16db6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4875407
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Bartek Nowierski <bartekn@chromium.org>
Commit-Queue: Takashi Sakamoto <tasak@google.com>
Cr-Commit-Position: refs/heads/main@{#1208100}
2023-10-11 06:55:22 +00:00
Zelin Liu
1d4f507934 iwa: Allow IWA to register non-HTTP scheme Protocol Handler
Protocol Handler specifies that only URLs with HTTP/HTTPS schemes are
allowed to be registered as Protocol handlers. However non-web URLs like
chrome-extension:// and isolated-app:// should be an exception to this.
This CL creates a new ProtocolHandlerSecurityLevel kSameOrigin that
allows the registration of protocol handler URL of non-HTTP(S) scheme
(while still within the same origin as the requesting frame). Currently,
only "isolated-app" schemed URLs are granted this security level.

Bug: 1484037
Change-Id: I94f87b065f45c2d1a6dbeb5484e32c4f52f71761
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4872957
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Zelin Liu <zelin@chromium.org>
Reviewed-by: Gyuyoung Kim <gyuyoung@igalia.com>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Reviewed-by: Mike West <mkwst@chromium.org>
Reviewed-by: Robbie McElrath <rmcelrath@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1207201}
2023-10-09 19:17:52 +00:00
Jonah Ryan-Davis
1775f61e46 Revert "Move GPU-specific info from GPUInfo to GPUDevice"
This reverts the following 2 commits:

"Move GPU-specific info from GPUInfo to GPUDevice"
6a3835f66f.

"Check before dereferencing gl_display pointer in gpu_init."
05866e799a

The third problem commit was reverted separately here:
https://chromium-review.googlesource.com/c/chromium/src/+/4917480

Due to use-after-free issues.

Bug: chromium:1488341, 1418417, 1487795, 1488796
Change-Id: Ifc84b23e737920bcccbe59f34e756f2ec7f20210
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4915526
Reviewed-by: Brian Sheedy <bsheedy@chromium.org>
Owners-Override: Prudhvikumar Bommana <pbommana@google.com>
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Joe Downing <joedow@chromium.org>
Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com>
Commit-Queue: Kenneth Russell <kbr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1206679}
2023-10-06 22:37:34 +00:00
Matthew Denton
939dcb3ec0 Linux/Cros: Move SetThreadType off of RenderMessageFilter
Thread priorities cannot be correctly changed in any sandboxed process,
but currently this operation is only proxied out of renderers. This
moves SetThreadType off of RenderMessageFilter and into a separate
content::mojom::ThreadTypeSwitcher mojo interface so this interface can
be reused for other sandboxed processes, not just renderers.

The new content::mojom::ThreadTypeSwitcher is bound by
ChildProcessHost::BindHostReceiver() like many other per-process
interfaces are. The browser-side implementation runs directly on the
IO thread since all it does it dispatch the work to another thread.

RendererThreadTypeHandler (which proxies calls to
PlatformThread::SetCurrentThreadType out of the renderer process)
is renamed to SandboxedProcessThreadTypeHandler and moved to
content/child.

Change-Id: Id59c4ad0d4db2321dad994c702f6f2527aff5310
Bug: 1317590
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4898004
Reviewed-by: Francois Pierre Doray <fdoray@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Matthew Denton <mpdenton@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1205519}
2023-10-04 22:40:46 +00:00
Tsuyoshi Horo
abfcf3b3e2 Remove blink::WebCodeCacheLoader
This class is not exposed to content after https://crrev.com/c/2772986.
Also this class is a very thin wrapper of blink::CodeCacheHost after
https://crrev.com/c/3688418. We should remove it to reduce the code
complexity.

Bug: 1379780
Change-Id: Ie2718f7744a5d004ca54eff27d5f60f2f9ac282b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4905143
Auto-Submit: Tsuyoshi Horo <horo@chromium.org>
Commit-Queue: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1203276}
2023-09-29 15:24:49 +00:00
Jonah Ryan-Davis
6a3835f66f Move GPU-specific info from GPUInfo to GPUDevice
Any information queried from a specific GPU through GL calls should
live in the GPUDevice it was queried from. Later, this will be used
to display info about all GPUs on the system.

Bug: 1418417
Change-Id: I8b55ab264676feb7b335d7f1c1f46968f1f55923
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4718527
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com>
Reviewed-by: Joe Mason <joenotcharles@google.com>
Reviewed-by: Brian Sheedy <bsheedy@chromium.org>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Eric Seckler <eseckler@chromium.org>
Reviewed-by: Richard (Torne) Coles <torne@chromium.org>
Reviewed-by: Joe Downing <joedow@chromium.org>
Reviewed-by: Colin Blundell <blundell@chromium.org>
Commit-Queue: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1202318}
2023-09-28 05:04:37 +00:00
Takashi Nakayama
3e087f2eed Rename component::EmbeddedWorkerStatus.
This CL carries out a migration from component::EmbeddedWorkerStatus to blink::. All files using EmbeddedWorkerStatus are subject to change.
This CL also changes naming style of constants included, from MACRO style to kConstant style.

See https://bugs.chromium.org/p/chromium/issues/detail?id=1465754 for details.

Bug: 1465754
Change-Id: I7bae5df0e247cb5fad0d9119576fce46669f0749
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4865879
Commit-Queue: Takashi Nakayama <tnak@chromium.org>
Reviewed-by: Yoshisato Yanagisawa <yyanagisawa@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1196953}
2023-09-15 02:52:10 +00:00
Sunny Sachanandani
c40deffcde gpu: Make ContextProviderCommandBuffer delete on bound sequence
ContextProviderCommandBuffer has a hidden requirement that it should be
destroyed on the same sequence that it's bound to due to non-thread-safe
mojo::AssociatedReceiver<mojom::CommandBufferClient> client_receiver_ in
CommandBufferProxyImpl. This is true with or without locking enabled.

Make ContextProviderCommandBuffer delete on its bound sequence. It's not
possible to use RefCountedDeleteOnSequence for this since it requires
the task runner to be set at construction whereas we do it later via
BindToCurrentSequence.

Also includes minor cleanup in ContextProviderCommandBuffer sequence
checker, dchecks, etc. and makes it start from one ref count, fixing
call sites that use operator new instead of base::MakeRefCounted.

Bug: 1481757
Change-Id: I50c3fd5bab496ad54c1d850c71b70a52ace3b9aa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4860505
Auto-Submit: Sunny Sachanandani <sunnyps@chromium.org>
Commit-Queue: Sunny Sachanandani <sunnyps@chromium.org>
Reviewed-by: Vasiliy Telezhnikov <vasilyt@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Commit-Queue: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1196230}
2023-09-13 20:46:54 +00:00
Yoshisato Yanagisawa
882ed29c08 Fix SW static routing API running status condition.
In the past implementation, we used the cached value for the running
status when it is asked inside the ServiceWorkerSubresourceLoader.
It is a bit stale value and the caller may get too old value to use.
This CL makes the value updated on ServiceWorkerVersion's running status
change to avoid such mismatch as much as possible.  For that purpose,
when the ServiceWorker static routing rules have rules with
running status condition, a mojo IPC receiver is created and passed
to the controller ServiceWorker connector to make the connector to be
the receiver of the running status.

We also fixed the test.  The test expects the ServiceWorker has been
stopped.  However, after `ReloadBlockUntilNavigationsComplete` is
called, the ServiceWorker awakes, and we need to explicitly stop it
to make the test work.

Bug: 1371756
Change-Id: I9ed5a6530c4fe33789fe794019e63d25c600d4bf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4853777
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Reviewed-by: Minoru Chikamune <chikamune@chromium.org>
Commit-Queue: Yoshisato Yanagisawa <yyanagisawa@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Shunya Shishido <sisidovski@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1195735}
2023-09-13 00:32:32 +00:00
Takashi Sakamoto
6b38d9a5b5 Make UserLevelMemoryPressureSignalGenerator not use command-line
UserLevelMemoryPressureSignalGenerator uses command-line and
the browser process provides its parameters for renderer processes,
but if the carveout of physical memory doesn't change, each
renderer process can look up the feature's parameter.
This change also fixes wrong component dependency.

Bug: 1393283
Change-Id: Ifcc531e1390818dbf08396bdb22a93b7f8d957dd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4821106
Commit-Queue: Takashi Sakamoto <tasak@google.com>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1192368}
2023-09-05 10:58:06 +00:00
Yoshisato Yanagisawa
5073c658f8 Plumbling cache_storage access to SW subresource loader.
This is a part of making the cache storage API accessible from the
ServiceWorkerSubresourceLoader upon the static routing API rule
(https://github.com/yoshisatoyanagisawa/service-worker-static-routing-api).

This CL makes a connection to the cache storage, and makes it available
in the subresource loader.

Bug: 1371756
Change-Id: If3c617872896e96dbaa7771eb56cdaabfc163d8a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4825803
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Reviewed-by: Shunya Shishido <sisidovski@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Yoshisato Yanagisawa <yyanagisawa@chromium.org>
Reviewed-by: Minoru Chikamune <chikamune@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1192268}
2023-09-05 05:07:49 +00:00
Shubham Gupta
6726d9fed1 Remove GpuMemoryBufferManager from ContextProviderCommandBuffer.
ContextProviderCommandBuffer doesn't use GpuMemoryBufferManager anymore

Bug: 1476945
Change-Id: I022228cfa829a0618e11e9737c0dcdb14e8f4ecd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4823223
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Shubham Gupta <shubh.gupta@samsung.com>
Reviewed-by: Vasiliy Telezhnikov <vasilyt@chromium.org>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1190153}
2023-08-30 16:06:33 +00:00
Rahul Yadav
35bdb2d7eb Convert AudioLatency::LatencyType enum to enum class
Bug: 1101837
Change-Id: If43c599139f43d05e0b641019f25fd44e9df5eb2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4745500
Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Olga Sharonova <olka@chromium.org>
Reviewed-by: Xiaohan Wang <xhwang@chromium.org>
Commit-Queue: Takashi Toyoshima <toyoshim@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1181341}
2023-08-09 07:09:46 +00:00
Yoshisato Yanagisawa
3ce36bacc6 Make recent SW running status visible in SW subresource loader.
This is a part of implementation to support
RouterRunningStatusCondition written in:
https://github.com/yoshisatoyanagisawa/service-worker-static-routing-api/blob/main/final-form.md

To allow the router evaluator to use the ServiceWorker running
status as a condition, this CL makes the
ServiceWorkerSubresourceLoader to have a recent ServiceWorker
running status.  To allow it to access the recent status,
there is an IPC to ask ServiceWorkerContainerHost to tell the
status.

Change-Id: I09941a8e9648f8097a285856f2df1d11e4732c5d
Bug: 1371756
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4680729
Commit-Queue: Yoshisato Yanagisawa <yyanagisawa@chromium.org>
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Reviewed-by: Shunya Shishido <sisidovski@chromium.org>
Reviewed-by: Minoru Chikamune <chikamune@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1171597}
2023-07-18 06:25:57 +00:00
Lei Zhang
c92c539c1b Only include Android headers on Android for //chrome and //content
Make various includes platform-specific.

Bug: 1302780
Change-Id: Ia295bb71f3b042a889b213b6596d3f9e47702fda
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4655257
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1163963}
2023-06-29 06:01:25 +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
Vasiliy Telezhnikov
a82fbde966 Cleanup ContextCreationAttribs
Bunch of attributes are not used anymore:
* buffer_preserved is not read, nothing sets it to not default value
* single_buffer nothing sets it to not default value
* samples/sample_buffers/stencil_size/depth_size are default inited to
  -1 and only overridden to 0. Command decoders check if they are > 0,
  so that code is never reached.
* gpu::Capabilities::num_stencil_bits is not used.
* red/green/blue_bits are used only on android [1] and alpha_size is
  set to only on android.

This CL removes unused attributes and code that sets it in the client.
Immediate affected code from GLES2 decoders is also removed, to make
this compile, but extensive cleanup will be done in follow-up.

Color attributes are not really needed on Android either, but it's not
trivial clean up, so for now put them under BUILDFLAG(IS_ANDROID).

[1] https://source.chromium.org/chromium/chromium/src/+/refs/heads/main:gpu/ipc/service/gles2_command_buffer_stub.cc;l=140-144;drc=b8a0323a84f483b25e94b3a24d80fda16c5dd1ae;bpv=0;bpt=1

Bug: 1445523
Change-Id: Icc4d63922eff5b2b4702692316ac3ab3c21bd4aa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4582013
Commit-Queue: Vasiliy Telezhnikov <vasilyt@chromium.org>
Reviewed-by: Justin Novosad <junov@chromium.org>
Reviewed-by: Colin Blundell <blundell@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Reviewed-by: Bo Liu <boliu@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1154072}
2023-06-06 21:11:39 +00:00
Yoshisato Yanagisawa
4fb4ce18e6 Pass ServiceWorkerRouterRules to renderer.
To evalaute the ServiceWorkerRouterRules in the renderer during the
subresource loading, ServiceWorkerRouterRules are passed to the
renderer.

Bug: 1371756
Change-Id: I21d48b894c214f5c69fd1b695b697583ef9e1502
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4574238
Reviewed-by: Minoru Chikamune <chikamune@chromium.org>
Commit-Queue: Yoshisato Yanagisawa <yyanagisawa@chromium.org>
Reviewed-by: Shunya Shishido <sisidovski@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1153637}
2023-06-06 02:25:56 +00:00
sisidovski
a9978ebaef Remove unnecessary param in CreateServiceWorkerSubresourceLoaderFactory
This is a refactoring CL that removes
`blink::mojom::ServiceWorkerFetchHandlerBypassOption
fetch_handler_bypass_option` from
CreateServiceWorkerSubresourceLoaderFactory. The param was introduced in
the previous CL [1], but it was unnecessary plumbing, we can pass
`mojom::blink::ServiceWorkerFetchHandlerBypassOption::kDefault` directly
to ControllerServiceWorkerConnector in
RendererBlinkPlatformImpl::CreateServiceWorkerSubresourceLoaderFactory.

[1] crrev.com/c/4451966

Bug: 1420517
Change-Id: Ifd4d3867b2b0c7f0e00d27b342255287b0a1c017
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4573500
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Shunya Shishido <sisidovski@chromium.org>
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1152364}
2023-06-02 05:29:33 +00:00
Daniel Cheng
ea8701b96a Migrate HTMLCanvasElement from TopDocument() to GetDocument().
The URL is just used for annotation purposes; there's no need to use
TopDocument() here, which is misleading in cross-process iframes, since
it returns the Document of the local root instead. Several other places
already pass the document URL instead of the "top" document URL, so this
brings <canvas> more in line with the other uses anyway.

Also rename the various parameters and places it's plumbed through to
remove "top" from the name.

Bug: 617677
Change-Id: I6e605f1fd16001a6cfdeda83cd80e514d1cbdc45
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4545273
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1146207}
2023-05-18 21:53:49 +00:00
Philipp Hancke
e1f3a37a0b flags: remove enable-webrtc-srtp-aes-gcm
which has been enabled by default for a year.

BUG=chromium:1129148,chromium:713701

Change-Id: I24423f68ef01fa2610e4c95751b7a7b73cd04516
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2693566
Reviewed-by: Florent Castelli <orphis@chromium.org>
Commit-Queue: Florent Castelli <orphis@chromium.org>
Reviewed-by: Harald Alvestrand <hta@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1145033}
2023-05-17 00:54:41 +00:00
Vasiliy Telezhnikov
0c06b2edd6 Remove own offscreen surface support
Code isn't working properly and wasn't used for quite some time.
Everything is using SharedImages now as a backbuffer.

Bug: 1445523
Change-Id: Iad652e92ac0f615f469d80bbc808618dfabd57f4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4533135
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Vasiliy Telezhnikov <vasilyt@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1144482}
2023-05-16 00:20:09 +00:00
Takashi Sakamoto
81190c81ea Add switch::kUserLevelMemoryPressureSignalParams to command line for UserLevelMemoryPressureSignalGenerator feature.
Replace IsFeatureEnabledWithoutActivation() with the command line flag,
and before launching renderer processes, add the command line flag to
provide the feature's parameters for the renderer process if
UserLevelMemoryPressureSignalGenerator is enabled.

Bug: 1393283
Change-Id: I1a08c7356619e1793b18d967535283148c53b60d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4455591
Reviewed-by: Alexei Svitkine <asvitkine@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Bartek Nowierski <bartekn@chromium.org>
Code-Coverage: Findit <findit-for-me@appspot.gserviceaccount.com>
Commit-Queue: Takashi Sakamoto <tasak@google.com>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1135647}
2023-04-26 00:29:03 +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
sisidovski
f13aca04b6 [BestEffortServiceWorker] Use OriginTrial token to enable the feature
This CL enables ServiceWorkerBypassFetchHandler with the
`all_with_race_network_request` option (aka BestEffortServiceWorker) via
OriginTrial token.

We add the new option named
`ServiceWorkerFetchHandlerBypassOption::kRaceNetworkRequest` to
ServiceWorkerFetchHandlerBypassOption mojom, so that we can pass the
info that the loader should trigger RaceNetworkRequest from browser
to renderer. Once ServiceWorkerMainResourceLoader confirmed there is a
valid OriginTrial token, set
`ServiceWorkerFetchHandlerBypassOption::kRaceNetworkRequest`. Then
ServiceWorkerSubresourceLoader which is on a renderer side lookup
fetch_handler_bypass_option and dispatch RaceNetworkRequest.

Change-Id: I6d22bbcaee96e80d0e93b4f665e3d326d0c1ac71
Bug: 1420517
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4451966
Commit-Queue: Shunya Shishido <sisidovski@chromium.org>
Reviewed-by: Sam McNally <sammc@chromium.org>
Reviewed-by: Minoru Chikamune <chikamune@chromium.org>
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Reviewed-by: Yoshisato Yanagisawa <yyanagisawa@chromium.org>
Code-Coverage: Findit <findit-for-me@appspot.gserviceaccount.com>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1133597}
2023-04-21 04:14:23 +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
Claudio DeSouza
c379100105 Replace base::GUID uses with base::Uuid (105/N)
`base::GUID` has been renamed, and is set to be  removed. This CL is
part of a batch of changes replacing all uses of `base::GUID`, with
`base::Uuid`, and its associated counterparts.

Additionally, deprecated functions in `base/uuid.h` are also also having
their uses removed wherever they occur.

Changes for path: /content/renderer

This CL was uploaded by git cl split.

R=danakj@chromium.org

Bug: 1428566
Change-Id: Id854dd7204a52886a953a97b855fd6ee8cee0290
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4430411
Reviewed-by: danakj <danakj@chromium.org>
Commit-Queue: danakj <danakj@chromium.org>
Auto-Submit: Claudio DeSouza <cdesouza@igalia.com>
Cr-Commit-Position: refs/heads/main@{#1131206}
2023-04-17 14:21:31 +00:00
Ben Wagner
c6b58b2efb Remove font_loader_ fields
These fields are never used after they are set. While they extend the
lifetime of the font loader there is no reason for them to do so.

Change-Id: I6382f3f2ae66b8aecce882f1ee2c11b26935ac24
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4424010
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: Ben Wagner <bungeman@chromium.org>
Code-Coverage: Findit <findit-for-me@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#1130855}
2023-04-15 15:53:01 +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
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
Tsuyoshi Horo
3084165ea6 Stop creating WebURLLoaderFactory in content/
This CL does the following:
 1. Delete Platform::WrapURLLoaderFactory() method.

 2. Make RenderThreadImpl::InitializeRenderer() call a new
    blink::SetCorsExemptHeaderList() method which calls
    blink::LoaderFactoryForFrame::SetCorsExemptHeaderList().

 3. blink::LoaderFactoryForFrame::CreateURLLoader() and
    PrefetchedSignedExchangeManager will create a WebURLLoaderFactory
    using a new blink::LoaderFactoryForFrame::GetCorsExemptHeaderList()
    method.

Bug: 1413912
Change-Id: I6a37e355ee5779878ad3b086b079a04e6f9ab64b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4236209
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Commit-Queue: Tsuyoshi Horo <horo@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1104452}
2023-02-13 13:17:28 +00:00
Tsuyoshi Horo
31b2820c0b Stop creating WebURLLoader in content/
content::RenderFrameImpl::FrameURLLoaderFactory creates a WebURLLoader.

FrameURLLoaderFactory is a subcrass of blink::WebURLLoaderFactory.
It is created by RenderFrameImpl::CreateURLLoaderFactory() and passed to
blink::LoaderFactoryForFrame::CreateURLLoader().

  blink::LoaderFactoryForFrame::CreateURLLoader()
    ->blink::LocalFrame::GetURLLoaderFactory()
      ->blink::LocalFrameClient::CreateURLLoaderFactory()
        blink::LocalFrameClientImpl::CreateURLLoaderFactory()
        ->blink::WebLocalFrameClient::CreateURLLoaderFactory()
          content::RenderFrameImpl::CreateURLLoaderFactory()

blink::LoaderFactoryForFrame::CreateURLLoader() is creating a
blink::WebURLLoader using the FrameURLLoaderFactory.

This CL changes blink::LoaderFactoryForFrame::CreateURLLoader() to get a
network::SharedURLLoaderFactory from the RenderFrameImpl. And creates a
blink::WebURLLoader using Platform::WrapURLLoaderFactory().

This CL also introduces CreateURLLoaderForTesting() method in
blink::LocalFrameClient and blink::WebLocalFrameClient which returns a
mocked WebURLLoader for testing inside Blink.

content::RenderViewTest::CreateFakeURLLoaderFactory() will set a fake
network::SharedURLLoaderFactory to RenderFrameImpl instead of setting a
fake WebURLLoaderFactory. So we will not need to create a WebURLLoader
in the content layer.

Low-Coverage-Reason: Refactoring

Bug: 1413912
Change-Id: I5683a12835d7651ddce65e2246edcb57e31658a2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4234680
Reviewed-by: Christian Dullweber <dullweber@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Commit-Queue: Tsuyoshi Horo <horo@chromium.org>
Reviewed-by: Rebekah Potter <rbpotter@chromium.org>
Reviewed-by: David Roger <droger@chromium.org>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1103839}
2023-02-10 14:41:40 +00:00
Tsuyoshi Horo
7d8d2cca51 Stop creating WebURLLoader in ServiceWorkerNetworkProviderForFrame
Currently ServiceWorkerNetworkProviderForFrame::CreateURLLoader() in the
content layer is called to create a WebURLLoader from
blink::LoaderFactoryForFrame::CreateURLLoader().

We'd like to stop exposing blink::WebURLLoader to the content layer.

So this CL does the followings:
 - Replace ServiceWorkerNetworkProviderForFrame::CreateURLLoader() with
   GetSubresourceLoaderFactory() which returns a
   network::SharedURLLoaderFactory.
 - Make blink::LoaderFactoryForFrame::CreateURLLoader() call the new
   method to get a network::SharedURLLoaderFactory, and create a
   blink::WebURLLoaderFactory using Platform::WrapURLLoaderFactory().
 - Introduce Platform::WrapURLLoaderFactory(
   scoped_refptr<network::SharedURLLoaderFactory>).

This CL should not introduce any behavior change.

Bug: 1413912, 789857

Change-Id: I44343eaceda6d308924db5bc75de8385ec01c4c9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4211117
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Commit-Queue: Tsuyoshi Horo <horo@chromium.org>
Reviewed-by: Yoshisato Yanagisawa <yyanagisawa@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1102996}
2023-02-08 23:24:53 +00:00