0
Commit Graph

16 Commits

Author SHA1 Message Date
Christian Biesinger
c59336f303 [FedCM] Move delegate implementation to content/browser
Currently, there is no default implementation of the federated identity
delegates in content/browser. In order to make FedCM work in headless,
this CL moves the in-memory delegate implementation from content/shell
to content/browser.

Bug: 336561988
Change-Id: I5097f86c76bcd5bb41193ef14f16d1b2f0eef6a7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5740871
Reviewed-by: Nicolás Peña <npm@chromium.org>
Commit-Queue: Christian Biesinger <cbiesinger@chromium.org>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1333637}
2024-07-26 17:08:22 +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
Arthur Sonzogni
ff8375879e Deduplicate BrowserContext's ResourceContext
This seems to be an empty class meant to be removed at some point.
Today, this is only a class supporting `SupportsUserData`.

I observed every content/ embedder was required to provide one, and none
of them was really providing some kind of customization.

This patch merge all the different embedders implementations into
the content/ implementation. This has the
side effect of helping linnan@chromium.org to remove a dangling pointer.
This is an alternative to her patch from:
https://chromium-review.googlesource.com/c/chromium/src/+/5132493

Bug: chromium:1471070, chromium:908955
Change-Id: I4938957822d0a77be642aef3098faaa87616295f
Fixed: 1471070
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5139789
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Auto-Submit: Arthur Sonzogni <arthursonzogni@chromium.org>
Owners-Override: John Abd-El-Malek <jam@chromium.org>
Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#1240500}
2023-12-22 10:05:45 +00:00
William Liu
b1111ebd73 [navigation-transitions]: Clean up NavigationEntryScreenshotCache.
- Removes the awkward GetManagerForTest() from cache, by
  content-exporting BrowserContextImpl, so the impl can be used in
  various test targets (context:
  https://crrev.com/c/4245857/comment/7c10dda8_67e6a8f1/).
- Asserts the APIs on cache can only accessed on UI thread (intended).
  - RenderWidgetHostView::CopyFromSurface will be used to ask for
    a screenshot of the current WebContent's view. This method does
    not guarantee that the callback is executed on the same thread
    (https://crbug.com/1309124 and https://crrev.com/c/3782813). If we
    don't assert that these methods are accessed on UIThread, the
    sequence checker in the SupportUserData will fail because
    NavigationEntry are created on the UIThread.
- Removes unused headers.

Bug: 1415332, 1413521
Low-Coverage-Reason: DCHECKs will be tested in browsertests.
Change-Id: I1903d1c84a9787a348dadecf3a7d1ef6546f0828
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4393402
Reviewed-by: Charlie Reis <creis@chromium.org>
Commit-Queue: William Liu <liuwilliam@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1127188}
2023-04-06 14:44:16 +00:00
William Liu
055a3549f4 [navigation-transitions]: Cache screenshots for navigation entries
Introduce NavigationEntryScreenshot, which preserves a screenshot on the
current NavigationEntry when the user is navigating away from it. The
stored screenshot will later be used to present the user with a preview,
when the user navigates back to this page.

The caching mechanism is composed of the screenshot, the cache and a
global manager. The global manager lives on the BrowserContext and is
responsible for memory budgeting. The cache lives on the primary
NavigationController which owns the NavigationEntry where the
screenshot is stashed.

This CL contains the impl of caching, retrieving and eviction of the
screenshots with unittests. The cache is not integrated with the navigation thus no browsertest.

The code resides in `//content/browser/renderer_host/` because no need
to access WebContents.

[Updated] DD/Explainer (chromium access): https://docs.google.com/document/d/1-7TatVjSL4n-RNyvN_MWdFoOiR6YJ1BjvJKgvym_ArU

Feature EngDoc: https://docs.google.com/document/d/1H99XZHdAWNfbfboHbGdMB97k81AzAxVtPSizAjO2Poc/

PRD (google access): https://docs.google.com/document/d/1JMWzArv0VR-G4xx3a5ku8N5np8mDeGSuvR95kZc8ynY/

Bug: 1415332, 1413521
Change-Id: Icc3b2aa7b5b36ed460ad2ddd1ff5f645a38d2835
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4245857
Reviewed-by: Kyle Charbonneau <kylechar@chromium.org>
Commit-Queue: William Liu <liuwilliam@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1125127}
2023-04-02 17:21:19 +00:00
Hiroshige Hayashizaki
805be68671 Introduce prefetch_url_loader_helper.h/cc
This CL split the core, interceptor-independent parts of
PrefetchUrlLoaderInterceptor into prefetch_url_loader_helper.h/cc.

To remove dependencies to `PrefetchURLLoaderInterceptor`,
this CL injects GetPrefetchOriginProber/CopyIsolatedCookies
in unit tests via `TestPrefetchService`
instead of via `TestPrefetchURLLoaderInterceptor`.

