Commit 0c6b1827 authored by Marijn Kruisselbrink's avatar Marijn Kruisselbrink Committed by Commit Bot

[NativeFS] Add use counters for new entry points.

Bug: 1099442
Change-Id: Id18e1bbc585577c82fc40cabba1ce387194be3de
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2268881
Commit-Queue: Marijn Kruisselbrink <mek@chromium.org>
Reviewed-by: default avatarVictor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#782847}
parent 7d13acf0
......@@ -2673,6 +2673,11 @@ enum WebFeature {
kInlineOverflowScrollWithInlineEndPadding = 3336,
kCSSSelectorPseudoWebKitDetailsMarker = 3337,
kSerialPortGetInfo = 3338,
kFileSystemPickerMethod = 3339,
kV8Window_ShowOpenFilePicker_Method = 3340,
kV8Window_ShowSaveFilePicker_Method = 3341,
kV8Window_ShowDirectoryPicker_Method = 3342,
kV8Window_GetOriginPrivateDirectory_Method = 3343,
// Add new features immediately above this line. Don't change assigned
// numbers of any item, and don't reuse removed slots.
......
......@@ -271,6 +271,8 @@ ScriptPromise GlobalNativeFileSystem::chooseFileSystemEntries(
LocalDOMWindow& window,
const ChooseFileSystemEntriesOptions* options,
ExceptionState& exception_state) {
UseCounter::Count(window, WebFeature::kFileSystemPickerMethod);
VerifyIsAllowedToShowFilePicker(window, exception_state);
if (exception_state.HadException())
return ScriptPromise();
......@@ -292,6 +294,8 @@ ScriptPromise GlobalNativeFileSystem::showOpenFilePicker(
LocalDOMWindow& window,
const OpenFilePickerOptions* options,
ExceptionState& exception_state) {
UseCounter::Count(window, WebFeature::kFileSystemPickerMethod);
Vector<mojom::blink::ChooseFileSystemEntryAcceptsOptionPtr> accepts;
if (options->hasTypes())
accepts = ConvertAccepts(options->types(), exception_state);
......@@ -322,6 +326,8 @@ ScriptPromise GlobalNativeFileSystem::showSaveFilePicker(
LocalDOMWindow& window,
const SaveFilePickerOptions* options,
ExceptionState& exception_state) {
UseCounter::Count(window, WebFeature::kFileSystemPickerMethod);
Vector<mojom::blink::ChooseFileSystemEntryAcceptsOptionPtr> accepts;
if (options->hasTypes())
accepts = ConvertAccepts(options->types(), exception_state);
......@@ -349,6 +355,8 @@ ScriptPromise GlobalNativeFileSystem::showDirectoryPicker(
LocalDOMWindow& window,
const DirectoryPickerOptions* options,
ExceptionState& exception_state) {
UseCounter::Count(window, WebFeature::kFileSystemPickerMethod);
VerifyIsAllowedToShowFilePicker(window, exception_state);
if (exception_state.HadException())
return ScriptPromise();
......
......@@ -13,16 +13,16 @@
Promise<(FileSystemHandle or sequence<FileSystemHandle>)>
chooseFileSystemEntries(optional ChooseFileSystemEntriesOptions options = {});
[CallWith=ScriptState, RaisesException]
[CallWith=ScriptState, RaisesException, Measure]
Promise<sequence<FileSystemFileHandle>> showOpenFilePicker(
optional OpenFilePickerOptions options = {});
[CallWith=ScriptState, RaisesException]
[CallWith=ScriptState, RaisesException, Measure]
Promise<FileSystemFileHandle> showSaveFilePicker(
optional SaveFilePickerOptions options = {});
[CallWith=ScriptState, RaisesException]
[CallWith=ScriptState, RaisesException, Measure]
Promise<FileSystemDirectoryHandle> showDirectoryPicker(
optional DirectoryPickerOptions options = {});
[CallWith=ScriptState, RaisesException]
[CallWith=ScriptState, RaisesException, Measure]
Promise<FileSystemDirectoryHandle> getOriginPrivateDirectory();
};
......@@ -28129,6 +28129,11 @@ Called by update_use_counter_feature_enum.py.-->
<int value="3336" label="InlineOverflowScrollWithInlineEndPadding"/>
<int value="3337" label="CSSSelectorPseudoWebKitDetailsMarker"/>
<int value="3338" label="SerialPortGetInfo"/>
<int value="3339" label="FileSystemPickerMethod"/>
<int value="3340" label="V8Window_ShowOpenFilePicker_Method"/>
<int value="3341" label="V8Window_ShowSaveFilePicker_Method"/>
<int value="3342" label="V8Window_ShowDirectoryPicker_Method"/>
<int value="3343" label="V8Window_GetOriginPrivateDirectory_Method"/>
</enum>
<enum name="FeaturePolicyAllowlistType">
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment