0
Commit Graph

132 Commits

Author SHA1 Message Date
Evan Stade
1611e721f8 More IWYU for protobuf roll
Bug: 328417294
Change-Id: I40b5fb3d58969c7005d765732d631cd7ee5a07d1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6196478
Reviewed-by: Joshua Bell <jsbell@chromium.org>
Auto-Submit: Evan Stade <estade@chromium.org>
Commit-Queue: Evan Stade <estade@chromium.org>
Commit-Queue: Joshua Bell <jsbell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1411084}
2025-01-24 11:36:19 -08:00
Etienne Noel
9159ebd8cc Removes ex-storage team as owners from datatransfer and font_access.
Change-Id: I71b409bb33d66b7a2ba8e9ade2cd84f881764694
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6179531
Reviewed-by: Ayu Ishii <ayui@chromium.org>
Reviewed-by: Christine Hollingsworth <christinesm@chromium.org>
Commit-Queue: Etienne Noël <etiennenoel@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1407552}
2025-01-16 13:36:58 -08:00
Takuto Ikuta
4388419a3a content: fix missing includes for protobuf roll
Bug: 40263312
Change-Id: I5c78121ac5c6c25b0721c912732cec67040cd31b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6171761
Auto-Submit: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1406567}
2025-01-15 00:33:17 -08:00
Emily Andrews
d15fd76ecb Change RenderProcessHost::GetID to RenderProcessHost::GetDeprecatedID
This change bulk changes RenderProcessHost::GetID to
RenderProcessHost::GetDeprecatedID to support the transition to a
strongly typed ChildProcessId.

Bug: 379869738
Change-Id: Ib0c991536486ef29702ea166cdcf12ea68ed70ee
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6065543
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Owners-Override: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Commit-Queue: Emily Andrews <emiled@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1394500}
2024-12-10 20:41:54 +00:00
danakj
5a9a4a9b49 Deprecate SharedMemoryRegion memory(), replace it with data() and spans
The accessor returns an unbounded void* which is dangerous to use.
Callers should instead use GetMemoryAsSpan() or GetMemoryAs(). To ease
this we introduce `uint8_t* data()` which allows SharedMemoryMappings
to convert implicitly or explicitly to base::span<uint8_t>.

We enable unsafe-buffer-usage warning in the shared memory unit tests,
which mostly required changing tests to use span apis instead of
working with the unbounded pointer accessor. The span apis
return the same pointer but with a length attached.

Other code is changed to span(mapping), GetMemoryAsSpan() or
GetMemoryAs(). These require the types being pulled out of shared
memory are trivially copyable. However a couple classes used in this
way in devices were _not_ trivially copyable. This can cause UB.
These classes wanted to be trivially copyable but could not be
because of the out-of-line ctor requirements of the chromium clang
plugin. So we template these and use a type alias to avoid rewriting
1000 LOC with useless template arguments. This works around the clang
plugin for now.

R=lukasza@chromium.org

Bug: 40284755, 355003174
Change-Id: Id7fd4c9bcf0b86b8109134c18740453bb24aa5de
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5734584
Reviewed-by: James Cook <jamescook@chromium.org>
Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org>
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: danakj <danakj@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com>
Reviewed-by: Jonathan Ross <jonross@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1333755}
2024-07-26 20:30:47 +00:00
Nasko Oskov
ee48dfb4fa Prepare to remove //content/ from unsafe_bufers_paths.txt
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}
2024-06-08 05:13:06 +00:00
Thomas Nguyen
23593332d9 [PEPC] Get permission status should take into account device status
This CL create a new function to retrieve permission status, including
OS permission status, continue the previous CL
https://crrev.com/c/5483406.

Although we intend to eventually incorporate permission queries that
include OS permission status, this function is currently only used for PEPC.

Fixed: 335834559
Change-Id: I21c47dee4cb94e7935e33ff822fc4b04aa63c88a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5545382
Reviewed-by: Kamila Hasanbega <hkamila@chromium.org>
Reviewed-by: Charlie Reis <creis@chromium.org>
Reviewed-by: Eric Seckler <eseckler@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Mason Freed <masonf@chromium.org>
Reviewed-by: Luc Nguyen <lucnguyen@google.com>
Commit-Queue: Thomas Nguyen <tungnh@chromium.org>
Reviewed-by: Kamila Hasanbega <hkamila@google.com>
Reviewed-by: Peter Beverloo <peter@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1306424}
2024-05-27 14:52:11 +00:00
Alison Gale
923a33e9d5 Migrate TODOs referencing old crbug IDs to the new issue tracker IDs
The canonical bug format is TODO(crbug.com/<id>). TODOs of the
following forms will all be migrated to the new format:

- TODO(crbug.com/<old id>)
- TODO(https://crbug.com/<old id>)
- TODO(crbug/<old id>)
- TODO(crbug/monorail/<old id>)
- TODO(<old id>)
- TODO(issues.chromium.org/<old id>)
- TODO(https://issues.chromium.org/<old id>)
- TODO(https://issues.chromium.org/u/1/issues/<old id>)
- TODO(bugs.chromium.org/<old id>)

Bug id mapping is sourced from go/chrome-on-buganizer-prod-issues.
See go/crbug-todo-migration for details.

#crbug-todo-migration

Bug: b/321899722
Change-Id: 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}
2024-04-22 23:34:28 +00:00
Arthur Sonzogni
f07f24815d Cleanup: Remove unused <optional> in content/
Script:
```
cd content

comm -13 \
 <(
   (
     git grep -l "std::make_optional";
     git grep -l "std::optional";
     git grep -l "std::nullopt";
     git grep -l "std::in_place";
     git grep -l "std::in_place_t";
   ) | cut -f1 -d: \
     | grep \
       -e "\.h" \
       -e "\.cc" \
       -e "\.mm" \
     | sort \
     | uniq
  ) \
 <(
   (
   git grep "#include <optional>"
   ) | cut -f1 -d: \
     | grep \
       -e "\.h" \
       -e "\.cc" \
       -e "\.mm" \
     | sort \
     | uniq
  ) \
  | xargs sed -i "s/#include <optional>//g"

cd ..

echo "Formatting"

echo "IncludeBlocks: Regroup" >> ".clang-format"
echo "IncludeIsMainRegex: \"(_(android|apple|chromeos|freebsd|fuchsia|fuzzer|ios|linux|mac|nacl|openbsd|posix|stubs?|win))?(_(unit|browser|perf)?tests?)?$\"" >> ".clang-format"
git cl format
git restore ".clang-format"

git cl format
```

Bug: chromium:1500249
Change-Id: I0302576941b2002d4175af119e1c894c3be37681
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5380322
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Commit-Queue: Alex Moshchuk <alexmos@chromium.org>
Auto-Submit: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1275803}
2024-03-20 20:21:43 +00:00
Hiroshige Hayashizaki
b5e8a122c9 Remove redundant content:: for GetUIThreadTaskRunner/BrowserTaskType
Follow-up of
https://chromium-review.googlesource.com/c/chromium/src/+/5276439/comment/7e9833fe_c465c594/

AX-Relnotes: n/a.
Bug: 1403746
Change-Id: Ia7d838385677d350b803a855271182358acb1468
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5314820
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1265192}
2024-02-26 14:44:07 +00:00
Jeff Yoon
d1328c4408 [buganizer] Migrate DIR_METADATA in content/browser/
Migrate all metadata files for content/browser.

Verify components with http://b/components/{id} or at
go/chrome-on-buganizer-prod-components.

Bug: chromium:1518875
Change-Id: I555b9fe40952a5707e167b3dcbaf2858bbdf1f34
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5284095
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1258966}
2024-02-11 19:24:26 +00:00
Arthur Sonzogni
c686e8f4fd Rename {absl => std}::optional in //content/
Automated patch, intended to be effectively a no-op.

Context:
https://groups.google.com/a/chromium.org/g/cxx/c/nBD_1LaanTc/m/ghh-ZZhWAwAJ?utm_medium=email&utm_source=footer

As of https://crrev.com/1204351, absl::optional is now a type alias for
std::optional. We should migrate toward it.

Script:
```
function replace {
  echo "Replacing $1 by $2"
  git grep -l "$1" \
    | cut -f1 -d: \
    | grep \
      -e "^content" \
    | sort \
    | uniq \
    | grep \
      -e "\.h" \
      -e "\.cc" \
      -e "\.mm" \
      -e "\.py" \
    | xargs sed -i "s/$1/$2/g"
}
replace "absl::make_optional" "std::make_optional"
replace "absl::optional" "std::optional"
replace "absl::nullopt" "std::nullopt"
replace "absl::in_place" "std::in_place"
replace "absl::in_place_t" "std::in_place_t"
replace "\"third_party\/abseil-cpp\/absl\/types\/optional.h\"" "<optional>"
git cl format
```

