This change removes StorageType param from
QuotaManagerProxy::RegisterClient. After
StorageType::kSyncable deprecation, all other storage types
except kTemporary are deprecated. So we no longer need to
specify StorageType.
As a side-effect there is also clean-up in
BrowsingDataQuotaHelper to no longer collect syncable usage.
No storage data is associated with Syncable type now and will
always return 0.
Further StorageType cleanup from QuotaManager/QuotaDatabase
will be done in a follow-up change.
Bug: 40211051
Change-Id: I70cb64c7b270def02d8b539a77498eba208b1e4a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6309405
Reviewed-by: Bo Liu <boliu@chromium.org>
Reviewed-by: Martin Šrámek <msramek@chromium.org>
Reviewed-by: Tsuyoshi Horo <horo@chromium.org>
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Reviewed-by: Marijn Kruisselbrink <mek@chromium.org>
Commit-Queue: Ayu Ishii <ayui@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1429075}
This change removes some usages of StorageType in QuotaManagerProxy.
After StorageType::kSyncable deprecation, all other storage types
except kTemporary are deprecated. So we no longer need to specify
StorageType. Further cleanup to remove usage from QuotaManager,
QuotaDatabase, etc. will follow.
Bug: 40211051
Change-Id: Iba5caa5aefcc346cbcf9e7aac3f05ab33ca53d61
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6306646
Reviewed-by: Bo Liu <boliu@chromium.org>
Commit-Queue: Ayu Ishii <ayui@chromium.org>
Reviewed-by: Tsuyoshi Horo <horo@chromium.org>
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1426466}
This CL plumbs the DocumentIsolationPolicy reporter through
CacheStorage, so that it can be passed to CORP checks triggered from
CacheStorage.
This CL is part of a chain implementing Document Isolation Policy
reporting:
1) Add DocumentIsolationPolicyReporter
2) Implement DocumentIsolationPolicyReporter
3) Pass the reporter to URLloaderFactory
4) Plumb DIP reporter into ServiceWorkers
5) Add a DIP reporter to DedicatedWorker
6) Add a DIP reporter to SharedWorker
7) Plumb DIP reporter in CacheStorage <- you are here
Bug: 333029815
Change-Id: I5a7b5a92b9e059242c1ddcfa218c1cfb6d9cd0e4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6088411
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Camille Lamy <clamy@chromium.org>
Reviewed-by: Tsuyoshi Horo <horo@chromium.org>
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1414111}
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}
Accessing an invalid iterator can sometimes be a security
issue and these checks are cheap, so upgrade to CHECKs.
Generally these DCHECKS precede a use or erase of the
checked iterator, which if the check is invalid (ie. the
iterator == .end()) is UB.
Added checks are NotFatalUntil::M130.
`base/not_fatal_until.h` is added using tools/add_header.py,
this may result in some main-file (foo.h for foo.cc) headers
being re-sorted to be first as part `git cl format` of this CL.
For this CL instances were located with a weggli query:
```
weggli --verbose=1 --cpp \
'DCHECK(_ != _.end());' \
-p 'DCHECK(_.end() != _);' \
-p 'DCHECK_NE(_, _.end());' \
-p 'DCHECK_NE(_.end(), _);'
```
which should avoid any potentially expensive calculations
of the thing to be matched against .end().
This CL was uploaded by git cl split.
R=alexmos@chromium.org, dom@chromium.org, jinsukkim@chromium.org, peter@chromium.org, wanderview@chromium.org
Bug: 351745839
Change-Id: Ic4b66209052fde03394b9f34241ae2bd9173ed7a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5706540
Commit-Queue: Jinsuk Kim <jinsukkim@chromium.org>
Reviewed-by: Peter Beverloo <peter@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Jinsuk Kim <jinsukkim@chromium.org>
Auto-Submit: Alex Gough <ajgo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1327876}
Accessing an invalid iterator can sometimes be a security
issue and these checks are cheap, so upgrade to CHECKs.
Added checks are NotFatalUntil::M130.
`base/not_fatal_until.h` is added using tools/add_header.py,
this may result in some main-file (foo.h for foo.cc) headers
being re-sorted to be first as part `git cl format` of this CL.
For this CL instances were located with a weggli query:
```
weggli --verbose=1 --cpp \
'DCHECK($var != _.end());' \
-p 'DCHECK(_.end() != $var);' \
-p 'DCHECK_NE($var, _.end());' \
-p 'DCHECK_NE(_.end(), $var);'
```
which should avoid any potentially expensive calculations
of the thing to be matched against .end().
This CL was uploaded by git cl split.
R=alexmos@chromium.org, boliu@chromium.org, fabiansommer@chromium.org, mmenke@chromium.org, peter@chromium.org
Bug: 351745839
Change-Id: Icfe179b0d14dd9af5cfde3a51497c1b88964d7c0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5689315
Reviewed-by: Peter Beverloo <peter@chromium.org>
Commit-Queue: Alex Gough <ajgo@chromium.org>
Reviewed-by: Bo Liu <boliu@chromium.org>
Reviewed-by: Fabian Sommer <fabiansommer@chromium.org>
Reviewed-by: mmenke <mmenke@chromium.org>
Auto-Submit: Alex Gough <ajgo@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1326308}
For forward/back navigations, chrome should load the native page, which
will issue a download request, instead of loading a URL that leads to a
pdf download directly.
This CL cancels the download if a forward/back navigation results in a
pdf download.
Low-Coverage-Reason: TRIVIAL_CHANGE
Bug: 349917621
Change-Id: I01555ff83f763311f98ff32719bea0221650c440
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5665956
Reviewed-by: Shu Yang <shuyng@google.com>
Commit-Queue: Min Qin <qinmin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1321311}
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: 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}
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: Iabdfea2fd5393d6bbc54390ca0c995eb2c55bbaa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5469882
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@{#1290673}
This is a reland of commit 431722686b
Fixed the null deref of scoped_refptr in the usb descriptor code,
by not constructing the span from the RefCountedMemory before we
know the RefCountedMemory is really there.
Original change's description:
> Spanify base::RefCountedMemory
>
> - The base class gets data() and size() as well as begin() and end()
> - The virtual interface gets a span from the subclass.
> - All subclasses hold a bounded type.
> - Remove front_as<T>() from the base class. Use a span or data()
> instead.
> - Remove most use of front() from the base class, but leave the
> method there just to reduce the scope/size of this CL a bit. Use
> a span or data() instead.
> - Rename data() in subclasses to be more specific: as_vector() or
> as_string().
> - Remove the shadowing data(), and front_as(), from the vector-based
> subclass that provided mutable access. Have mutable access go
> through as_vector().
> - Remove the shadowing data() from the string-based subclasses that
> provided mutable access. Have mutable access go through
> as_string().
>
> The base class provides const access to the underlying data, as not
> all implementations point to mutable data. The subclasses provided
> methods to access the underlying data mutably, sometimes in ways that
> shadowed the base class methods (such as with front_as). When mutable
> access is required, we now go through the underlying storage accessor
> such as as_vector() or as_string().
>
> In the X11 code there's a bunch of RefCountedMemory that are
> actually unsized, since they come from void* in C APIs. So split
> those off to a separate x11::UnsizedRefCountedMemory, and use that
> for all reply type data fields.
>
> Add conversion types to move between sized and unsized, which are needed
> very rarely.
>
> Use RefCountedMemory as a span since it converts now:
> - Convert all front_as<char>() to use base::as_string_view(*mem).
> - Convert make_span(mem->front(), mem->size()) to span(*mem).
> - Except when mutable access is required, in which case we go through
> the underlying storage type.
>
> Bug: 40284755
> Change-Id: Ib1c5fd61973092e3e02562646a7b3416e1070cd1
> Low-Coverage-Reason: refactoring, not new code
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5447596
> Reviewed-by: Reilly Grant <reillyg@chromium.org>
> Owners-Override: Kyle Charbonneau <kylechar@chromium.org>
> Reviewed-by: Kyle Charbonneau <kylechar@chromium.org>
> Commit-Queue: danakj <danakj@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1288921}
Bug: 40284755
Change-Id: Ide0a71227c4930bd638bb07faffda44f5285bd4f
Low-Coverage-Reason: refactoring, not new code
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5462330
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Commit-Queue: danakj <danakj@chromium.org>
Reviewed-by: Kyle Charbonneau <kylechar@chromium.org>
Owners-Override: Kyle Charbonneau <kylechar@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1289537}
This reverts commit 431722686b.
Reason for revert: Suspicious for causing test failures related to devtools in chrome driver tests and USB related tests
i.e. https://ci.chromium.org/ui/p/chromium/builders/ci/win11-arm64-rel-tests/924/overview
Original change's description:
> Spanify base::RefCountedMemory
>
> - The base class gets data() and size() as well as begin() and end()
> - The virtual interface gets a span from the subclass.
> - All subclasses hold a bounded type.
> - Remove front_as<T>() from the base class. Use a span or data()
> instead.
> - Remove most use of front() from the base class, but leave the
> method there just to reduce the scope/size of this CL a bit. Use
> a span or data() instead.
> - Rename data() in subclasses to be more specific: as_vector() or
> as_string().
> - Remove the shadowing data(), and front_as(), from the vector-based
> subclass that provided mutable access. Have mutable access go
> through as_vector().
> - Remove the shadowing data() from the string-based subclasses that
> provided mutable access. Have mutable access go through
> as_string().
>
> The base class provides const access to the underlying data, as not
> all implementations point to mutable data. The subclasses provided
> methods to access the underlying data mutably, sometimes in ways that
> shadowed the base class methods (such as with front_as). When mutable
> access is required, we now go through the underlying storage accessor
> such as as_vector() or as_string().
>
> In the X11 code there's a bunch of RefCountedMemory that are
> actually unsized, since they come from void* in C APIs. So split
> those off to a separate x11::UnsizedRefCountedMemory, and use that
> for all reply type data fields.
>
> Add conversion types to move between sized and unsized, which are needed
> very rarely.
>
> Use RefCountedMemory as a span since it converts now:
> - Convert all front_as<char>() to use base::as_string_view(*mem).
> - Convert make_span(mem->front(), mem->size()) to span(*mem).
> - Except when mutable access is required, in which case we go through
> the underlying storage type.
>
> Bug: 40284755
> Change-Id: Ib1c5fd61973092e3e02562646a7b3416e1070cd1
> Low-Coverage-Reason: refactoring, not new code
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5447596
> Reviewed-by: Reilly Grant <reillyg@chromium.org>
> Owners-Override: Kyle Charbonneau <kylechar@chromium.org>
> Reviewed-by: Kyle Charbonneau <kylechar@chromium.org>
> Commit-Queue: danakj <danakj@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1288921}
Bug: 40284755
Change-Id: Ifa8478ea367d3767e474a9042afa3e5e0596ab9f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5464882
Auto-Submit: Nidhi Jaju <nidhijaju@chromium.org>
Owners-Override: Nidhi Jaju <nidhijaju@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#1289148}
- The base class gets data() and size() as well as begin() and end()
- The virtual interface gets a span from the subclass.
- All subclasses hold a bounded type.
- Remove front_as<T>() from the base class. Use a span or data()
instead.
- Remove most use of front() from the base class, but leave the
method there just to reduce the scope/size of this CL a bit. Use
a span or data() instead.
- Rename data() in subclasses to be more specific: as_vector() or
as_string().
- Remove the shadowing data(), and front_as(), from the vector-based
subclass that provided mutable access. Have mutable access go
through as_vector().
- Remove the shadowing data() from the string-based subclasses that
provided mutable access. Have mutable access go through
as_string().
The base class provides const access to the underlying data, as not
all implementations point to mutable data. The subclasses provided
methods to access the underlying data mutably, sometimes in ways that
shadowed the base class methods (such as with front_as). When mutable
access is required, we now go through the underlying storage accessor
such as as_vector() or as_string().
In the X11 code there's a bunch of RefCountedMemory that are
actually unsized, since they come from void* in C APIs. So split
those off to a separate x11::UnsizedRefCountedMemory, and use that
for all reply type data fields.
Add conversion types to move between sized and unsized, which are needed
very rarely.
Use RefCountedMemory as a span since it converts now:
- Convert all front_as<char>() to use base::as_string_view(*mem).
- Convert make_span(mem->front(), mem->size()) to span(*mem).
- Except when mutable access is required, in which case we go through
the underlying storage type.
Bug: 40284755
Change-Id: Ib1c5fd61973092e3e02562646a7b3416e1070cd1
Low-Coverage-Reason: refactoring, not new code
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5447596
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Owners-Override: Kyle Charbonneau <kylechar@chromium.org>
Reviewed-by: Kyle Charbonneau <kylechar@chromium.org>
Commit-Queue: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1288921}
DevToolsBackgroundServicesContextImpl can outlive its BrowserContext in
tests, which causes a dangling pointer. This CL fixes this by:
- Fixing destruction order in ServiceWorkerUpdateJobTest, which was
straightforward.
Note: this also fixes an unrelated dangling pointer in one of the
ServiceWorkerUpdateJobTest tests, which was straightforward and
part of the same destruction sequence.
- Making DevToolsBackgroundServicesContextImpl uniquely owned (no
longer ref counted). The main interesting bits here were:
- Get the DevToolsBackgroundServicesContextImpl directly rather
than passing it across tasks (for service worker callbacks).
This avoids a dangling pointer in the callback.
- Plumb the Shutdown signal through BackgroundFetchContext to
other objects that hold a raw_ptr to the devtools service. This
can be further improved by making BackgroundFetchContext uniquely
owned.
Bug: 1471073
Change-Id: I457c8492d21299dd60368711ed3814f3cf8fc3ec
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4868640
Commit-Queue: Scott Haseley <shaseley@chromium.org>
Reviewed-by: Rouslan Solomakhin <rouslan@chromium.org>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1199589}
1. Use base::Contains() instead of std::find or <container>::find()
where appropriate in //content/browser.
2. Refactor some code to enhance performance when executing the code.
3. The remaining code that needs to be modified in the //content/browser
directory will be modified in subsequent patches.
AX-Relnotes: n/a
Bug: 561800
Change-Id: Ibf6b4f7919256484826dfeb73859e23185579061
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4845751
Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Ho Cheung <uioptt24@gmail.com>
Cr-Commit-Position: refs/heads/main@{#1193668}
The DanglingPointerDetector is configured only when the test enters the
ContentMain function. See https://crbug.com/1400059
I would like to configure it no matter the kind of test. For this to
happen, we need to annotate every pre-existing dangling pointers.
This patch annotates the ones you can find by running targets depending
on the GoogleTest library.
Statistic:
This adds 1776 new DanglingUntriaged. Among them:
- 1288 are in unittests.
- 488 are in implementation.
To produce those numbers, I used the command:
```bash
git diff annotate-linux origin/main -- "*test*" | grep "DanglingUntriaged" | wc -l
```
This patch has been generated by:
1. Apply the "auto-annotator" patch:
https://chromium-review.googlesource.com/c/chromium/src/+/4474553
2. Compile the compiler again:
```bash
./tools/clang/scripts/build.py
```
3. List and run all the targets. You can use a bash script like:
https://docs.google.com/document/d/1AMMERcqy0eafFWopUCHYsIKIKEp3J8DFxqW9UIbzIHo
4. Concatenate output, filter by "Found dangling ptr", sort, remove
duplicate.
5. Apply the rewriter script from:
https://github.com/ArthurSonzogni/chrome-dangling-ptr-apply-edit
6. Revert the "auto-annotate" patch.
7. Apply `git cl format`
AX-Relnotes: n/a.
Bug: chromium:1400059
Change-Id: I217d5c0b925da5176fc53baf95919a3690f1e9a3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4570424
Reviewed-by: danakj <danakj@chromium.org>
Owners-Override: danakj <danakj@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1151859}
During the investigation on crbug.com/1423325, we saw NOTREACHED
is caused by `blink::ServiceWorkerStatusCode::kErrorFailed`.
Upon some more investigations, we saw
`blink::ServiceWorkerStatusCode::kErrorFailed` is caused by
`Status::kErrorCorrupted`, and conversion happens in
`DatabaseStatusToStatusCode`. However, `Status::kErrorCorrupted`
happens very often and it hide the real cause of crbug.com/1423325.
To avoid that, we need to make the data corruption error as separated
error.
Since enums this CL touches are recorded to UMA, this enum change
need to be permanent, and that is why the CL is separated from the
DumpWithoutCrash CL.
Bug: 1423325
Change-Id: I33826bcb19bd37841fdb4f3b4660dd8df1a64ed9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4560652
Reviewed-by: Kenichi Ishibashi <bashi@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Reviewed-by: Shunya Shishido <sisidovski@chromium.org>
Commit-Queue: Yoshisato Yanagisawa <yyanagisawa@chromium.org>
Reviewed-by: Minoru Chikamune <chikamune@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1149587}
Now that this method was merged in https://crrev.com/c/4496124, I am cleaning up places where we derive IsolationInfo from a StorageKey so that we can have only one implementation of the casting logic.
The logic used in StorageKey::ToPartialNetIsolationInfo is almost identical to the logic here. The only difference is in first-party contexts, it uses the full storage origin for the top-frame origin, instead of making an origin from the top-frame site.
Bug: None
Change-Id: Ia0c2d1b8e776be5b918af54770dcc9a9450ed66c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4500186
Commit-Queue: Dylan Cutler <dylancutler@google.com>
Reviewed-by: Peter Beverloo <peter@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1140174}
`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/browser/background_fetch
This CL was uploaded by git cl split.
R=peter@chromium.org
Bug: 1428566
Change-Id: Ic2421b389a402f52cfecc2a407585783626b2353
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4429424
Auto-Submit: Claudio DeSouza <cdesouza@igalia.com>
Reviewed-by: Peter Beverloo <peter@chromium.org>
Commit-Queue: Peter Beverloo <peter@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1131149}
Now that the circular dependency between browser_thread.h and
browser_task_traits.h has been resolved, browser_thread.h can include
browser_task_traits.h and provide a default ({}) for BrowserTaskTraits.
A bunch of includes in other files needed to be updated.
Bug: 1424788, 1026641, 1429044
Change-Id: Ibc44e495f743eee029fb45832b1084f03ca47555
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4402191
Reviewed-by: Gabriel Charette <gab@chromium.org>
Owners-Override: Gabriel Charette <gab@chromium.org>
Commit-Queue: Michael Thiessen <mthiesse@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1127199}
They were being taken as const pointers. This was due to overly strict
adherence to a line from the Google C++ style guide:
Generally, use std::optional to represent optional by-value inputs,
and use a const pointer when the non-optional form would have used
a reference.
While this may make sense in the general case of a function that takes
a value and uses it directly, without more context, it doesn't make
sense in the case of a constructor that stores the input as an
absl::optional, particularly when every since production caller of that
constructor already has the value in an optional. Having all of those
callers have to convert an optional to a pointer, only to have the
constructor covert it back into an optional adds a lot of unnecessary
complexity, and doesn't accomplish anything useful.
BUG: None
Change-Id: I1a51cfab8df385df6fff8ae7dc064e2438740315
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4326990
Commit-Queue: Matt Menke <mmenke@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Ayu Ishii <ayui@chromium.org>
Reviewed-by: Brianna Goldstein <brgoldstein@google.com>
Cr-Commit-Position: refs/heads/main@{#1118897}
Removes IsolationInfo::CreatePartial and updates the remaining two
uses of it.
In the case of
WellKnownChangePasswordNavigationThrottle::WillStartRequest,
an IsolationInfo is available, so use that instead of creating a
new IsolationInfo from the NIK (which may have less information when
we are experimenting with a 2.5-keyed NIK).
For BackgroundFetchServiceImpl::CreateForWorker, there's no
IsolationInfo available, but since this is called for Service
Workers, and a StorageKey is available, it seems logical to create
an IsolationInfo from that to align with what the Service Worker
itself will be partitioned by. This is similar to what's done in
RenderProcessHostImpl::BindRestrictedCookieManagerForServiceWorker.
Bug: 1414808
Change-Id: I1247fed903252becddf8fdc3f81589bedbbee677
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4247660
Reviewed-by: Vasilii Sukhanov <vasilii@chromium.org>
Reviewed-by: Rayan Kanso <rayankans@chromium.org>
Commit-Queue: Andrew Williams <awillia@chromium.org>
Reviewed-by: Matt Menke <mmenke@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1106625}
FOR REVIEWERS - This is a large CL, sorry about that. Please review just
the files you're an owner for. In almost all cases, the changes should
be minimal and straightforward.
There's a need to keep StorageKey and BlinkStorageKey partial sync, but
as each organically grew this has gotten lost. As we wrap up and launch
storage partitioning, we should leave this code in a good state.
This CL swaps out the origin constructor for a new static function
called CreateFirstParty. The reason for this is to ensure callsites know
that they are explicitly creating a first-party only StorageKey and
might be missing context important to partition storage. Further, if in
the future we were to want to deprecate this construction method in
prod, we would need a static function we could re-name like this
and so migrating to this style of syntax will make that easier.
This CL is part of a series:
(1) Organize public functions and map work
(2) Rename CreateFirstParty constructors
(3) Rename CreateWithNonce constructors
(4) Rename Create constructors
(5) Remove old test constructors
(6) Define opaque origin behavior
Bug: 1410254
Change-Id: I0be1305f91a454484c68d0faf4015bad3afe05ed
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4251237
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Steven Bingler <bingler@chromium.org>
Auto-Submit: Ari Chivukula <arichiv@chromium.org>
Commit-Queue: Ari Chivukula <arichiv@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1105850}
This structure previously held only an origin, with conversions to/from
StorageKey. This loses storage-partitioning information such as
`top_level_site` and `ancestor_chain_bit`.
With this change, the entire StorageKey is serialized into the metadata.
This metadata is stored on-disk, so the implementation must also handle
"old" values not containing a storage key. It handles this case by
generating a storage key from the existing `origin` field, which was
the existing behavior.
If both fields are missing, then the existing behavior remains: the
situation is interpreted as a storage key with an opaque origin.
Bug: 1402863
Change-Id: I5787acad27028e2d41fc030a7bc73a05c74b5c25
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4221513
Reviewed-by: Peter Beverloo <peter@chromium.org>
Code-Coverage: Findit <findit-for-me@appspot.gserviceaccount.com>
Reviewed-by: Andrew Williams <awillia@chromium.org>
Commit-Queue: Dustin Mitchell <djmitche@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1101891}
Icons for the home tab within the tab strip specified in the manifest are saved (without filtering) through proto. Icons are saved as ImageResource, keeping the same shape it is set as in the manifest.
Change-Id: I2cce28fc171e2fc238cf2bc8fdc4205a2b6a0fd2
Bug: 1381377
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4136334
Reviewed-by: Peter Beverloo <peter@chromium.org>
Reviewed-by: Eric Willigers <ericwilligers@chromium.org>
Commit-Queue: Eric Willigers <ericwilligers@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1094699}