This CL doesn't change the behavior.

Bug: 1422820
Change-Id: If091ddb511f6631b6f5769bca2037bd46c8b835f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4150615
Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org>
Reviewed-by: Max Curran <curranmax@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Lingqi Chi <lingqi@chromium.org>
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1122886}
2023-03-28 08:16:22 +00:00
Etienne Noel
2ac27c2761 Supporting storage buckets in 'Clear-Site-Data' header
This cl adds support for deleting specific storage buckets using
the clear-site-data http header.

The explainer is available here: `https://github.com/WICG/storage-buckets/blob/gh-pages/explainer.md#storage-buckets-and-the-clear-site-data`

Also removed expired `Navigation.ClearSiteData.Parameters` histogram.

Bug: 1354360

Change-Id: I70a6be39bafd946db5c5eb1e3cfeb77b291ee0fc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3910656
Reviewed-by: Joshua Bell <jsbell@chromium.org>
Reviewed-by: Evan Stade <estade@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Commit-Queue: Etienne Noël <etiennenoel@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1079625}
2022-12-06 04:28:46 +00:00
Avi Drissman
4e1b7bc33d Update copyright headers in content/
The methodology used to generate this CL is documented in
https://crbug.com/1098010#c34.

No-Try: true
No-Presubmit: true
Bug: 1098010
Change-Id: I8c0f009d16350271f07d8e5e561085822cc9dd27
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3895935
Owners-Override: Avi Drissman <avi@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
Auto-Submit: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1047456}
2022-09-15 14:03:50 +00:00
Alexander Timin
074cd18fa3 [tracing] Use TracedProto in //content.
Use the new ability to write typed messages into the untyped and untyped
into typed to eliminate WriteIntoTrace(TracedValue) /
WriteIntoTrace(TracedProto) duplicated methods in //content.

After this patch, all key //content types listed below now have
corresponding proto messages (with DebugAnnotation support) and
WriteIntoTrace(TracedValue) methods have been removed:
- BrowserContext
- BrowsingContextState
- FrameTreeNode
- NavigationRequest
- RenderFrameHost
- RenderFrameProxyHost
- RenderViewHost
- SiteInstance
- SiteInstanceGroup
- GlobalRenderFrameHostId

This patch also adds a few `const` qualifiers to the appropriate methods
in //content to ensure that all WriteIntoTrace methods can be marked as
const.

R=rakina@chromium.org

Bug: 1137154
Change-Id: I306e7619f594e2a02ca24183720714f234661ff4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3540169
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Reviewed-by: Alex Ilin <alexilin@chromium.org>
Commit-Queue: Alexander Timin <altimin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#984436}
2022-03-23 18:11:22 +00:00
Max Curran
6c2835eabe Establish high level structure of PrefetchProxy client refactor.
This CL creates the main classes of this refactor, and outlines their
responsibilities and major dependencies. These classes will be completed
in future CLs.

