Commit f419f315 authored by Kent Tamura's avatar Kent Tamura Committed by Commit Bot

Add UseCounters for all 'Date' IDL attributes

- As for input.valueAsDate, add separated counters for the getter and
  the setter.
- file.lastModifiedDate already has a counter.

Bug: 988353
Change-Id: Ia5fa197705698c0e3465c079b77f8d8d426c6cdb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1943068Reviewed-by: default avatarYuki Shiino <yukishiino@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#720110}
parent 5b2ab223
...@@ -2486,6 +2486,10 @@ enum WebFeature { ...@@ -2486,6 +2486,10 @@ enum WebFeature {
kMessageEventSharedArrayBufferSameAgentCluster = 3105, kMessageEventSharedArrayBufferSameAgentCluster = 3105,
kMessageEventSharedArrayBufferDifferentAgentCluster = 3106, kMessageEventSharedArrayBufferDifferentAgentCluster = 3106,
kCacheStorageCodeCacheHint = 3107, kCacheStorageCodeCacheHint = 3107,
kV8Metadata_ModificationTime_AttributeGetter = 3108,
kV8RTCLegacyStatsReport_Timestamp_AttributeGetter = 3109,
kInputElementValueAsDateGetter = 3110,
kInputElementValueAsDateSetter = 3111,
// Add new features immediately above this line. Don't change assigned // Add new features immediately above this line. Don't change assigned
// numbers of any item, and don't reuse removed slots. // numbers of any item, and don't reuse removed slots.
......
...@@ -1199,6 +1199,7 @@ void HTMLInputElement::UpdateView() { ...@@ -1199,6 +1199,7 @@ void HTMLInputElement::UpdateView() {
} }
ScriptValue HTMLInputElement::valueAsDate(ScriptState* script_state) const { ScriptValue HTMLInputElement::valueAsDate(ScriptState* script_state) const {
UseCounter::Count(GetDocument(), WebFeature::kInputElementValueAsDateGetter);
// TODO(crbug.com/988343): InputType::ValueAsDate() should return // TODO(crbug.com/988343): InputType::ValueAsDate() should return
// base::Optional<base::Time>. // base::Optional<base::Time>.
double date = input_type_->ValueAsDate(); double date = input_type_->ValueAsDate();
...@@ -1211,6 +1212,7 @@ ScriptValue HTMLInputElement::valueAsDate(ScriptState* script_state) const { ...@@ -1211,6 +1212,7 @@ ScriptValue HTMLInputElement::valueAsDate(ScriptState* script_state) const {
void HTMLInputElement::setValueAsDate(ScriptState* script_state, void HTMLInputElement::setValueAsDate(ScriptState* script_state,
const ScriptValue& value, const ScriptValue& value,
ExceptionState& exception_state) { ExceptionState& exception_state) {
UseCounter::Count(GetDocument(), WebFeature::kInputElementValueAsDateSetter);
base::Optional<base::Time> date = base::Optional<base::Time> date =
NativeValueTraits<IDLDateOrNull>::NativeValue( NativeValueTraits<IDLDateOrNull>::NativeValue(
script_state->GetIsolate(), value.V8Value(), exception_state); script_state->GetIsolate(), value.V8Value(), exception_state);
......
...@@ -32,6 +32,6 @@ ...@@ -32,6 +32,6 @@
[ [
NoInterfaceObject NoInterfaceObject
] interface Metadata { ] interface Metadata {
[CallWith=ScriptState] readonly attribute object modificationTime; [CallWith=ScriptState, Measure] readonly attribute object modificationTime;
readonly attribute unsigned long long size; readonly attribute unsigned long long size;
}; };
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
[ [
NoInterfaceObject NoInterfaceObject
] interface RTCLegacyStatsReport { ] interface RTCLegacyStatsReport {
[CallWith=ScriptState] readonly attribute object timestamp; [CallWith=ScriptState, Measure] readonly attribute object timestamp;
readonly attribute DOMString id; readonly attribute DOMString id;
readonly attribute DOMString type; readonly attribute DOMString type;
DOMString stat(DOMString name); DOMString stat(DOMString name);
......
...@@ -25604,6 +25604,10 @@ Called by update_net_error_codes.py.--> ...@@ -25604,6 +25604,10 @@ Called by update_net_error_codes.py.-->
<int value="3105" label="MessageEventSharedArrayBufferSameAgentCluster"/> <int value="3105" label="MessageEventSharedArrayBufferSameAgentCluster"/>
<int value="3106" label="MessageEventSharedArrayBufferDifferentAgentCluster"/> <int value="3106" label="MessageEventSharedArrayBufferDifferentAgentCluster"/>
<int value="3107" label="CacheStorageCodeCacheHint"/> <int value="3107" label="CacheStorageCodeCacheHint"/>
<int value="3108" label="V8Metadata_ModificationTime_AttributeGetter"/>
<int value="3109" label="V8RTCLegacyStatsReport_Timestamp_AttributeGetter"/>
<int value="3110" label="InputElementValueAsDateGetter"/>
<int value="3111" label="InputElementValueAsDateSetter"/>
</enum> </enum>
<enum name="FeaturePolicyAllowlistType"> <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