Commit 3fb510bb authored by Staphany Park's avatar Staphany Park Committed by Commit Bot

Storage Service: Add use counters for deprecated FileSystem read/write.

Bug: 1000932
Change-Id: I1c5286092a79e9a5014c77d3a3ba0526280add0f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1786923
Commit-Queue: Staphany Park <staphany@chromium.org>
Reviewed-by: default avatarVictor Costan <pwnall@chromium.org>
Auto-Submit: Staphany Park <staphany@chromium.org>
Cr-Commit-Position: refs/heads/master@{#693908}
parent 9a4f447d
......@@ -2405,6 +2405,8 @@ enum WebFeature {
kCacheStorageWrite = 3022,
kIndexedDBRead = 3023,
kIndexedDBWrite = 3024,
kDeprecatedFileSystemRead = 3025,
kDeprecatedFileSystemWrite = 3026,
// Add new features immediately above this line. Don't change assigned
// numbers of any item, and don't reuse removed slots.
......
......@@ -30,15 +30,26 @@
// https://www.w3.org/TR/2012/WD-file-system-api-20120417/#idl-def-DirectoryEntry
[
NoInterfaceObject
NoInterfaceObject
] interface DirectoryEntry : Entry {
DirectoryReader createReader();
// TODO(crbug.com/841185): |successCallback| and |errorCallback| are not
// nullable in the spec.
void getFile(DOMString? path, optional FileSystemFlags options, optional EntryCallback? successCallback, optional ErrorCallback? errorCallback);
// TODO(crbug.com/841185): |successCallback| and |errorCallback| are not
// nullable in the spec.
void getDirectory(DOMString? path, optional FileSystemFlags options, optional EntryCallback? successCallback, optional ErrorCallback? errorCallback);
// TODO(crbug.com/841185): |errorCallback| is not nullable in the spec.
void removeRecursively(VoidCallback successCallback, optional ErrorCallback? errorCallback);
DirectoryReader createReader();
// TODO(crbug.com/841185): |successCallback| and |errorCallback| are not
// nullable in the spec.
void getFile(DOMString? path,
optional FileSystemFlags options,
optional EntryCallback? successCallback,
optional ErrorCallback? errorCallback);
// TODO(crbug.com/841185): |successCallback| and |errorCallback| are not
// nullable in the spec.
void getDirectory(DOMString? path,
optional FileSystemFlags options,
optional EntryCallback? successCallback,
optional ErrorCallback? errorCallback);
// TODO(crbug.com/841185): |errorCallback| is not nullable in the spec.
[MeasureAs=DeprecatedFileSystemWrite]
void removeRecursively(VoidCallback successCallback,
optional ErrorCallback? errorCallback);
};
......@@ -30,8 +30,10 @@
// https://www.w3.org/TR/2012/WD-file-system-api-20120417/#idl-def-DirectoryReader
[
NoInterfaceObject
NoInterfaceObject
] interface DirectoryReader {
// TODO(crbug.com/841185): |errorCallback| is not nullable in the spec.
void readEntries(EntriesCallback successCallback, optional ErrorCallback? errorCallback);
// TODO(crbug.com/841185): |errorCallback| is not nullable in the spec.
[MeasureAs=DeprecatedFileSystemRead]
void readEntries(EntriesCallback successCallback,
optional ErrorCallback? errorCallback);
};
......@@ -30,10 +30,14 @@
// https://www.w3.org/TR/2012/WD-file-system-api-20120417/#idl-def-FileEntry
[
NoInterfaceObject
NoInterfaceObject
] interface FileEntry : Entry {
// TODO(crbug.com/841185): |errorCallback| is not nullable in the spec.
void createWriter(FileWriterCallback successCallback, optional ErrorCallback? errorCallback);
// TODO(crbug.com/841185): |errorCallback| is not nullable in the spec.
void file(FileCallback successCallback, optional ErrorCallback? errorCallback);
// TODO(crbug.com/841185): |errorCallback| is not nullable in the spec.
void createWriter(FileWriterCallback successCallback,
optional ErrorCallback? errorCallback);
// TODO(crbug.com/841185): |errorCallback| is not nullable in the spec.
[MeasureAs=DeprecatedFileSystemRead]
void file(FileCallback successCallback,
optional ErrorCallback? errorCallback);
};
......@@ -31,30 +31,34 @@
// https://www.w3.org/TR/2012/WD-file-writer-api-20120417/#idl-def-FileWriter
[
ActiveScriptWrappable,
NoInterfaceObject
ActiveScriptWrappable,
NoInterfaceObject
] interface FileWriter : EventTarget {
// ready states
const unsigned short INIT = 0;
const unsigned short WRITING = 1;
const unsigned short DONE = 2;
[ImplementedAs=getReadyState] readonly attribute unsigned short readyState;
// ready states
const unsigned short INIT = 0;
const unsigned short WRITING = 1;
const unsigned short DONE = 2;
[ImplementedAs=getReadyState] readonly attribute unsigned short readyState;
// async write/modify methods
[RaisesException] void write(Blob data);
[RaisesException] void seek(long long position);
[RaisesException] void truncate(long long size);
// async write/modify methods
[MeasureAs=DeprecatedFileSystemWrite, RaisesException]
void write(Blob data);
[RaisesException] void abort();
[RaisesException] void seek(long long position);
readonly attribute DOMException? error;
readonly attribute long long position;
readonly attribute long long length;
[MeasureAs=DeprecatedFileSystemWrite, RaisesException]
void truncate(long long size);
attribute EventHandler onwritestart;
attribute EventHandler onprogress;
attribute EventHandler onwrite;
attribute EventHandler onabort;
attribute EventHandler onerror;
attribute EventHandler onwriteend;
[RaisesException] void abort();
readonly attribute DOMException? error;
readonly attribute long long position;
readonly attribute long long length;
attribute EventHandler onwritestart;
attribute EventHandler onprogress;
attribute EventHandler onwrite;
attribute EventHandler onabort;
attribute EventHandler onerror;
attribute EventHandler onwriteend;
};
......@@ -24592,6 +24592,8 @@ Called by update_net_error_codes.py.-->
<int value="3022" label="CacheStorageWrite"/>
<int value="3023" label="IndexedDBRead"/>
<int value="3024" label="IndexedDBWrite"/>
<int value="3025" label="DeprecatedFileSystemRead"/>
<int value="3026" label="DeprecatedFileSystemWrite"/>
</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