# Skipping unrelated "check_network_annotation" errors.
NOTRY=True

Bug: chromium:1500249
Change-Id: Icfd31a71d8faf63a2e8d5401127e7ee74cc1c413
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5185537
Auto-Submit: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Owners-Override: Avi Drissman <avi@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1245739}
2024-01-11 08:36:37 +00:00
shaochenguang
3a1af3d254 Fix header guards in content/.
Generated mechanically as follows:

git ls-files '*.h' | grep -E '^content/' | \
    xargs parallel cpplint.py --filter=-,+build/header_guard -- 2>&1 | \
    grep build/header_guard | tools/apply_cpplint_header_guard.py

Bug: 1200694
Change-Id: I5518d2dbc6184f920d2b145c4c8209ae05090ecb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5052212
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Alex Gough <ajgo@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1229527}
2023-11-27 21:36:51 +00:00
Avi Drissman
e0eb4161ea Remove uses of implicit conversion of ScopedTypeRef in /content
Implicit unwrapping of a scoper to its underlying pointer is dangerous
and that capability is being removed. This converts uses of implicit
conversion to be explicit in preparation for its removal, and performs
other cleanup and modernization.

Bug: 1495439
Low-Coverage-Reason: LARGE_SCALE_REFACTOR Switching from implicit to explicit
Change-Id: I455cff8584d3842ed51384aa21be1a5e2d032590
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4980069
Commit-Queue: Avi Drissman <avi@chromium.org>
Reviewed-by: Leonard Grey <lgrey@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1216299}
2023-10-27 19:15:50 +00:00
Julie Jeongeun Kim
852454c2e2 [ios] Add FontEnumerationDataSource
This CL includes FontEnumerationDataSourceMac in iOS to support
`Local Font Access API`.

Bug: 1487133
Change-Id: Ib420038ad3ff8cad3cd6a495b55a38d9bb440696
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4896697
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Commit-Queue: Julie Jeongeun Kim <jkim@igalia.com>
Cr-Commit-Position: refs/heads/main@{#1202279}
2023-09-28 04:08:22 +00:00
Andy Paicu
0a6d4b5069 [PEPC] Add new structs to contain permission request data
This CL adds new struct PermissionRequestDescription and
PermissionRequestData that groups all information we will need to make
a permission request to permission infrastructure.
This is one in a series of CLs implementing the design:
https://docs.google.com/document/d/1a1gjlJ4VkAWoG8AeGKZDcQXm_c0q-cFTs_5MxmjWVYI/edit, next step is to parse the fields within the structs handle permission request from <permission> element properly.

Bug: 1271543,1462930
Change-Id: I4a7b64149bc3323075f802f832766aa2211455fc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4756727
Commit-Queue: Andy Paicu <andypaicu@chromium.org>
Reviewed-by: Peter Beverloo <peter@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Kamila Hasanbega <hkamila@chromium.org>
Reviewed-by: Yuchen Liu <yucliu@chromium.org>
Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
Reviewed-by: Florent Castelli <orphis@chromium.org>
Reviewed-by: Eric Seckler <eseckler@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1189522}
2023-08-29 15:13:09 +00:00
Avi Drissman
28154a6fbb Move ScopedTypeRef and ScopedCFTypeRef into base:🍎:
This moves these two types into the base:🍎: namespace.

This also rolls Crashpad:

Update Crashpad to a736f7d070c872a4cc786c31755fd769fb2e50b3

50ce1550a1ca [fuchsia] Move //zircon/public/lib/zx to
             //zircon/system/ulib/zx
a736f7d070c8 Roll mini_chromium putting /base/apple files into
             base:🍎:

Fixed: 1474628
Change-Id: I3d529e6b6f4a6e48bc9edc2df830f9c2418ca678
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4799213
Owners-Override: Avi Drissman <avi@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Auto-Submit: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1186262}
2023-08-22 04:06:45 +00:00
Avi Drissman
eac566b060 Move foundation_util to base/apple, leave a forwarding header
Crashpad is not yet updated for the new location, so leave a
forwarding header to be removed later.

Skipping trybots. This is a Mac change, and it’s passing all
trybots except for android_optional_gpu_tests_rel that is
repeatedly failing on an unrelated issue.

NOTRY=true