Bug: 1299059
Change-Id: Iff1c2b0de4e6d6e517d89e350ee94fb31c6165aa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3475599
Reviewed-by: Ryan Sturm <ryansturm@chromium.org>
Reviewed-by: Simon Pelchat <spelchat@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Max Curran <curranmax@chromium.org>
Cr-Commit-Position: refs/heads/main@{#978388}
2022-03-07 19:52:38 +00:00
Arthur Sonzogni
61cb46d1bf Make BrowserContextImpl constructor private.
This is a follow-up to:
https://chromium-review.googlesource.com/c/chromium/src/+/3461652

BrowserContextImpl is not constructed outside of BrowserContext. So this
patch hide its constructor and make it public only within
BrowserContext.

Note: The long term behavior we want is to invert the dependency, and
make BrowserContext to be implemented by BrowserContextImpl instead.

Bug: https://crbug.com/1179776
Change-Id: I3d217f9277fa2b694156e21d23329ac9510e5259
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3463734
Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org>
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#971285}
2022-02-15 17:25:28 +00:00
Johannes Kron
b1209bd19e Store WebRTC MediaCapabilities stats to local DB
This CL introduces the classes
WebrtcVideoPerfReporter
WebrtcVideoPerfRecorder
WebrtcVideoPerfHistory

The Reporter sends stats from the render process over mojo
to the Recorder in the browser process. The Recorder
keeps track of the current encode and decode stream configuration
and forwards the data to the History class.
History verifies that the stats look okay and persists to the local
database. History also retrieves stats from the database that are
used in order to predict if a certain configuration will be smooth
or not.

This CL implements functionality needed for the WebRTC
MediaCapabilities implementation. The binary size will therefore
be increased. I will do a follow-up CL that the reuses the
PendingOperation code that is shared between VideoDecodeStatsDBImpl
and WebrtcVideoStatsDBImpl.

Bug: chromium:1187565
Change-Id: I6588299611e591ab318e6ebe9d9bae825f9dd09e
Binary-Size: Size increase is unavoidable (see above).
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3443426
Reviewed-by: Matthew Denton <mpdenton@chromium.org>
Reviewed-by: Henrik Boström <hbos@chromium.org>
Reviewed-by: Chrome Cunningham <chcunningham@chromium.org>
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Johannes Kron <kron@chromium.org>
Cr-Commit-Position: refs/heads/main@{#971146}
2022-02-15 10:32:39 +00:00
Arthur Sonzogni
2a0c01a2fe Add BrowserContextImpl::From(BrowserContext*)
* Rename BrowserContext::Impl into BrowserContextImpl
* Add static BrowserContextImpl::From(BrowserContext*)

This avoids content/ internal users to define in the content/public
browser_context.h new "friend" function, in order to access the
implementation from within content/

In the future, BrowserContext will be a pure interface, implemented by a
BrowserContextImpl. So, this is equivalent to the "future" possibility
of doing static_cast<BrowserContext*>, but available to today.

This is similar to what we did with the
NavigationRequest/NavigationHandle class deduplication with
NavigationRequest::From(NavigationHandle*).

Practically, this will avoid patch:
https://chromium-review.googlesource.com/c/chromium/src/+/3443426/16
From forward declaring RenderFrameHostImpl* and some content::internal
namespace.

Bug: https://crbug.com/1179776

Change-Id: I33baeca3f70ed9bb791f7a50a4795546f46fbae8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3461652
Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#971109}
2022-02-15 08:28:46 +00:00
Keishi Hattori
0e45c020c4 Rewrite most Foo* field_ pointer fields to raw_ptr<Foo> field_.
DO NOT REVERT (unless absolutely necessary)! Report build breaks to keishi@(APAC)/glazunov@(EMEA)/sebmarchand@(NA) as soon as you see them. Fixes are expected to be trivial.

This commit was generated automatically, by running the following script: tools/clang/rewrite_raw_ptr_fields/rewrite-multiple-platforms.sh on commit fe74bc434e

For more information, see MiraclePtr One Pager [1], the PSA at chromium-dev@ [2], and the raw_ptr documentation in //base/memory/raw_ptr.md.

FYI This CL does not enable MiraclePtr protection and we expect no behavior change from this.

[1] https://docs.google.com/document/d/1pnnOAIz_DMWDI4oIOFoMAqLnf_MZ2GsrJNb_dbQ3ZBg/edit?usp=sharing
[2] https://groups.google.com/a/chromium.org/g/chromium-dev/c/vAEeVifyf78/m/SkBUc6PhBAAJ

Binary-Size: Increase of around 500kb was approved for MiraclePtr
Include-Ci-Only-Tests: true
No-Tree-Checks: true
No-Presubmit: true
Bug: 1272324, 1073933
Change-Id: I05c86a83bbb4b3f4b017f361dd7f4e7437697f69
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3305132
Commit-Queue: Keishi Hattori <keishi@chromium.org>
Reviewed-by: Bartek Nowierski <bartekn@chromium.org>
Owners-Override: Bartek Nowierski <bartekn@chromium.org>
Cr-Commit-Position: refs/heads/main@{#945735}
2021-11-27 09:25:52 +00:00
Eric Willigers
323a9eda2c [content] Include chromeos_buildflags
//content files using IS_CHROMEOS_ASH or IS_CHROMEOS_LACROS now
include the relevant header.

Bug: 1246565
Change-Id: I79290a489696dac9bc71ecb04d3325dc3f0e40c2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3141161
Auto-Submit: Eric Willigers <ericwilligers@chromium.org>
Commit-Queue: Charlie Reis <creis@chromium.org>
Reviewed-by: Charlie Reis <creis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#921297}
2021-09-14 17:37:30 +00:00
Lukasz Anforowicz
729a9e1c5f Avoid using UserData in //content/browser/browser_context.cc
Before this CL, //content/browser/browser_context.cc would rely on
base::SupportsUserData to simulate 10+ fields of BrowserContext.  The
motivation for this was to hide //content-internal details (e.g. the
fields and their types) from //content/public API (e.g. from the
declaration of the BrowserContext class).

After this CL, explicit fields are used while still being hidden from
//content/public API behind a private, fwd-declared Impl class.

Motivation:

- Removing the SupportsUserData dependency is a necessary step toward
  migration to separate BrowserContext, BrowserContextImpl and
  BrowserContextDelegate classes.

- Explicit fields are easier to read and use (when coding or when
  using a debugger).

Bug: 1179776
Change-Id: Ifdc3ff1d7b945678fa0a915af780c9631c998058
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2706279
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Reviewed-by: Chrome Cunningham <chcunningham@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#868166}
2021-03-31 17:44:01 +00:00