NOTREACHED() and NOTREACHED_IN_MIGRATION() are both CHECK-fatal now.
The former is [[noreturn]] so this CL also performs dead-code removal
after the NOTREACHED().
This CL does not attempt to do additional rewrites of any surrounding
code, like:
if (!foo) {
NOTREACHED();
}
to CHECK(foo);
Those transforms take a non-trivial amount of time (and there are
thousands of instances). Cleanup can be left as an exercise for the
reader.
This does clean up kCrashOnDanglingBrowserContext as both paths of the
kill switch are currently fatal. This has been rolled out for a long
time.
Bug: 40580068, 40062641
Change-Id: Ib88e710d003e2e48df3fc502ca54d2341d157a0e
Cq-Include-Trybots: luci.chromium.try:linux-dcheck-off-rel
Low-Coverage-Reason: OTHER Should-be-unreachable code
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5974816
Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org>
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Auto-Submit: Peter Boström <pbos@chromium.org>
Reviewed-by: Sam McNally <sammc@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1376522}
Normally, in response to profile shutdown, features above //content
(such as the tab strip) destroy the WebContents that they own, which
also destroys the associated frame trees and its FrameTreeNodes and
cancels any ongoing navigations. Unfortunately, there have been
several bugs where the WebContents was not properly destroyed and
was allowed to outlive the BrowserContext (e.g.,
https://crbug.com/40062641, https://crbug.com/40243371,
https://crbug.com/358487779). Although there are mechanisms to catch
the creator of WebContents when this happens (see
~WebContentsOfBrowserContext) and collect crash keys, it is suspected
that they aren't always reached due to earlier crashes, at least some
of which are triggered by navigations that are still proceeding in
the dangling WebContents, after the profile shutdown has begun and its
RenderProcessHosts have been told to shut down (in
BrowserContext::NotifyWillBeDestroyed), but before the BrowserContext
destructor actually runs. So far, we've been playing whack-a-mole
(e.g., https://crrev.com/c/5755530), trying to add early returns to
various points in the middle of navigations in case they're reached
when the underlying profile is being destroyed.
In an attempt to more systematically mitigate the damage when this bug
happens, this CL adds "fallback" code to cancel any ongoing
navigations that are still around at the point of
BrowserContext::NotifyWillBeDestroyed(). This will avoid reaching the
numerous async points in the navigation flow during profile shutdown,
which could break assumptions in the navigation stack and lead to
crashes. Examples of those include GetFrameHostForNavigation trying to
create a process in a destroyed profile (https://crbug.com/40274462),
attempts to commit a resumed navigation where profile started shutting
down while it was deferred (https://crbug.com/355334226), etc.
Combining this with checks to prevent new navigations from starting
during profile shutdown (which are already partially there and will
be completed in followup work) should ensure that no navigation code
runs during (or after) profile destruction.
Doc: https://docs.google.com/document/d/1vfq22Atc_GUoRs-vGtQ6lbMRzSuio5pHZk5buzTX6P4/edit?usp=sharing&resourcekey=0-G9WuZdN2CLXToJEUwzwdYQ
Bug: 40274462, 355334226, 346864141
Change-Id: I496621052d34525b4c1676e72c9dbe2740cb46e7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5875148
Reviewed-by: Charlie Reis <creis@chromium.org>
Reviewed-by: Alex Ilin <alexilin@chromium.org>
Commit-Queue: Alex Moshchuk <alexmos@chromium.org>
Auto-Submit: Alex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1364251}
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}
This was generated by replacing " NOTREACHED()" with
" NOTREACHED_IN_MIGRATION()" and running git cl format.
This prepares for making NOTREACHED() [[noreturn]] alongside
NotReachedIsFatal migration of existing inventory.
Bug: 40580068
Change-Id: I3b48b89911ac5e9ffcb211622992f917f8f9e8d9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5539619
Auto-Submit: Peter Boström <pbos@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Owners-Override: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Peter Boström <pbos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1301096}
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: Ieeb461e2d489e86fd50b87a2a0721a2be34520c3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5467317
Owners-Override: Alison Gale <agale@chromium.org>
Commit-Queue: Darryl James <dljames@chromium.org>
Commit-Queue: Alison Gale <agale@chromium.org>
Reviewed-by: Darryl James <dljames@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1290198}
This turns topmost NOTREACHEDs, especially on ChromeOS, into
DUMP_WILL_BE_NOTREACHED_NORETURNs to exclude them from the
kNotReachedIsFatal experiment.
These were found by looking at the topmost crashes with [NOTREACHED] on
a ~2-week-old Dev release for all platforms.
Bug: 40580068
Change-Id: Id7a0db94226cfb91c8955bb45bca6a7d5ffc1502
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5289195
Owners-Override: Lei Zhang <thestig@chromium.org>
Auto-Submit: Peter Boström <pbos@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1259978}
Follow-up from crrev.com/c/4869214. This moves shutting down of
ServiceWorkerContext and SharedWorkerService from
BrowserContextImpl::NotifyWillBeDestroyed to
StoragePartitionImpl::OnBrowserContextWillBeDestroyed.
Bug: 1492282
Change-Id: I74b8c88540771e4f11efc0cd8e8183b5998c6f30
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4961074
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Commit-Queue: Scott Haseley <shaseley@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1213569}
StoragePartitionImpl::OnBrowserContextWillBeDestroyed is called by
BrowserContextImpl prior to destruction, which allows the partition to
shut down objects that hold raw pointers to about-to-be-destroyed
objects. This fixes dangling pointers in content_index and
FileSystemAccessManager** that result from objects being destroyed in
~ProfileImpl before shutting down all partitions.
**This CL also changes a couple browser tests to clear the testing
permission context to fix the remaining FileSystemAccessManager
dangling pointer causes.
Bug: 1471071, 1471072, 1471074
Change-Id: I569a2051f9e69e53f2d88d3ce4b6caeb4f74549f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4869214
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Sergey Poromov <poromov@chromium.org>
Commit-Queue: Scott Haseley <shaseley@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1209101}
This CL makes ServiceWorkerContextWrapper to maintain the browser
context by itself rather than having the dependency of
ServiceWorkerProcessManager. This is to avoid the complication when
destroying its own members. For example, ServiceWorkerContextCore
requires a valid browser context during destruction and
ServiceWorkerContextWrapper ends up needing to be careful on the
sequence of shutting down ServiceWorkerProcessManager and destroying
ServiceWorkerContextCore.
Bug: 1473204
Change-Id: I9a8a82f3e228fda41041be74f88b308e776d8f53
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4791907
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Reviewed-by: Yoshisato Yanagisawa <yyanagisawa@chromium.org>
Commit-Queue: Jack Hsieh <chengweih@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1186148}
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}
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}
~BrowserContextImpl() detects dangling RenderProcessHost, and uploads a
crash report via NOTREACHED and DumpWithoutCrashing. However, the
crash-key is defined *after* the NOTREACHED call, so it's only
included in the DumpWithoutCrashing reports. In DCHECK-enabled builds,
the NOTREACHED crash report doesn't actually include this crash key,
making the issue harder to troubleshoot.
Move the NOTREACHED call down one line, so the crash report includes
the crash key.
Bug: 1409750
Change-Id: I50e023a28a2de1422e54e0243e246c8c6554b600
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4287687
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1110273}
This CL renames BrowserContext::ForEachStoragePartition to
ForEachLoadedStoragePartition to capture that it only iterates over
loaded StoragePartitions, and updates several comments in BrowserContext
to clarify StoragePartition lifetime-related behavior.
This also renames GetStoragePartitionCount to
GetLoadedStoragePartitionCount for the same reason.
Change-Id: I14dd6ed6c076989ae4d7dd04ae0e91da5a15f171
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4163530
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Owners-Override: Alex Moshchuk <alexmos@chromium.org>
Commit-Queue: Robbie McElrath <rmcelrath@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1093642}
This CL adds the eligibility check to the content/ refactor of the
prefetch code. Some of the checks are not possible within content/ and
will require a delegate. The delegate will be added in a later CL.
Bug: 1299059
Change-Id: I4a58f670f11e86ea23a1123c6eb42d1debe4d4dc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3537152
Reviewed-by: Ryan Sturm <ryansturm@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Max Curran <curranmax@chromium.org>
Cr-Commit-Position: refs/heads/main@{#986205}
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}
Don't include devtools_background_services_context_impl.h or
shared_worker_service_impl.h. This saves 391 MB of total compiler input
size for the 'chrome' target on Linux.
Bug: 242216
Change-Id: Ibc2f107c93f7bcf712b6f8b2daed73c2c74f2699
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3501697
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Commit-Queue: Hans Wennborg <hans@chromium.org>
Cr-Commit-Position: refs/heads/main@{#983742}
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}
* 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}
This CL adds support for setting a custom save location for the
captured images and videos.
This will later be hooked to the new settings menu UI which is hidden
behind a flag.
This CL does not change the current behavior.
Later follow-up will handle edge cases if an arbitrary selected
folder becomes unavailable.
BUG=1250885
TEST=Manually, added new tests.
Change-Id: I17e09b20e4344d998565eadbefd48dca02ff16d8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3177404
Commit-Queue: Ahmed Fakhry <afakhry@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: James Cook <jamescook@chromium.org>
Cr-Commit-Position: refs/heads/main@{#924609}
DelayProcessShutdown() calls IncrementKeepAliveRefCount(), and
CancelProcessShutdownDelay() calls DecrementKeepAliveRefCount().
But shutdown delays are of a notably different duration than KeepAlives,
so this CL splits out the shutdown-delay count into a separate variable,
|shutdown_delay_ref_count_| so that we can more accurately track times
associated with each.
Bug: 1148542
Change-Id: Ie4e3019fa44a2e9f2b8200d4bc9e5cb34c450bb4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3133707
Commit-Queue: W. James MacLean <wjmaclean@chromium.org>
Reviewed-by: Eric Seckler <eseckler@chromium.org>
Reviewed-by: Colin Blundell <blundell@chromium.org>
Reviewed-by: Charlie Reis <creis@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#918961}
This CL implements tracking for workers separate from
fetch-keep-alive and delayed-subframe-unload tracking in RPHI.
In a follow-on CL we will add instrumentation to track the
time-remaining for fetch-keep-alive in order to better understand
when ChildProcessSecurityPolicy can safely clean up the
associated RenderProcess' information.
Bug: 1148542
Change-Id: I37e30a4e7533768135f3471297627fe16ab02a4f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2799937
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Charlie Reis <creis@chromium.org>
Commit-Queue: W. James MacLean <wjmaclean@chromium.org>
Cr-Commit-Position: refs/heads/main@{#913794}
In order to reduce build times, generated mojom.h files will use
forward declarations more aggressively after https://crrev.com/c/2932644
In particular, mojom.h files which define an interface may not provide
full definitions of method parameter types defined in other mojoms.
This reduces the size of those interfaces, but it means that
implementors and callers of such methods may have to include more
headers, as is done in this CL.
Bug: 242216
Change-Id: I1ce4ae3cd675888a172c35d9df6af5cfc29ccff8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2962433
Commit-Queue: Hans Wennborg <hans@chromium.org>
Auto-Submit: Hans Wennborg <hans@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Owners-Override: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#892550}
- Crash keys that are scope-limited have been migrated to the
easier-to-use SCOPED_CRASH_KEY_* macros.
- Callers that leaked the result of AllocateCrashKeyString
have been updated to cache the returned pointer in a variable
with static storage duration.
- All static storage duration variables that point to crash keys
have been marked with `const` to indicate the pointer should
not be reassigned.
Change-Id: I62a889e863eb2f67011bb1a87b25d4c1a1e29de8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2915000
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#886443}
This CL refactors non-overridable (i.e. implemented only within
//content) methods of `BrowserContext`, so that they are implemented as
instance methods (rather than as `static` methods taking a `self`
argument). This particular CL refactors the following methods:
- GetStoragePartition
- GetStoragePartitionForUrl
- ForEachStoragePartition
- GetStoragePartitionCount
- AsyncObliterateStoragePartition
- GarbageCollectStoragePartitions
- GetDefaultStoragePartition
Using instance methods (e.g. modifying all the callsites to use
instance method invocation syntax) is a prerequisite for splitting
BrowserContext into BrowserContextImpl+BrowserContextDelegate. In
particular, in the long-term, the refactored methods should be
pure-virtual methods of BrowserContext that are overriden/implemented by
BrowserContextImpl. Such virtual methods would be *instance* methods -
this is what the current CL helps with.
Bug: 1179776
AX-Relnotes: n/a.
Change-Id: I6effd1da5c17f27579251d41051b6ea08f689faf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2725732
Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org>
Reviewed-by: Charlie Reis <creis@chromium.org>
Auto-Submit: Łukasz Anforowicz <lukasza@chromium.org>
Commit-Queue: Charlie Reis <creis@chromium.org>
Owners-Override: Charlie Reis <creis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#877482}
Before this CL, the old BrowserContext::GetVideoDecodePerfHistory method
was mixing 2 responsibilities:
1. Lazily creating a VideoDecodePerfHistory object, storing
and retrieving it.
2. Letting //content embedders override how VideoDecodePerfHistory
is created.
In other words, the old GetVideoDecodePerfHistory method was partially
belonging to a (hypothetical/future) BrowserContextDelegate and
partially belonging to a BrowserContext::Impl.
After this CL, there are 2 separate methods:
- CreateVideoDecodePerfHistory controls how VideoDecodePerfHistory
is created. //content layer provides a default implementation, but
//content embedders (e.g. OffTheRecordProfileImpl) may override the
behavior. In the long term, this method belongs in the
(hypothetical/future) BrowserContextDelegate class.
- GetVideoDecodePerfHistory remains responsible for lazy creation,
storing and retrieval of the VideoDecodePerfHistory object. This
method is not overridden by //content embedders (this CL removes some
duplicate/no-longer-needed code from //content embeders) and no longer
needs to be a virtual method. In the long term, this method belongs
in the (hypothetical/future) BrowserContextImpl class.
Bug: 1179776
Change-Id: I38ec9532dd2308df968f4979a13d6fbb7473d9fb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2720012
Reviewed-by: Chrome Cunningham <chcunningham@chromium.org>
Reviewed-by: Mihai Sardarescu <msarda@chromium.org>
Reviewed-by: Kevin Marshall <kmarshall@chromium.org>
Reviewed-by: Charlie Reis <creis@chromium.org>
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Cr-Commit-Position: refs/heads/master@{#870232}
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}