The current implementation only deletes the types of storage available
when the API was introduced.
This change introduces a new set of APIs that will delete all storage
data. These methods will be exposed through the AndroidX library for
apps to use.
The existing implementation is renamed to indicate that it is used by
the Android framework.
Bug: 373558938
Change-Id: Iac61b2403fad73a3170904613e784915278185de
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5934451
Reviewed-by: Nate Fischer <ntfschr@chromium.org>
Commit-Queue: Peter Pakkenberg <pbirk@chromium.org>
Reviewed-by: Christian Dullweber <dullweber@chromium.org>
Reviewed-by: Adam Walls <avvall@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1390255}
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}
Localhost is inherently a secure context, and Strict-Transport-Security
response headers can cause problems because they are not isolated by
port causing compatibility problems for web developers testing locally
as well as end-users who use software packages that commonly spin up
localhost webservers for ephemeral reasons (e.g. communication of an
auth token from a web login to a local software package). If one local
listener sets Strict-Transport-Security on a localhost response, it
will be applied to all subsequent localhost requests regardless of port.
We resolve this problem by matching Firefox and ignoring HSTS headers
on responses from localhost URLs.
Bug: 41251622
Change-Id: Ibebddb97aabe3f2a9c2a6008d314116cafe28a1e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5923046
Reviewed-by: Adam Rice <ricea@chromium.org>
Commit-Queue: Eric Lawrence <ericlaw@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1375901}
The is_request_for_primary_main_frame parameter of CreateLoginDelegate()
could mean whether the request is for any resources in the primary main
frame, or whether the request is for primary main frame navigation.
The current name has confused people and caused bugs. The bugs were
fixed in http://crrev.com/c/5882129. As a follow up of that change, this
change adds _navigation to the parameter name to make it clear so that
we don't have this confusion in the future.
Bug: 40792637
Change-Id: I6cb8f729b703ad2ca23488287436424a10a3ace8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5910076
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Reviewed-by: Peter Beverloo <peter@chromium.org>
Reviewed-by: Emily Stark <estark@chromium.org>
Commit-Queue: Liang Zhao <lzhao@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1367732}
There is a is_main_frame parameter used by basic authentication handling
code to interact with WebRequestAPI and login dialog showing code, and
that parameter is not set correctly for certain scenarios.
For WebRequestAPI, the parameter is used to adjust child_id to -1 of
proxied_request_id in WebRequestAPI::MaybeProxyAuthRequest for correctly
identifying the request. However, WebRequestAPI code uses -1 as
render_process_id not by whether it is main frame, but by whether it is
navigation. Therefore, with current code, we will not receive
onAuthRequired for sub frame navigations.
For login dialog showing code, it behaves differently by whether it is
main frame navigation or other requests. However, basic authentication
handling code in StoragePartitionImpl::OnAuthRequired treat this
parameter as meaning requests for main frame navigation or subresource
requests in main frame when the frame is under service worker.
Therefore, with current code, we will not show login dialog for
subresources when the page is under service worker control.
To fix the issues, we add another parameter to indicate whether it is a
request for navigation and use that when interacting with WebRequestAPI,
and correctly set is_main_frame as false for subresource requests when
the page is under service worker control.
Added WebRequestAPI tests for sub frame navigation and sub resource
request, for the cases where the page is under service worker control
and where it is not under service worker control.
Also updated ServiceWorkerBasicAuthTest to reflect the correct
expectation for subresource requests, and expand the tests to cover both
the case where the page is under service worker control and not under
service worker control.
Bug: 40676156,40792637,41459173
Change-Id: I6a716ec0228fcb2332a985c15c9bffbabb4a4dde
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5882129
Reviewed-by: Emily Stark <estark@chromium.org>
Commit-Queue: Liang Zhao <lzhao@microsoft.com>
Reviewed-by: David Bertoni <dbertoni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1363749}
This CL records the UserDeletedCookieOrCacheFromDialog histogram for QD.
It also does a small clean up so whenever the
UserDeletedCookieOrCache|FromDialog histograms are recorded, the same
common enum is used.
NO_IFTTT=Adding new IFTT for existing enum not changing the entries.
Bug: 337008330, 335387869
Change-Id: I042e88aa119e7ff74d5457bc786affe0b8b4bcbf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5860079
Reviewed-by: Martin Šrámek <msramek@chromium.org>
Reviewed-by: Sylvain Defresne <sdefresne@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Filipa Senra <fsenra@google.com>
Cr-Commit-Position: refs/heads/main@{#1359954}
Addresses ~14% of `-WUnsafe-buffer-usage` opt-out in `//content`.
This is a #cleanup.
The patch was initially partially generated by `./tool/clang/spanify`.
This patch applies conversions specifically to c-arrays in `//content`.
Although the `spanify` tool supports broader conversions, this change
intentionally focuses on c-arrays. Several manual fixes were made to
address anonymous struct issues and other edge cases encountered during
the conversion process.
Bug: 342213636, 40285824
Change-Id: I72666faa45a461ea27bb3608beeacc6c9fcd8a63
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5824992
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1349804}
ContentBrowserTest::SetUpCommandLine() is actually not defined. Calls to
this method ends up running BrowserTestBase::SetUpCommandLine(), which
is always going to be empty. Since there is no point in calling this
method, delete all the callers from SetUpCommandLine() overrides. When
the override becomes empty, delete the override altogether.
Make a note of this in the comments in content_browser_test.h. Also fix
some lint errors along the way.
Change-Id: I81f263286d72ebdab68dfd9575ad4cf2b6378a3c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5691227
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1325736}
Since multiline/multipath is currently unsupported; for enums that
require multiple file changes (e.g. histograms.xml and enums.xml) I've
used the following chain:
C++ declaration > enums.xml > histograms.xml > C++ declaration
NO_IFTTT=Adding linter not changing it.
Bug: 348206841
Change-Id: I97f4741f40592c7bd4be32e5de17236acc2bb34c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5645378
Reviewed-by: Evan Stade <estade@chromium.org>
Reviewed-by: Christian Dullweber <dullweber@chromium.org>
Auto-Submit: Mariam Ali <alimariam@google.com>
Commit-Queue: Mariam Ali <alimariam@google.com>
Cr-Commit-Position: refs/heads/main@{#1320198}
An edge case was discovered where the ancestor chain bit would
be calculated as cross-site when redirecting from a cross-site
resource to a same-site resource. This behavior does not align
with how the SameSite attribute behaves. To reduce developer
confusion, this CL unifies the behavior.
Tests have also been added to confirm the new expected behavior.
Bug: 346610961
Change-Id: I4d5bde5cf2e837bb738d2cb2b5de13bb05395d9d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5621955
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Aaron Selya <selya@google.com>
Reviewed-by: Dylan Cutler <dylancutler@google.com>
Cr-Commit-Position: refs/heads/main@{#1317939}
Permissions granted by Related Website Sets (RWS) are going to be
deleted when RWS are changing. This is currently a no-op because
RWS are loaded during startup but permissions granted by RWS are not
persisted. crrev.com/c/5588890 is going to persist RWS grants which will
then be cleared at startup if the RWS change.
Bug: b/338367663
Change-Id: Ib412817bbe0698b55295dc0aa267d97e369f8e1c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5597148
Reviewed-by: Chris Fredrickson <cfredric@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Sandor «Alex» Major <sandormajor@google.com>
Cr-Commit-Position: refs/heads/main@{#1314573}
Suppress unsafe buffer usage on a file-by-file basis. Out of
approximately 5850 .cc and .h files only roughly 160 files fail
compilation with the unsafe buffers warning.
Suppress only, by inserting boilerplate into affected files. Do not
re-write any code to work around the issues. Properly fixing each file
will be done in follow-up CLs.
//content/ is not removed from unsafe_bufers_paths.txt file and will be
also done as a follow-up, so it makes potential reverts simpler.
Bug: 342213636
Change-Id: I4a936e63dea95a78951f7bfae6d5487708ae3c0b
AX-Relnotes: n/a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5608913
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Nasko Oskov <nasko@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1312393}
Many data deletions are not checking time range or url filters. While
this isn't great, we should prevent at least individual origins from
being able to delete data globally through the Clear-Site-Data header.
These deletions should be skipped instead.
Change-Id: Ia8e0ebe6510fd91ab94b377047a335af0f806459
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5522577
Commit-Queue: Christian Dullweber <dullweber@chromium.org>
Reviewed-by: Martin Šrámek <msramek@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1302604}
Some types of storage don't support filtering and want to clear
themselves whenever "most" browsing data is being deleted.
It used to be the case that if BrowsingDataFilterBuilder::GetMode()
returned kPreserve, you could assume that almost all origins/domains
would be matched by the filter. Thanks to storage partitioning, that's
no longer true. There are now additional properties that restrict what
hosts are matched, and if you ignore them, then some storage will clear
all their data when only one host should be affected.
Add a new method to BrowsingDataFilterBuilder:
MatchesMostOriginsAndDomains().
Replace uses of BrowsingDataFilterBuilder::GetMode() == kPreserve with
calls to the new method.
Bug: 339385533
Change-Id: Ia040056b67ca616e1cd72d058bb80c86447258f1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5527934
Reviewed-by: Jonathan Njeunje <njeunje@chromium.org>
Commit-Queue: Ryan Tarpine <rtarpine@chromium.org>
Reviewed-by: Christian Dullweber <dullweber@chromium.org>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1301994}
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: 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}
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}
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: Iebe070b9ed793ecdfc43c3a3570f1808b7ddd221
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5470014
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@{#1290677}
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: Ifd155bbeff882ea939f74cf8b8f847f42847940b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5468156
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@{#1290297}
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}
An ancestor chain bit is being added to the key associated with the CookiePartitionKey class.
This change causes several tests to break because the expected values are no longer correct.
This CL updates those tests to have the correct value when the feature controlling the ancestor
chain bit is enabled.
Bug: 331596260
Change-Id: I013fd25da34907afce43c596f7d5951805dd08c8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5428454
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Commit-Queue: Aaron Selya <selya@google.com>
Reviewed-by: Ayu Ishii <ayui@chromium.org>
Auto-Submit: Aaron Selya <selya@google.com>
Cr-Commit-Position: refs/heads/main@{#1285380}
Replace with empty() and size(), respectively. The lowercase method
names work better with templated code that expects classes to have
size(), similar to STL containers.
Fix a typo along the way.
Change-Id: I42250eac4ac98e7a9973c6814fc8f4d18e389863
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5405774
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Owners-Override: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1280409}
This is the initial implementation of the ancestor chain bit addition to the cookie partition key.
The unit tests associated with the partition key have also been added and/or updated accommodate the new value.
For all the methods with parameters added to them, they have been given default values so that preexisting code will be able to work with them. This was done to allow for the wide spread changes to the codebase to be broken up into smaller CLs and after all those land another CL to address https://crbug.com/325439525, will be used to change the methods to require values be passed.
Bug: 41486025
Bug: 325439525
Change-Id: I9f0fec7dc4bee44031c5e80648e451d2fa733628
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5296867
Reviewed-by: Ayu Ishii <ayui@chromium.org>
Reviewed-by: Dylan Cutler <dylancutler@google.com>
Commit-Queue: Aaron Selya <selya@google.com>
Cr-Commit-Position: refs/heads/main@{#1280278}
Copy() and IsEqual() were not taking into account fields later added to
BrowsingDataFilterBuilderImpl, so copies would not behave the same as
the originals, and some distinct filters could compare equal.
Bug: 329233136
Change-Id: Ie65fc15e81e5378b845246b6c8da171fb3a08ea8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5369831
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Ryan Tarpine <rtarpine@chromium.org>
Reviewed-by: Dylan Cutler <dylancutler@google.com>
Cr-Commit-Position: refs/heads/main@{#1278318}
Many places use an optimized "return true" callback instead of a full
storage matching implementation when MatchesAllOriginsAndDomains()
returns true. But it could return true even when several storage
partitioning restrictions were set on the filter, leading to deleting
more storage than intended.
This CL makes MatchesAllOriginsAndDomains() return false if any such
restrictions are set.
Bug: 328710570
Change-Id: Idcd501c0e1a04893713bb284990a6e78c3229234
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5381507
Reviewed-by: Christian Dullweber <dullweber@chromium.org>
Commit-Queue: Ryan Tarpine <rtarpine@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1278277}
They were creating an entire, function instance of Chrome's network
stack just to create a request and grab net::LOAD_NORMAL from its
load flags, and never sending the request, which seems not useful.
URLRequests aren't even created in the same process in production
any more.
This code was likely left over from before the servicification of the
network stack.
Bug: None
Change-Id: I05caf3dcfd5b8995c9f8c0534a46056015bd633a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5381419
Reviewed-by: Christian Dullweber <dullweber@chromium.org>
Commit-Queue: mmenke <mmenke@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1275503}
BrowsingDataFilterBuilderImpl::BuildNetworkServiceFilter() currently
returns nullptr whenever the filter's cookie partition key collection
has been set. This effectively makes it a "match everything" filter.
This CL simply removes that case. It still doesn't behave correctly when
the collection has been set, but it's better than before (it no longer
matches all domains and origins).
Bug: 329705715
Change-Id: Id1eb968bb7febfb79b6586277cde7499e1ecd332
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5377290
Reviewed-by: Christian Dullweber <dullweber@chromium.org>
Reviewed-by: Dylan Cutler <dylancutler@google.com>
Commit-Queue: Ryan Tarpine <rtarpine@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1274993}
We migrate the shared storage SQLite database to version 5, which adds
a `num_bytes` column to the `per_origin_mapping` table. This will
track the total number of bytes stored in keys and values in the
`values_mapping` table by the associated origin.
We update several database methods in order to maintain the new
`num_bytes` column, and fix tests as necessary.
A follow-up CL (https://crrev.com/c/5280364) will add methods to query
the `num_bytes` column. At that point we will add more unit tests to
more thoroughly verify that the updates to database methods are working
as intended.
shared_storage_database_migrations.cc are executed only if a
`sql::Database` error occurs. To force database errors, we would
need to mock the `sql::Database` class, which currently doesn't
have any virtual methods.
Low-Coverage-Reason: HARD_TO_TEST The uncovered lines in
Bug: 324464353,1218540
Change-Id: I02eb9a44b78fc7e5e573704e78d0eb08c4a412c8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5278559
Reviewed-by: Ayu Ishii <ayui@chromium.org>
Commit-Queue: Cammie Smith Barnes <cammie@chromium.org>
Reviewed-by: Yao Xiao <yaoxia@chromium.org>
Reviewed-by: Joshua Bell <jsbell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1259365}
Per the linked bug other people have hit this DCHECK, and I'm
currently consistently hitting this DCHECK from simply trying to
navigate. We should not have DCHECKs in the code that aren't
actually correct.
Bug: 1420402
Change-Id: I6225826c330226c232ddd3c452a12014b82348df
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5263008
Reviewed-by: Joshua Bell <jsbell@chromium.org>
Commit-Queue: Marijn Kruisselbrink <mek@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1255843}
This CL is a refactor with no intended behavior change.
This CL replaces usage of web_contents_getter and browser_context_getter
with WeakPtrs in several content classes. This removes several potential
sources of UaFs.
Change-Id: I831c3f51730386146433726ce5f3efba08288616
Bug: 1371177
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5208248
Reviewed-by: Devlin Cronin <rdevlin.cronin@chromium.org>
Commit-Queue: Erik Chen <erikchen@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1249178}
(Unfortunately, this class is largely duplicated)
The content/ version needs an ExtractAsDangling() when closing the entry; unfortunately I can't reproduce the failure to confirm.
The services/network already had it, and it looks like the annotation was added to it by mistake --- the test mentioned uses the content/ version, not services/network one.
Change-Id: I302bff5a13253a126bf93c7e84970332755e4205
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5137949
Commit-Queue: Maks Orlovich <morlovich@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1240287}