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}
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}
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}
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}
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}
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}
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}
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}
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}
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}
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}
- 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}
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}
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}
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}
This CL was generated by using tools/git/move_source_file.py to change
the includes for those files:
base/bind_post_task.h
base/deferred_sequenced_task_runner.h
base/post_task_and_reply_with_result_internal.h
base/sequenced_task_runner.h
base/sequenced_task_runner_helpers.h
base/single_thread_task_runner.h
base/task_runner.h
base/task_runner_util.h
base/updateable_sequenced_task_runner.h
Then formatted using "git cl format". DEPS files were fixed with a
simple search and replace script.
Bug: 1255932
Change-Id: I0d9b5ddd9260fde5e4581e6c6e0080bdb0ed2c44
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3209175
Reviewed-by: Gabriel Charette <gab@chromium.org>
Owners-Override: Gabriel Charette <gab@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/main@{#929867}
Use the new "mixins" feature in dirmd.
Derive mixins from file:// links in OWNERS files.
This CL is machine-generated, in two parts.
Part 1: use mixins.
1. Save current metadata to JSON files, in ORIGINAL and REDUCED forms.
dirmd read -form original > ~/tmp/dirmd/original.json
dirmd read -form reduced > ~/tmp/dirmd/reduced.json
2. Run mixins.py.
Source code: https://gist.github.com/nodirg/b59d3df338a72a8944f957c5b3a15e22
The script finds related directories, connected by file:// links
in OWNERS files. For those directories that have the same base
name, e.g.
components/autofill
chrome/android/java/src/org/chromium/chrome/browser/autofill
if importing the "parent" to the "child" reduces metadata, or adds
missing metadata, extract the common metadata to COMMON_METADATA
and import it in both directories.
Part2: deduplicate metadata.
Apply same instructions as in
https://chromium-review.googlesource.com/c/chromium/src/+/2795985/16
Bug: 1179786
Change-Id: I2e6378004ce433e02f1c9360b09eb72354083bf6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2897943
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Fred Mello <fredmello@chromium.org>
Owners-Override: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: Nodir Turakulov <nodir@chromium.org>
Cr-Commit-Position: refs/heads/main@{#925648}
This CL removes the threading logic from FontEnumerationCache, so
instances are now used on a single sequence.
This simplifies the API between FontEnumerationCache and its subclasses
down to a single ComputeFontEnumerationData() method. A follow-up CL
will extract this API to a separate base class, separating the
responsibility of obtaining font enumeration data from the
responsibility of caching the data.
Bug: 1232812
Change-Id: Ie6a4c25c6b320ec228189592c35557ae1e598243
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3058215
Auto-Submit: Victor Costan <pwnall@chromium.org>
Commit-Queue: Austin Sullivan <asully@chromium.org>
Reviewed-by: Austin Sullivan <asully@chromium.org>
Cr-Commit-Position: refs/heads/main@{#919844}
Fix a potential crash due to an optional<> variable being read-from
and std::move()'ed in a loop, as only the first loop iteration will
get a non-empty optional and the next iteration would crash on
dereferencing it.
This issue was found by the bugprone-use-after-move clang-tidy
diagnostics:
font_enumeration_cache_win.cc:321:
'family_name' used after it was moved
font_enumeration_cache_win.cc:321:
move occurred here
the use happens in a later loop iteration than the move
Bug: 1122844
Change-Id: Ie66aaf6576638530c073f33d7d611486a857c61a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3127221
Commit-Queue: Maksim Ivanov <emaxx@chromium.org>
Commit-Queue: Victor Costan <pwnall@chromium.org>
Auto-Submit: Maksim Ivanov <emaxx@chromium.org>
Reviewed-by: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/main@{#916253}
Getting font information from DirectWrite is faster on a single thread,
compared to the current multi-threaded implementation. This is likely
because the single-threaded implementation can omit copying strings and
protocol buffer values, asides from cutting down on the PostTask()
overhead.
This CL subsumes the FontEnumerationCacheWin methods
InitializeDirectWrite(), AppendFontDataAndFinalizeIfNeeded(), and
FinalizeEnumerationCache() in PrepareFontEnumerationCache(). This is
similar to the FontEnumerationCache implementations.
This CL also did the following renames:
* outstanding_family_results -> family_count
* native_postscript_name -> postscript_name (code inclusion)
* native_style_name -> style_name (code inclusion)
Testing methodology:
1a) Add the timing code removed in https://crrev.com/c/3122473/2..3
1b) In the threaded version, the start time was recorded in
PrepareFontInitializationCache(), and the end time was recorded in
FinalizeEnumerationCache(). The DirectWrite initialization code was
moved from SchedulePrepareFontInitializationCache() to
PrepareFontInitializationCache(), after the start time recording.
2) out\Release\chrome.exe --enable-logging https://oyiptong.github.io/opentype.js/font-inspector-picker.html
3) Click the "Import Fonts" button.
4) Note the time in the log.
5) Close Chrome.
6) Repeat steps 2-5 for each test run. The results below have 10 runs.
Testing results using Windows 10.0.19043 on a Lenovo P53 20QQS56800.
* Multi-threaded times (microseconds):
7159 7417 6785 7071 7497 6764 8474 6402 6697 8422
* Single-threaded times (microseconds):
5218 4872 6283 5672 5128 6590 5913 6870 5827 6132
Bug: 1232812
Change-Id: I495bc199d7e9c14c55fccb0ee2b48b7d342f54a5
Tested: manual benchmark described above
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3122473
Auto-Submit: Victor Costan <pwnall@chromium.org>
Commit-Queue: Austin Sullivan <asully@chromium.org>
Reviewed-by: Austin Sullivan <asully@chromium.org>
Cr-Commit-Position: refs/heads/main@{#915971}