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}
This CL fixes the regression from http://crrev.com/c/5373700 where code
caching for JS module scripts was broken.
Key changes:
- ScriptCachedMetadataHandler::SetSerializedCachedMetadata() is now
called in ScriptResource::SetSerializedCachedMetadata() even when
DisableOffThreadConsumeCache() was called.
- Stop creating ConsumeCodeCacheTask for module scripts in
BackgroundResourceScriptStreamer, because ModuleScript doesn't
support off-thread cache consumption.
Additional fix:
Set Cache-Control header for script resources in CodeCacheBrowserTest
to store the resource in the HTTPCache. Also added logic to clear
MemoryCache in CachingFromThirdPartyFrames tests to make sure that
Blink fetches the script resource again. (See
https://crrev.com/c//4554196/comment/e77b3615_033682a3/ for more
context.)
Bug: 357726254
Change-Id: I84d079b70f0ce46039e8bd6a61644ca950da8869
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5759035
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Tsuyoshi Horo <horo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1338921}
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}
This is a reland of commit 2278fa1f8a
See diff against PS1.
Fixed bad test setup in WebUIManagedInterfaceBrowserTest. Once
initialized ContentBrowserClient is expected to exist for the life
of the Chrome process.
This change avoids tearing down the test ContentBrowserClient
prematurely and aligns with how ContentBrowserClient is handled in
other content_browsertests.
Original change's description:
> [code cache] Extend GeneratedCodeCache logging for Chrome WebUI
>
> This CL extends metrics reporting for the WebUI specific
> GeneratedCodeCache. Chrome will now report cache behavior
>
> - Per request resource host. This helps improve understanding of
> how resources served by a specific WebUIDataSource are behaving.
> e.g. resources served by chrome://resources
>
> - Per origin lock. This helps improve understanding of how resources
> served for a specific origin are behaving.
> e.g. requests from multiple sources for a chrome://downloads load
>
> ContentBrowserClient has been extended to allow embedders to provide
> appropriate WebUI hostnames for logging while avoiding code layering
> violations.
>
> Logged WebUIs were chosen based on usage (see WebUI.CreatedForUrl).
>
> Bug: 40182411, 349683186
> Change-Id: Idb954f10fd76290a56bb42ca917401f27f5eae59
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5659029
> Commit-Queue: Thomas Lukaszewicz <tluk@chromium.org>
> Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com>
> Reviewed-by: Avi Drissman <avi@chromium.org>
> Reviewed-by: Jimmy Gong <jimmyxgong@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1322368}
Bug: 40182411, 349683186
Change-Id: I4269b1d0e50a554c10049fcdf285a7e6b1bacc30
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5667623
Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com>
Reviewed-by: Jimmy Gong <jimmyxgong@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Thomas Lukaszewicz <tluk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1322917}
This CL extends metrics reporting for the WebUI specific
GeneratedCodeCache. Chrome will now report cache behavior
- Per request resource host. This helps improve understanding of
how resources served by a specific WebUIDataSource are behaving.
e.g. resources served by chrome://resources
- Per origin lock. This helps improve understanding of how resources
served for a specific origin are behaving.
e.g. requests from multiple sources for a chrome://downloads load
ContentBrowserClient has been extended to allow embedders to provide
appropriate WebUI hostnames for logging while avoiding code layering
violations.
Logged WebUIs were chosen based on usage (see WebUI.CreatedForUrl).
Bug: 40182411, 349683186
Change-Id: Idb954f10fd76290a56bb42ca917401f27f5eae59
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5659029
Commit-Queue: Thomas Lukaszewicz <tluk@chromium.org>
Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Jimmy Gong <jimmyxgong@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1322368}
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}
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: 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}
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}
The changes of this CL are made using the following script.
```
target_directory="content/browser"
replace_string_in_files() {
old_string="$1"
new_string="$2"
find "$target_directory" -type f \( -name "*.cc" -o -name "*.h" \) \
-exec sed -i '' "s/$old_string/$new_string/g" {} +
}
delete_include() {
find "$target_directory" \( -name "*.h" -o -name "*.cc" \) -print0 | while IFS= read -r -d '' file; do
grep -v '#include "base/strings/string_piece.h"' "$file" > "$file.tmp" && mv "$file.tmp" "$file"
done
}
add_include() {
find "$target_directory" \( -name "*.h" -o -name "*.cc" \) -print0 | while IFS= read -r -d '' file; do
local include_added=false
local tempfile=$(mktemp)
if grep -qE 'std::(string|u16string)_view' "$file"; then
while IFS= read -r line; do
echo "$line" >> "$tempfile"
if [[ $line =~ ^\s*#include ]]; then
if ! $include_added; then
echo "#include <string_view>" >> "$tempfile"
include_added=true
fi
fi
done < "$file"
mv "$tempfile" "$file"
if $include_added; then
echo "Added #include <string_view> after the first include line in $file"
else
echo "No include line found in $file"
fi
else
echo "std::string_view not found in $file"
fi
done
}
replace_string_in_files "base::StringPiece16" "std::u16string_view"
replace_string_in_files "base::StringPiece" "std::string_view"
delete_include
add_include
```
Replaced base::StringPiece16 with std::u16string_view
Replaced base::StringPiece with std::string_view
Removed header "base/strings/string_piece.h"
Added header "<string_view>" where applicable
Bug: 40506050
Change-Id: I2bc22c79dd9a0c839745afe065123f7a53c4a5ca
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5401117
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Mike West <mkwst@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Reviewed-by: Will Harris <wfh@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1281746}
Previously, we generated local compile hints only when the page turned
interactive. It's possible that the user navigates away before that, so
in that case we didn't get any compile hints.
This CL makes us compile hints earlier, and when the page turns
interactive, we generate them again and replace the data.
We also add a histogram for observing how many navigations now
create compile hints data vs. how many would have created it in
the original version.
Bug: 40286622
Change-Id: Iec1bd1ec26a5fe870c456d1977109912cc560482
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5344969
Reviewed-by: Mike West <mkwst@chromium.org>
Reviewed-by: Charlie Reis <creis@chromium.org>
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1273270}
This is a reland of commit 90af84e33e.
Browsertest improvements:
- In the JS code of the extension, Wasm functions are called until all of them are optimised. In this change, once in a while we yield to the event loop by calling setTimeout().
- The flag "--wasm-tiering-budget" is set to 10 so that the optimised, TurboFan code is created right away.
- As it's not clear when the caching exactly happens, the test keeps opening new tabs (which triggers the execution of the JS code in the extension) and waiting until there is a cache hit. This makes the test more robust if the caching happens a bit later.
- Previously the test waited to see x hits and y misses after x+y loads of the extension. Now the test waits for x+y samples. This way we get an accurate error message if there is an issue and don't run into timeouts.
- Added logging for easier future debugging.
Original change's description:
> [wasm] Add wasm module caching for extensions with streaming
> instantiation
>
> Bug: v8:14518
> Change-Id: I896f85284d02feb089e095b8a925bd451bfee85e
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5117546
> Reviewed-by: Finnur Thorarinsson <finnur@chromium.org>
> Commit-Queue: Eva Herencsárová <evih@chromium.org>
> Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1256324}
Bug: v8:14518
Change-Id: I4ee455cf97cbf140d32a0ab1abcf3b2054ba750c
Cq-Include-Trybots: luci.chromium.try:linux_chromium_chromeos_msan_rel_ng
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5268792
Reviewed-by: Finnur Thorarinsson <finnur@chromium.org>
Commit-Queue: Eva Herencsárová <evih@chromium.org>
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Yoshisato Yanagisawa <yyanagisawa@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1258421}
The added content browsertest ensures that we produce and consume
local compile hints when running scripts.
To enable testing, this CL adds a capacity for making
InteractiveDetector ignore FCP - this is because the first paint never
happens in a content browser test, so without this the page would
never be detected as interactive.
Bug: chromium:1495723
Change-Id: Iceffed1244fbe4aa9048812653fd2874b59c703d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5024173
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1237944}
This cl makes CodeCacheBrowserTest run with BackgroundResourceFetch
feature disabled even when we will enable BackgroundResourceFetch
feature enabled by default.
Bug: 1379780
Change-Id: Ia48bff7b757f41a0068af3cbd88dd4c123a164bf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5004282
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Tsuyoshi Horo <horo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1221432}
This CL introduces BackgroundCodeCacheHost class which is created in the
main thread, and passed to the background thread to load code cache on
the background thread.
This CL only has an effect if the BackgroundResourceFetch feature is
enabled.
Bug: 1379780
Change-Id: Iaf7c4adfbf6ab7fc035acfabe4bea9ce65a1de13
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4982988
Reviewed-by: Yoshisato Yanagisawa <yyanagisawa@chromium.org>
Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
Commit-Queue: Tsuyoshi Horo <horo@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1218594}
There are two headers to declare features in content.
- the public one: `content/public/common/content_features.h`
- the private one: `content/common/features.h`.
Unfortunately, most are declared in the public one, despite being used
privately exclusively. This violate the `content/public/` rules. This
patches provides a fix.
Parts of this patch was made programmatically using this script:
https://paste.googleplex.com/6699322946093056, with the following
output: https://paste.googleplex.com/5591288895242240
This patch:
1. Update `docs/how_to_add_your_feature_flag.md` to incentive
developers to the non public versions.
2. Move ~70 features back into the private version.
3. Programmatically update the includes to include the correct
#include header(s).
4. For consistency and minimizing the amount of files modified,
the two headers to use the `features::` namespace.
AX-Relnotes: n/a.
Change-Id: Id9126a95dfbc533d4778b188b659b5acc9b3d9e3
Bug: None
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4836057
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1194718}
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}
Adds one test for frame contexts, and another that we can use
to test generated code cache usage by shared workers if that gets
implemented at some point.
Bug: 964467, 1445719
Change-Id: I822e7115ffadee15baea5082a7b1c01041248ea0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4554196
Commit-Queue: Andrew Williams <awillia@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1149679}
Turns out there's a lot of includes, so these will have to be removed
before deleting the implementation of the task runner handles.
To allow the deletion of the task runner handle headers, add
the sequenced/thread task runner handles where they are used in
the codebase with scripts.
This was done with an automated change, with a few touchups afterwards.
The code for the mass-refactor changes are here:
python:
https://paste.googleplex.com/5534570878337024
shell:
https://paste.googleplex.com/6466750748033024
In terms of touchups:
- add sequenced/thread task runner handles to
the third_party/blink/public/DEPS, because multiple files were using
it transitively anyways.
- rewrite certain parts of the codebase which used
ThreadTaskRunnerHandles instead of CurrentDefaultHandles.
- fix a compile issue with forward-declaration in
extensions/browser/extension_file_task_runner.h.
AX-Relnotes: n/a.
Bug: 1026641
Change-Id: I737ef32aee4e77c21eaa3a2bdc403a28322cf1b7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4133323
Owners-Override: Gabriel Charette <gab@chromium.org>
Commit-Queue: Sean Maher <spvw@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1090532}
constexpr enum expressions for enums without fixed underlying type must
now be in the range of the enum type.
The biggest change is that the 3-arg form of UMA_HISTOGRAM_ENUMERATION now
requires its enum arg to have a fixed underlying type (see bug for details),
so add a whole bunch of underlying types.
Fix other issues by slightly reordering arithmetic, or by making some
values const instead of constexpr.
No intended behavior change.
Bug: 1348574
Change-Id: I59d06a095c20ec1c2a5eea5928c73793f89856ab
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3796909
Reviewed-by: Hans Wennborg <hans@chromium.org>
Commit-Queue: Alexei Svitkine <asvitkine@chromium.org>
Owners-Override: Nico Weber <thakis@chromium.org>
Auto-Submit: Nico Weber <thakis@chromium.org>
Reviewed-by: Alexei Svitkine <asvitkine@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1030177}
When including a NetworkIsolationKey in the cache key, and the
NetworkIsolationKey is transient, return absl::nullopt. Previously it
would return an empty string, which would cause cross-site leaks if it
were ever actually used as a cache key.
Also make NetworkIsolationKey::ToString() return an optional, and return
nullopt if transient, for the exact same reason. Rename ToString() to
ToCacheString(), since DCHECK_EQ(nik, nik) expects ToString() to return
a std::string. Also Migrate those DCHECK_EQs to DCHECK(nik==nik).
Bug: None
Change-Id: I4c7f9a2ff16755aff8d5a7590eb8877a16d3611e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3777742
Reviewed-by: Kenichi Ishibashi <bashi@chromium.org>
Reviewed-by: Kunihiko Sakamoto <ksakamoto@chromium.org>
Commit-Queue: Matt Menke <mmenke@chromium.org>
Reviewed-by: Bo Liu <boliu@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1027064}
This is the last remaining method in disk_cache.h that takes an out pointer while being able to execute both synchronously and asynchronously, which requires highly error-prone lifetime management of the destination.
The changed version simply produces a unique_ptr by value, either as return value or via callback.
HttpCache::GetBackend still has a similar issue, but it would be too much to handle in this one CL, and it's also different in that it's not a factory method, and both the callback invocation and lifetime of the disk_cache::Backend it returns are tied to the underlying HttpCache, so it likely needs a different solution (like it reporting success/failure, and users using HttpCache::GetCurrentBackend to make the lifetime dependency obvious).
Bug: 854716
Change-Id: I79807021c74ffadbe0acd62145345f887626f1fd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3688361
Reviewed-by: Bo Liu <boliu@chromium.org>
Commit-Queue: Maks Orlovich <morlovich@chromium.org>
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Reviewed-by: Marijn Kruisselbrink <mek@chromium.org>
Reviewed-by: Derek Schuff <dschuff@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1017654}