Bug: 1444927
Cq-Include-Trybots: luci.chrome.try:mac-chrome
Change-Id: Iad0c903187b0e1e5584c68f2eb00b5b026085596
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4790744
Owners-Override: Avi Drissman <avi@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Auto-Submit: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1185029}
2023-08-18 02:56:21 +00:00
Avi Drissman
a09d7dda2e Move scoped_cftypreref to base/apple, leave a forwarding header
Crashpad is not yet updated for the new location, so leave a
forwarding header to be removed later.

Bug: 1444927
Change-Id: Ib00aa68980726f7702f740d543953abe397ffddc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4790741
Owners-Override: Avi Drissman <avi@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
Auto-Submit: Avi Drissman <avi@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1184758}
2023-08-17 16:26:58 +00:00
Avi Drissman
9bf75c5e9a Remove ARC boilerplate in /content
ARC is now enabled by default, so there’s no need to enforce it
against files being put into non-ARC targets.

Bug: 1468376
Change-Id: If25307bfbea5a1df8937b433dde5fa83871cff74
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4738888
Auto-Submit: Avi Drissman <avi@chromium.org>
Reviewed-by: Leonard Grey <lgrey@chromium.org>
Commit-Queue: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1178112}
2023-08-01 22:39:26 +00:00
Avi Drissman
d6b97c1b31 Convert /content/browser to use ARC
See https://chromium.googlesource.com/chromium/src/+/main/docs/mac/arc.md
for information about this conversion.

Bug: 1280317
Change-Id: I9e8fb0c2f74c55acef207ebdb866752e059af60c
Include-Ci-Only-Tests: true
Cq-Include-Trybots: luci.chromium.try:ios-blink-dbg-fyi
Cq-Include-Trybots: luci.chrome.try:mac-chrome
Validate-Test-Flakiness: skip
Low-Coverage-Reason: Doing core refactoring across all of Chromium; I do not own this code
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4658680
Reviewed-by: Leonard Grey <lgrey@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1166661}
2023-07-06 18:02:40 +00:00
hisbilir
d49444e064 Skip local fonts with invalid attributes during font enumeration on Mac.
It seems Mac OS allows installing fonts with invalid attributes although
the font verification during install detects it. Updated the local font
access code on Mac to skip such fonts during enumeration when Chrome
receives null for the attributes from Mac OS.

Bug: 1422669
Change-Id: Idbf164ccfb2306de2705b5f8eca4a68efb312d30
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4596377
Commit-Queue: Hakan Isbiliroglu <hisbilir@chromium.org>
Reviewed-by: Ayu Ishii <ayui@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1159032}
2023-06-16 20:33:29 +00:00
Avi Drissman
adac219925 Update header includes for /base/functional in /content
bind.h, callback.h, callback_forward.h, and callback_helpers.h
moved into /base/functional/. Update the include paths to
directly include them in their new location.

Bug: 1364441
Change-Id: I32ec425b9c0e52ec4b50047bf3290fecc5c905ff
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4148554
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Auto-Submit: Avi Drissman <avi@chromium.org>
Owners-Override: Avi Drissman <avi@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1091567}
2023-01-11 23:46:39 +00:00
Sean Maher
e672a665ff task posting v3: remove includes of runner handles and IWYU task runners
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}
2023-01-09 21:42:28 +00:00
Keith Lee
d41880c794 Remove ability to append strings to NOTIMPLEMENTED_LOG_ONCE
This is a pattern that does nothing. It's used in many places, but the
string is just eaten by EAT_CHECK_PARAMS and is never logged.

However, many devs seem to assume this logs the message passed to it.
This pattern continues to be used as recently as
https://crrev.com/c/2575001 and can be easily found here:
https://source.chromium.org/search?q=NOTIMPLEMENTED_LOG_ONCE%5C(%5C)%5C%20%5C%3C%5C%3C

As this param does nothing, make it so that the code is no longer valid
by removing the eat check params, so devs don't falsely assume the
pattern actually logs.

The original idea for this was suggested by Lei Zhang in
https://crrev.com/c/4027162.

Bug: 1392445

Change-Id: I9d5c2d7b8e48436b2ec819425903a4ba9aa755d4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4096037
Owners-Override: Nico Weber <thakis@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Keith Lee <keithlee@chromium.org>
Reviewed-by: Peter Boström <pbos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1082189}
2022-12-13 02:58:25 +00:00
Daniel Cheng
ccd5b41390 Use base::test::FeatureRef for feature vectors in //content.
A base::Feature should not be copyable; a feature is intended to have a
single global instance, as it caches internal mutable state.

Feature vectors in conjunction with `base::test::ScopedFeatureList` are
by far the most common use of the base::Feature copy constructor. This
is a mostly automated replacement of `std::vector<base::Feature>` with
`std::vector<base::test::FeatureRef>` to remove that dependency.

This CL was uploaded by git cl split.

R=nasko@chromium.org

Bug: 1370572
Change-Id: Iecfb813c08c475e042234aab91577cff999b4101
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3933905
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Auto-Submit: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1055143}
2022-10-05 06:20:45 +00:00
Arthur Hemery
c2f98e3d1b Remove hidden header dependency.
browsing_context_state.h includes browsing_instance.h but would be fine
with just BrowsingInstanceId. This include is used unknowingly
by other files that construct BrowserContext's sometimes without even
importing browsing_context_state.h in the first place.

Replace browsing_instance.h import by browsing_instance_id.h and
add explicit dependencies where needed.

Change-Id: I629af039b886aa0ce37a3faab1007aca24ffbfbe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3926070
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Arthur Hemery <ahemery@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1054176}
2022-10-03 15:37:26 +00:00
Avi Drissman
4e1b7bc33d Update copyright headers in content/
The methodology used to generate this CL is documented in
https://crbug.com/1098010#c34.

No-Try: true
No-Presubmit: true
Bug: 1098010
Change-Id: I8c0f009d16350271f07d8e5e561085822cc9dd27
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3895935
Owners-Override: Avi Drissman <avi@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
Auto-Submit: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1047456}
2022-09-15 14:03:50 +00:00
Dave Tapuska
327c06c9c7 Rename GetMainFrame to GetPrimaryMainFrame
Progressively rename some usages of GetMainFrame to GetPrimaryMainFrame.

This is an automated change via git grep & sed.

BUG=1250404

Change-Id: I5e8fda4f11104cf9fcde8a690a33dc6ab7c34f3f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3696741
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1013636}
2022-06-13 20:31:51 +00:00
Illia Klimov
27239edc5a The permissions API code cleanup.
PermissionManager contains duplicated methods that differentiate by permissions type enum (ContentSettingsType vs PermissionType). This CL removed most of the ContentSettingsType-related methods, because they had limited usage, mostly in tests.

Methods removed from PermissionManager:
* RequestPermission(ContentSettingsType)
* RequestPermissions(ContentSettingsType)
* RequestPermissionFromCurrentDocument
(ContentSettingsType)
* PermissionManager::RequestPermissionsFromCurrentDocument
(ContentSettingsType)
* GetPermissionStatusForFrame(ContentSettingsType)
* GetPermissionStatusForWorker(ContentSettingsType)
* GetPermissionStatusForFrame(PermissionType)

Methods removed from PermissionControllerDelegate:
* GetPermissionStatusForFrame(PermissionType)

Methods added to PermissionControllerDelegate:
* RequestPermissionsFromCurrentDocument(PermissionType)

Methods added to PermissionManager:
* RequestPermissionsFromCurrentDocument(PermissionType)

Bug: 1271543
Change-Id: I7c718e3a1a390cd5be6f143ad8f7a07477473e3a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3599030
Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
Commit-Queue: Peter Kvitek <kvitekp@chromium.org>
Reviewed-by: Ravjit Uppal <ravjit@chromium.org>
Reviewed-by: Sean Topping <seantopping@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Illia Klimov <elklm@google.com>
Reviewed-by: Michael Bai <michaelbai@chromium.org>
Reviewed-by: Florent Castelli <orphis@chromium.org>
Reviewed-by: Peter Kvitek <kvitekp@chromium.org>
Quick-Run: Peter Kvitek <kvitekp@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1002151}
2022-05-11 17:14:59 +00:00
Andy Paicu
a6d6d85580 Remove content::PermissionType references and replace them with...
...blink::PermissionType

This is a follow-up of https://chromium-review.googlesource.com/c/chromium/src/+/3359620
which moved PermissionType to blink but left a `using` statement to
avoid modifying a large amount of files in an already complicated
enough CL.

This CL removes that statement and modifies all references to use the
blink type.

Bug: 1122423
Change-Id: Ia2e992d1cb1456bbba72c4d9ee38b74fca8cab1e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3593199
Commit-Queue: Andy Paicu <andypaicu@chromium.org>
Reviewed-by: Clark DuVall <cduvall@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Illia Klimov <elklm@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Eugene Zemtsov <eugene@chromium.org>
Reviewed-by: Joshua Bell <jsbell@chromium.org>
Reviewed-by: Eric Seckler <eseckler@chromium.org>
Reviewed-by: Peter Beverloo <peter@chromium.org>
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Reviewed-by: Sean Topping <seantopping@chromium.org>
Reviewed-by: Daseul Lee <dslee@chromium.org>
Reviewed-by: Kevin Marshall <kmarshall@chromium.org>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#997288}
2022-04-28 18:08:36 +00:00
Daseul Lee
cd631a57e7 [Local Fonts] Handle unsupported platform (Android) and permission denied case by throwing an error.
This change partially reverts crrev/c/3547299, as the new decision is to hide the API on Android instead of returning an empty set.

Bug: 1296792
Change-Id: I5ba666d40d2a6ccaf7d33d4420cec37daf8b0e69
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3597990
Reviewed-by: Ayu Ishii <ayui@chromium.org>
Commit-Queue: Daseul Lee <dslee@chromium.org>
Cr-Commit-Position: refs/heads/main@{#995236}
2022-04-22 17:21:48 +00:00
Joshua Bell
2ffc8f1308 Local Font Access: Add dslee@ to OWNERS
Change-Id: I939b89352b406f365f8ee8624e2c25af5651bb62
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3587140
Reviewed-by: Ayu Ishii <ayui@chromium.org>
Reviewed-by: Daseul Lee <dslee@chromium.org>
Commit-Queue: Joshua Bell <jsbell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#993333}
2022-04-18 16:25:22 +00:00
Daseul Lee
16f349573d Update navigator.fonts.query() to self.queryLocalFonts().
Spec PR: https://github.com/WICG/local-font-access/pull/80

This change updates font_manager to font_access, a supplement to window that directly exposes `queryLocalFonts()` method. It also updates the regular WPTs and deletes the obsolete origin trial WPT.

Bug: 1312603
Change-Id: I7c962f5c326f4b945944dbfa939c674bbe71b958
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3584655
Reviewed-by: Austin Sullivan <asully@chromium.org>
Reviewed-by: Ayu Ishii <ayui@chromium.org>
Commit-Queue: Daseul Lee <dslee@chromium.org>
Cr-Commit-Position: refs/heads/main@{#992670}
2022-04-14 19:37:11 +00:00
Daseul Lee
5ff70483ba [Local Fonts] Rename permission name from FONT_ACCESS to LOCAL_FONTS.
The feature isn't launched yet, and per spec change request (https://crbug.com/1312577#c2), we are modifying the externally visible names first, followed by internal names in the codebase.

Bug: 1312577
Change-Id: I5bb953c5f1b615ffa59307057533a8ceb3a1b850
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3570254
Reviewed-by: Victor Costan <pwnall@chromium.org>
Reviewed-by: Nate Fischer <ntfschr@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Kamila Hasanbega <hkamila@chromium.org>
Commit-Queue: Daseul Lee <dslee@chromium.org>
Cr-Commit-Position: refs/heads/main@{#990518}
2022-04-08 19:02:50 +00:00
Victor Costan
62df799cca Update OWNERS around Storage.
Change-Id: Ic2fb2c500aee1f0432923ac6f5d8c46333b846a1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3566213
Reviewed-by: Ayu Ishii <ayui@chromium.org>
Reviewed-by: Austin Sullivan <asully@chromium.org>
Commit-Queue: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/main@{#988220}
2022-04-02 01:49:13 +00:00
Daseul Lee
2e16b34d68 Update README.md for Font Access API.
Change-Id: Ic1be80a3e7144327fe0ddc040fa2eb2bbe95d074
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3564616
Reviewed-by: Victor Costan <pwnall@chromium.org>
Commit-Queue: Daseul Lee <dslee@chromium.org>
Cr-Commit-Position: refs/heads/main@{#988128}
2022-04-01 21:52:21 +00:00
Daseul Lee
b5c6829c03 Rename FontMetadata to FontData in Blink IDL.
Blink implementation class remains as blink::FontMetadata since there is blink::FontData class already. The class names should be resolved in a future clean-up CL.

Bug: 1311102
Change-Id: Idc070d704f3b0092ed33d652c1dd9c8804b83fe9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3556642
Reviewed-by: Victor Costan <pwnall@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Daseul Lee <dslee@chromium.org>
Cr-Commit-Position: refs/heads/main@{#987929}
2022-04-01 15:47:19 +00:00
Gabriel Charette
bdd68018e8 [base] Remove unused post_task.h includes
This CL is a no-op.

Bug: 1026641
AX-Relnotes: n/a
Change-Id: If45d30e748b65097bb6be666dc305c27183d83ef
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3555247
Commit-Queue: Gabriel Charette <gab@chromium.org>
Auto-Submit: Gabriel Charette <gab@chromium.org>
Reviewed-by: Francois Pierre Doray <fdoray@chromium.org>
Commit-Queue: Francois Pierre Doray <fdoray@chromium.org>
Owners-Override: Francois Pierre Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/main@{#987328}
2022-03-31 04:00:05 +00:00
Daseul Lee
621cc4ecb1 Rename QueryOptions.select to QueryOptions.postscriptNames, and update
the empty list for postscriptNames match no fonts, instead of matching
all fonts.

Change-Id: Id361587a0316af3c7512f28c1e60cb47fe3d7611
Bug: 1310341,1310389
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3556637
Reviewed-by: Victor Costan <pwnall@chromium.org>
Commit-Queue: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/main@{#986580}
2022-03-29 17:41:49 +00:00
Daseul Lee
c4bf2a64b8 Rename font_access_manager_impl to font_access_manager.
Change-Id: I3e38608b19c1fdc028957e19124c66a4c0af0a73
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3549676
Reviewed-by: Victor Costan <pwnall@chromium.org>
Reviewed-by: Jonathan Ross <jonross@chromium.org>
Commit-Queue: Daseul Lee <dslee@chromium.org>
Cr-Commit-Position: refs/heads/main@{#985391}
2022-03-25 18:23:59 +00:00
Daseul Lee
c21bd10dd1 Return an empty font list when the permission is not given, or platform implementation is missing (e.g. Android). Also, remove the unused kCanceled status.
Previously in the case of unsupported platform, the browser-side code returned FontEnumerationStatus::kUnexpectedError, while the renderer side handled FontEnumerationStatus::kUnimplementedError even though it would never been thrown under any case. We fix that behavior by updating the browser-side to throw an UnimplementedError, which the renderer handles by returning an empty font list. In general, the browser-side will provide specific information about font enumeration status, and the renderer-side will handle how users will receive the response. Similarly for permission denied or not given cases, the renderer-side will process FontEnumerationStatus::kPermissionDenied into an empty font list.

Bug: 1296792
Change-Id: I5c936a176d49453d3494bbc952831f83512c7db4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3547299
Reviewed-by: Victor Costan <pwnall@chromium.org>
Reviewed-by: Matthew Denton <mpdenton@chromium.org>
Commit-Queue: Daseul Lee <dslee@chromium.org>
Cr-Commit-Position: refs/heads/main@{#985005}
2022-03-24 21:01:33 +00:00
Illia Klimov
f28428456b Add GPSForCurrentDocument() into PermissionControllerDelegate.
As part of the Permission API hardening go/permissions-api-hardening
GetPermissionStatusForCurrentDocument was previously added in
PermissionController. This CL adds
GetPermissionStatusForCurrentDocument into all
PermissionControllerDelegate implementations.

Bug: 1271543
Change-Id: I4d5549aba621891e0745866e739fafbc1b142038
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3525774
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Andy Paicu <andypaicu@chromium.org>
Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
Reviewed-by: Sean Topping <seantopping@chromium.org>
Reviewed-by: Michael Bai <michaelbai@chromium.org>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Commit-Queue: Illia Klimov <elklm@chromium.org>
Cr-Commit-Position: refs/heads/main@{#983759}
2022-03-22 11:33:39 +00:00
Daseul Lee
bc16030bcd Update Font Access API tests.
- Add a WPT test case to check for calling blob() from detached frame.
- Add an additional test case for invalid query in font_access_manager_impl_browsertest.
- Check for SharedMemoryMapping validity in font_access_manager_impl_unittest.

Change-Id: Id510aaa6d6e425c40b99ac1d6b7b7b6800f602ec
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3536428
Reviewed-by: Victor Costan <pwnall@chromium.org>
Commit-Queue: Daseul Lee <dslee@chromium.org>
Cr-Commit-Position: refs/heads/main@{#982907}
2022-03-18 22:10:51 +00:00
Illia Klimov
a181b7dda5 Add new API into PermissionController.
This CL adds the following APIs:
1. `RequestPermission()`
2. `RequestPermissionFromCurrentDocument()`

More details here:
go/permission-controller
go/permission-manager-hardening

Bug: 1271543
Change-Id: I80f1ae00aa1ef0afabd00999a89bd58397a5d678
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3498341
Reviewed-by: Andy Paicu <andypaicu@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Victor Costan <pwnall@chromium.org>
Commit-Queue: Illia Klimov <elklm@google.com>
Cr-Commit-Position: refs/heads/main@{#981014}
2022-03-15 08:17:47 +00:00
Illia Klimov
4a2cb19aef Add PermissionController::GetPermissionsStatusFor* APIs.
This CL adds the following APIs:
1. GetPermissionStatusForServiceWorker()
2. GetPermissionStatusForCurrentDocument()
3. GetPermissionStatusForOriginWithoutContext()

`GetPermissionStatusForOriginWithoutContext()` is used when context is
not entirely clear. E.g., PAYMENT_HANDLER permission verification for
payment providers inside PWA's manifest.

More details here:
go/permission-controller
go/permission-manager-hardening

Bug: 1271543
Change-Id: I8ddd1f820c57161461e47b81f66cbec6c9afabb8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3495142
Reviewed-by: Andy Paicu <andypaicu@chromium.org>
Reviewed-by: Victor Costan <pwnall@chromium.org>
Reviewed-by: Evan Stade <estade@chromium.org>
Reviewed-by: Rouslan Solomakhin <rouslan@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Reviewed-by: Yoshiki Iguchi <yoshiki@chromium.org>
Commit-Queue: Illia Klimov <elklm@google.com>
Cr-Commit-Position: refs/heads/main@{#980989}
2022-03-15 06:31:35 +00:00
Victor Costan
ff9eb46806 Font Access: Move OS-specific logic to FontEnumerationDataSource.
FontEnumerationCache currently has two responsibilities: retrieving font
information from the underlying operating system, and caching this
information.

This CL extracts retrieving font information into a separate class,
FontEnumerationDataSource. This leaves FontEnumerationCache with the
single responsibility of caching the font data.

While moving font information retrieval into FontEnumerationDataSource,
this CL also removes the PLATFORM_HAS_LOCAL_FONT_ENUMERATION_IMPL macro.
All the OS-specific logic is encapsulated in FontEnumerationDataSource
subclasses.

Bug: 1232812
Change-Id: I667ce296fc49567ebd0b928f9744f2300bbb0f5e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3153688
Reviewed-by: Austin Sullivan <asully@chromium.org>
Commit-Queue: Victor Costan <pwnall@chromium.org>
Auto-Submit: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/main@{#970294}
2022-02-12 03:50:20 +00:00
Xiaohan Wang
1ecfd006fd content: Use BUILDFLAG for OS checking
Use BUILDFLAG(IS_XXX) instead of defined(OS_XXX).

Generated by `os_buildflag_migration.py` (https://crrev.com/c/3311983).

R=thakis@chromium.org

Bug: 1234043
Test: No functionality change
Change-Id: Ia0eae6f9396065e190929d42600012c9324c07e9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3399774
Commit-Queue: Xiaohan Wang <xhwang@chromium.org>
Owners-Override: Xiaohan Wang <xhwang@chromium.org>
Auto-Submit: Xiaohan Wang <xhwang@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Owners-Override: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#961157}
2022-01-19 22:33:10 +00:00
Victor Costan
c4eae8fbd5 Fonts Access: Remove prototype that uses a font picker.
Feedback from developers suggests that the font picker model is not a
useful block in building the experiences that folks are aiming to offer.
Therefore, we're consolidating our prototype around the permission
prompt model.

This CL also removes the FontAccessPersistent feature flag, because its
scope is now equivalent to the FontAccess flag.

Bug: 535764
Change-Id: I0e52562b55bbba4ef6d03c43ad2d988f8744f6bb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3383599
Reviewed-by: Austin Sullivan <asully@chromium.org>
Reviewed-by: enne <enne@chromium.org>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: Matthew Denton <mpdenton@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/main@{#960722}
2022-01-19 00:55:12 +00:00
Joshua Bell
78db61b3f5 Font Access API: Remove additional FontMetadata properties
After further discussions with potential adopters, the priority to
expose synthetic stretch/weight/italic properties in FontMetadata
during enumeration has dropped, so removing them to reduce the surface
area of the API. Developers seem happy to parse fonts to extract
the details. We can revisit as needed.

This effectively reverts 332823ac67

Change-Id: I1b7f3c71760c105d18644de60507a96e247f66c9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3353631
Reviewed-by: Victor Costan <pwnall@chromium.org>
Reviewed-by: Sam McNally <sammc@chromium.org>
Commit-Queue: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/main@{#959940}
2022-01-17 06:17:00 +00:00