diff --git a/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp b/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp index 1a1239d5cd3633..0fb850a86a2696 100644 --- a/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp @@ -138,10 +138,10 @@ bool BindingSecurity::ShouldAllowAccessTo( if (!can_access) { UseCounter::Count(accessing_window->GetFrame(), - UseCounter::kCrossOriginPropertyAccess); + WebFeature::kCrossOriginPropertyAccess); if (target->opener() == accessing_window) { UseCounter::Count(accessing_window->GetFrame(), - UseCounter::kCrossOriginPropertyAccessFromOpener); + WebFeature::kCrossOriginPropertyAccessFromOpener); } } @@ -166,10 +166,10 @@ bool BindingSecurity::ShouldAllowAccessTo( if (!can_access) { UseCounter::Count(accessing_window->GetFrame(), - UseCounter::kCrossOriginPropertyAccess); + WebFeature::kCrossOriginPropertyAccess); if (target->opener() == accessing_window) { UseCounter::Count(accessing_window->GetFrame(), - UseCounter::kCrossOriginPropertyAccessFromOpener); + WebFeature::kCrossOriginPropertyAccessFromOpener); } } @@ -195,10 +195,10 @@ bool BindingSecurity::ShouldAllowAccessTo( if (!can_access) { UseCounter::Count(accessing_window->GetFrame(), - UseCounter::kCrossOriginPropertyAccess); + WebFeature::kCrossOriginPropertyAccess); if (target->DomWindow()->opener() == accessing_window) { UseCounter::Count(accessing_window->GetFrame(), - UseCounter::kCrossOriginPropertyAccessFromOpener); + WebFeature::kCrossOriginPropertyAccessFromOpener); } } @@ -224,10 +224,10 @@ bool BindingSecurity::ShouldAllowAccessTo( if (!can_access) { UseCounter::Count(accessing_window->GetFrame(), - UseCounter::kCrossOriginPropertyAccess); + WebFeature::kCrossOriginPropertyAccess); if (target->DomWindow()->opener() == accessing_window) { UseCounter::Count(accessing_window->GetFrame(), - UseCounter::kCrossOriginPropertyAccessFromOpener); + WebFeature::kCrossOriginPropertyAccessFromOpener); } } diff --git a/third_party/WebKit/Source/bindings/core/v8/BindingSecurityTest.cpp b/third_party/WebKit/Source/bindings/core/v8/BindingSecurityTest.cpp index 904579b94a9af0..7f840bcf0bc93a 100644 --- a/third_party/WebKit/Source/bindings/core/v8/BindingSecurityTest.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/BindingSecurityTest.cpp @@ -107,33 +107,33 @@ INSTANTIATE_TEST_CASE_P(WindowProperties, TEST_P(BindingSecurityCounterTest, CrossOriginWindow) { LoadWindowAndAccessProperty(OriginDisposition::CrossOrigin, GetParam()); EXPECT_TRUE(GetDocument().GetPage()->GetUseCounter().HasRecordedMeasurement( - UseCounter::kCrossOriginPropertyAccess)); + WebFeature::kCrossOriginPropertyAccess)); EXPECT_TRUE(GetDocument().GetPage()->GetUseCounter().HasRecordedMeasurement( - UseCounter::kCrossOriginPropertyAccessFromOpener)); + WebFeature::kCrossOriginPropertyAccessFromOpener)); } TEST_P(BindingSecurityCounterTest, SameOriginWindow) { LoadWindowAndAccessProperty(OriginDisposition::SameOrigin, GetParam()); EXPECT_FALSE(GetDocument().GetPage()->GetUseCounter().HasRecordedMeasurement( - UseCounter::kCrossOriginPropertyAccess)); + WebFeature::kCrossOriginPropertyAccess)); EXPECT_FALSE(GetDocument().GetPage()->GetUseCounter().HasRecordedMeasurement( - UseCounter::kCrossOriginPropertyAccessFromOpener)); + WebFeature::kCrossOriginPropertyAccessFromOpener)); } TEST_P(BindingSecurityCounterTest, CrossOriginFrame) { LoadFrameAndAccessProperty(OriginDisposition::CrossOrigin, GetParam()); EXPECT_TRUE(GetDocument().GetPage()->GetUseCounter().HasRecordedMeasurement( - UseCounter::kCrossOriginPropertyAccess)); + WebFeature::kCrossOriginPropertyAccess)); EXPECT_FALSE(GetDocument().GetPage()->GetUseCounter().HasRecordedMeasurement( - UseCounter::kCrossOriginPropertyAccessFromOpener)); + WebFeature::kCrossOriginPropertyAccessFromOpener)); } TEST_P(BindingSecurityCounterTest, SameOriginFrame) { LoadFrameAndAccessProperty(OriginDisposition::SameOrigin, GetParam()); EXPECT_FALSE(GetDocument().GetPage()->GetUseCounter().HasRecordedMeasurement( - UseCounter::kCrossOriginPropertyAccess)); + WebFeature::kCrossOriginPropertyAccess)); EXPECT_FALSE(GetDocument().GetPage()->GetUseCounter().HasRecordedMeasurement( - UseCounter::kCrossOriginPropertyAccessFromOpener)); + WebFeature::kCrossOriginPropertyAccessFromOpener)); } } // namespace diff --git a/third_party/WebKit/Source/bindings/core/v8/ScheduledAction.cpp b/third_party/WebKit/Source/bindings/core/v8/ScheduledAction.cpp index 853c25f96f39c3..ea5a9720aca25b 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ScheduledAction.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/ScheduledAction.cpp @@ -58,7 +58,7 @@ ScheduledAction* ScheduledAction::Create(ScriptState* script_state, EnteredDOMWindow(script_state->GetIsolate()), ToDocument(target)->GetFrame(), BindingSecurity::ErrorReportOption::kDoNotReport)) { - UseCounter::Count(target, UseCounter::kScheduledActionIgnored); + UseCounter::Count(target, WebFeature::kScheduledActionIgnored); return new ScheduledAction(script_state); } } @@ -73,7 +73,7 @@ ScheduledAction* ScheduledAction::Create(ScriptState* script_state, EnteredDOMWindow(script_state->GetIsolate()), ToDocument(target)->GetFrame(), BindingSecurity::ErrorReportOption::kDoNotReport)) { - UseCounter::Count(target, UseCounter::kScheduledActionIgnored); + UseCounter::Count(target, WebFeature::kScheduledActionIgnored); return new ScheduledAction(script_state); } } diff --git a/third_party/WebKit/Source/bindings/core/v8/UseCounterCallback.cpp b/third_party/WebKit/Source/bindings/core/v8/UseCounterCallback.cpp index 16c32963734745..f094f0034c4402 100644 --- a/third_party/WebKit/Source/bindings/core/v8/UseCounterCallback.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/UseCounterCallback.cpp @@ -16,110 +16,110 @@ void UseCounterCallback(v8::Isolate* isolate, if (V8PerIsolateData::From(isolate)->IsUseCounterDisabled()) return; - UseCounter::Feature blink_feature; + WebFeature blink_feature; bool deprecated = false; switch (feature) { case v8::Isolate::kUseAsm: - blink_feature = UseCounter::kUseAsm; + blink_feature = WebFeature::kUseAsm; break; case v8::Isolate::kBreakIterator: - blink_feature = UseCounter::kBreakIterator; + blink_feature = WebFeature::kBreakIterator; break; case v8::Isolate::kLegacyConst: - blink_feature = UseCounter::kLegacyConst; + blink_feature = WebFeature::kLegacyConst; break; case v8::Isolate::kSloppyMode: - blink_feature = UseCounter::kV8SloppyMode; + blink_feature = WebFeature::kV8SloppyMode; break; case v8::Isolate::kStrictMode: - blink_feature = UseCounter::kV8StrictMode; + blink_feature = WebFeature::kV8StrictMode; break; case v8::Isolate::kStrongMode: - blink_feature = UseCounter::kV8StrongMode; + blink_feature = WebFeature::kV8StrongMode; break; case v8::Isolate::kRegExpPrototypeStickyGetter: - blink_feature = UseCounter::kV8RegExpPrototypeStickyGetter; + blink_feature = WebFeature::kV8RegExpPrototypeStickyGetter; break; case v8::Isolate::kRegExpPrototypeToString: - blink_feature = UseCounter::kV8RegExpPrototypeToString; + blink_feature = WebFeature::kV8RegExpPrototypeToString; break; case v8::Isolate::kRegExpPrototypeUnicodeGetter: - blink_feature = UseCounter::kV8RegExpPrototypeUnicodeGetter; + blink_feature = WebFeature::kV8RegExpPrototypeUnicodeGetter; break; case v8::Isolate::kIntlV8Parse: - blink_feature = UseCounter::kV8IntlV8Parse; + blink_feature = WebFeature::kV8IntlV8Parse; break; case v8::Isolate::kIntlPattern: - blink_feature = UseCounter::kV8IntlPattern; + blink_feature = WebFeature::kV8IntlPattern; break; case v8::Isolate::kIntlResolved: - blink_feature = UseCounter::kV8IntlResolved; + blink_feature = WebFeature::kV8IntlResolved; break; case v8::Isolate::kPromiseChain: - blink_feature = UseCounter::kV8PromiseChain; + blink_feature = WebFeature::kV8PromiseChain; break; case v8::Isolate::kPromiseAccept: - blink_feature = UseCounter::kV8PromiseAccept; + blink_feature = WebFeature::kV8PromiseAccept; break; case v8::Isolate::kPromiseDefer: - blink_feature = UseCounter::kV8PromiseDefer; + blink_feature = WebFeature::kV8PromiseDefer; break; case v8::Isolate::kHtmlCommentInExternalScript: - blink_feature = UseCounter::kV8HTMLCommentInExternalScript; + blink_feature = WebFeature::kV8HTMLCommentInExternalScript; break; case v8::Isolate::kHtmlComment: - blink_feature = UseCounter::kV8HTMLComment; + blink_feature = WebFeature::kV8HTMLComment; break; case v8::Isolate::kSloppyModeBlockScopedFunctionRedefinition: - blink_feature = UseCounter::kV8SloppyModeBlockScopedFunctionRedefinition; + blink_feature = WebFeature::kV8SloppyModeBlockScopedFunctionRedefinition; break; case v8::Isolate::kForInInitializer: - blink_feature = UseCounter::kV8ForInInitializer; + blink_feature = WebFeature::kV8ForInInitializer; break; case v8::Isolate::kArrayProtectorDirtied: - blink_feature = UseCounter::kV8ArrayProtectorDirtied; + blink_feature = WebFeature::kV8ArrayProtectorDirtied; break; case v8::Isolate::kArraySpeciesModified: - blink_feature = UseCounter::kV8ArraySpeciesModified; + blink_feature = WebFeature::kV8ArraySpeciesModified; break; case v8::Isolate::kArrayPrototypeConstructorModified: - blink_feature = UseCounter::kV8ArrayPrototypeConstructorModified; + blink_feature = WebFeature::kV8ArrayPrototypeConstructorModified; break; case v8::Isolate::kArrayInstanceProtoModified: - blink_feature = UseCounter::kV8ArrayInstanceProtoModified; + blink_feature = WebFeature::kV8ArrayInstanceProtoModified; break; case v8::Isolate::kArrayInstanceConstructorModified: - blink_feature = UseCounter::kV8ArrayInstanceConstructorModified; + blink_feature = WebFeature::kV8ArrayInstanceConstructorModified; break; case v8::Isolate::kLegacyFunctionDeclaration: - blink_feature = UseCounter::kV8LegacyFunctionDeclaration; + blink_feature = WebFeature::kV8LegacyFunctionDeclaration; break; case v8::Isolate::kRegExpPrototypeSourceGetter: - blink_feature = UseCounter::kV8RegExpPrototypeSourceGetter; + blink_feature = WebFeature::kV8RegExpPrototypeSourceGetter; break; case v8::Isolate::kRegExpPrototypeOldFlagGetter: - blink_feature = UseCounter::kV8RegExpPrototypeOldFlagGetter; + blink_feature = WebFeature::kV8RegExpPrototypeOldFlagGetter; break; case v8::Isolate::kDecimalWithLeadingZeroInStrictMode: - blink_feature = UseCounter::kV8DecimalWithLeadingZeroInStrictMode; + blink_feature = WebFeature::kV8DecimalWithLeadingZeroInStrictMode; break; case v8::Isolate::kLegacyDateParser: - blink_feature = UseCounter::kV8LegacyDateParser; + blink_feature = WebFeature::kV8LegacyDateParser; break; case v8::Isolate::kDefineGetterOrSetterWouldThrow: - blink_feature = UseCounter::kV8DefineGetterOrSetterWouldThrow; + blink_feature = WebFeature::kV8DefineGetterOrSetterWouldThrow; break; case v8::Isolate::kFunctionConstructorReturnedUndefined: - blink_feature = UseCounter::kV8FunctionConstructorReturnedUndefined; + blink_feature = WebFeature::kV8FunctionConstructorReturnedUndefined; break; case v8::Isolate::kAssigmentExpressionLHSIsCallInSloppy: - blink_feature = UseCounter::kV8AssigmentExpressionLHSIsCallInSloppy; + blink_feature = WebFeature::kV8AssigmentExpressionLHSIsCallInSloppy; break; case v8::Isolate::kAssigmentExpressionLHSIsCallInStrict: - blink_feature = UseCounter::kV8AssigmentExpressionLHSIsCallInStrict; + blink_feature = WebFeature::kV8AssigmentExpressionLHSIsCallInStrict; break; case v8::Isolate::kPromiseConstructorReturnedUndefined: - blink_feature = UseCounter::kV8PromiseConstructorReturnedUndefined; + blink_feature = WebFeature::kV8PromiseConstructorReturnedUndefined; break; default: // This can happen if V8 has added counters that this version of Blink diff --git a/third_party/WebKit/Source/bindings/core/v8/V0CustomElementConstructorBuilder.cpp b/third_party/WebKit/Source/bindings/core/v8/V0CustomElementConstructorBuilder.cpp index 906e5c57c2ef79..8330faa3289656 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V0CustomElementConstructorBuilder.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/V0CustomElementConstructorBuilder.cpp @@ -347,7 +347,7 @@ static void ConstructCustomElement( StringOrDictionary::fromString(maybe_type->IsNull() ? g_null_atom : type), exception_state); if (element) { - UseCounter::Count(document, UseCounter::kV0CustomElementsConstruct); + UseCounter::Count(document, WebFeature::kV0CustomElementsConstruct); } V8SetReturnValueFast(info, element, document); } diff --git a/third_party/WebKit/Source/bindings/core/v8/V8NodeFilterCondition.cpp b/third_party/WebKit/Source/bindings/core/v8/V8NodeFilterCondition.cpp index 7d654292d067fc..3fccbf2263ef5e 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8NodeFilterCondition.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/V8NodeFilterCondition.cpp @@ -74,7 +74,7 @@ unsigned V8NodeFilterCondition::acceptNode( v8::Local receiver; if (filter->IsFunction()) { UseCounter::Count(CurrentExecutionContext(isolate), - UseCounter::kNodeFilterIsFunction); + WebFeature::kNodeFilterIsFunction); callback = v8::Local::Cast(filter); receiver = v8::Undefined(isolate); } else { @@ -89,7 +89,7 @@ unsigned V8NodeFilterCondition::acceptNode( return NodeFilter::kFilterReject; } UseCounter::Count(CurrentExecutionContext(isolate), - UseCounter::kNodeFilterIsObject); + WebFeature::kNodeFilterIsObject); callback = v8::Local::Cast(value); receiver = filter; } diff --git a/third_party/WebKit/Source/bindings/core/v8/custom/V8DocumentCustom.cpp b/third_party/WebKit/Source/bindings/core/v8/custom/V8DocumentCustom.cpp index c5bcce37aa0055..d0d3d6f541ea18 100644 --- a/third_party/WebKit/Source/bindings/core/v8/custom/V8DocumentCustom.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/custom/V8DocumentCustom.cpp @@ -108,19 +108,19 @@ void V8Document::createTouchMethodPrologueCustom( v8::Local v8_window = info[0]; if (IsUndefinedOrNull(v8_window)) { UseCounter::Count(CurrentExecutionContext(info.GetIsolate()), - UseCounter::kDocumentCreateTouchWindowNull); + WebFeature::kDocumentCreateTouchWindowNull); } else if (!ToDOMWindow(info.GetIsolate(), v8_window)) { UseCounter::Count(CurrentExecutionContext(info.GetIsolate()), - UseCounter::kDocumentCreateTouchWindowWrongType); + WebFeature::kDocumentCreateTouchWindowWrongType); } v8::Local v8_target = info[1]; if (IsUndefinedOrNull(v8_target)) { UseCounter::Count(CurrentExecutionContext(info.GetIsolate()), - UseCounter::kDocumentCreateTouchTargetNull); + WebFeature::kDocumentCreateTouchTargetNull); } else if (!V8EventTarget::hasInstance(v8_target, info.GetIsolate())) { UseCounter::Count(CurrentExecutionContext(info.GetIsolate()), - UseCounter::kDocumentCreateTouchTargetWrongType); + WebFeature::kDocumentCreateTouchTargetWrongType); } } diff --git a/third_party/WebKit/Source/bindings/core/v8/custom/V8EventTargetCustom.cpp b/third_party/WebKit/Source/bindings/core/v8/custom/V8EventTargetCustom.cpp index 875dbec9001ef2..788a36569c2fcb 100644 --- a/third_party/WebKit/Source/bindings/core/v8/custom/V8EventTargetCustom.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/custom/V8EventTargetCustom.cpp @@ -41,11 +41,11 @@ void V8EventTarget::addEventListenerMethodPrologueCustom( EventTarget*) { if (info.Length() >= 3 && info[2]->IsObject()) { UseCounter::Count(CurrentExecutionContext(info.GetIsolate()), - UseCounter::kAddEventListenerThirdArgumentIsObject); + WebFeature::kAddEventListenerThirdArgumentIsObject); } if (info.Length() >= 4) { UseCounter::Count(CurrentExecutionContext(info.GetIsolate()), - UseCounter::kAddEventListenerFourArguments); + WebFeature::kAddEventListenerFourArguments); } } @@ -62,11 +62,11 @@ void V8EventTarget::removeEventListenerMethodPrologueCustom( EventTarget*) { if (info.Length() >= 3 && info[2]->IsObject()) { UseCounter::Count(CurrentExecutionContext(info.GetIsolate()), - UseCounter::kRemoveEventListenerThirdArgumentIsObject); + WebFeature::kRemoveEventListenerThirdArgumentIsObject); } if (info.Length() >= 4) { UseCounter::Count(CurrentExecutionContext(info.GetIsolate()), - UseCounter::kRemoveEventListenerFourArguments); + WebFeature::kRemoveEventListenerFourArguments); } } diff --git a/third_party/WebKit/Source/bindings/core/v8/custom/V8HTMLAllCollectionCustom.cpp b/third_party/WebKit/Source/bindings/core/v8/custom/V8HTMLAllCollectionCustom.cpp index 64f898cd166e29..e382a47a8cd4de 100644 --- a/third_party/WebKit/Source/bindings/core/v8/custom/V8HTMLAllCollectionCustom.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/custom/V8HTMLAllCollectionCustom.cpp @@ -63,9 +63,9 @@ static v8::Local GetItem( HTMLAllCollection* collection, v8::Local argument, const CallbackInfo& info, - UseCounter::Feature named_feature, - UseCounter::Feature indexed_feature, - UseCounter::Feature indexed_with_non_number_feature) { + WebFeature named_feature, + WebFeature indexed_feature, + WebFeature indexed_with_non_number_feature) { v8::Local index; if (!argument->ToArrayIndex(info.GetIsolate()->GetCurrentContext()) .ToLocal(&index)) { @@ -95,41 +95,41 @@ void V8HTMLAllCollection::itemMethodCustom( const v8::FunctionCallbackInfo& info) { if (info.Length() < 1) { UseCounter::Count(CurrentExecutionContext(info.GetIsolate()), - UseCounter::kDocumentAllItemNoArguments); + WebFeature::kDocumentAllItemNoArguments); return; } HTMLAllCollection* impl = V8HTMLAllCollection::toImpl(info.Holder()); V8SetReturnValue( - info, GetItem(impl, info[0], info, UseCounter::kDocumentAllItemNamed, - UseCounter::kDocumentAllItemIndexed, - UseCounter::kDocumentAllItemIndexedWithNonNumber)); + info, GetItem(impl, info[0], info, WebFeature::kDocumentAllItemNamed, + WebFeature::kDocumentAllItemIndexed, + WebFeature::kDocumentAllItemIndexedWithNonNumber)); } void V8HTMLAllCollection::legacyCallCustom( const v8::FunctionCallbackInfo& info) { if (info.Length() < 1) { UseCounter::Count(CurrentExecutionContext(info.GetIsolate()), - UseCounter::kDocumentAllLegacyCallNoArguments); + WebFeature::kDocumentAllLegacyCallNoArguments); return; } UseCounter::Count(CurrentExecutionContext(info.GetIsolate()), - UseCounter::kDocumentAllLegacyCall); + WebFeature::kDocumentAllLegacyCall); HTMLAllCollection* impl = V8HTMLAllCollection::toImpl(info.Holder()); if (info.Length() == 1) { V8SetReturnValue( info, - GetItem(impl, info[0], info, UseCounter::kDocumentAllLegacyCallNamed, - UseCounter::kDocumentAllLegacyCallIndexed, - UseCounter::kDocumentAllLegacyCallIndexedWithNonNumber)); + GetItem(impl, info[0], info, WebFeature::kDocumentAllLegacyCallNamed, + WebFeature::kDocumentAllLegacyCallIndexed, + WebFeature::kDocumentAllLegacyCallIndexedWithNonNumber)); return; } UseCounter::Count(CurrentExecutionContext(info.GetIsolate()), - UseCounter::kDocumentAllLegacyCallTwoArguments); + WebFeature::kDocumentAllLegacyCallTwoArguments); // If there is a second argument it is the index of the item we want. TOSTRING_VOID(V8StringResource<>, name, info[0]); diff --git a/third_party/WebKit/Source/bindings/core/v8/custom/V8HTMLPlugInElementCustom.cpp b/third_party/WebKit/Source/bindings/core/v8/custom/V8HTMLPlugInElementCustom.cpp index a4482fa9472766..d21de18bcf1e54 100644 --- a/third_party/WebKit/Source/bindings/core/v8/custom/V8HTMLPlugInElementCustom.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/custom/V8HTMLPlugInElementCustom.cpp @@ -51,14 +51,14 @@ void GetScriptableObjectProperty( if (!state->World().IsMainWorld()) { if (state->World().IsIsolatedWorld()) { UseCounter::Count(CurrentExecutionContext(info.GetIsolate()), - UseCounter::kPluginInstanceAccessFromIsolatedWorld); + WebFeature::kPluginInstanceAccessFromIsolatedWorld); } // The plugin system cannot deal with multiple worlds, so block any // non-main world access. return; } UseCounter::Count(CurrentExecutionContext(info.GetIsolate()), - UseCounter::kPluginInstanceAccessFromMainWorld); + WebFeature::kPluginInstanceAccessFromMainWorld); HTMLPlugInElement* impl = ElementType::toImpl(info.Holder()); v8::Local instance = impl->PluginWrapper(); @@ -121,7 +121,7 @@ void V8HTMLEmbedElement::namedPropertyGetterCustom( const AtomicString& name, const v8::PropertyCallbackInfo& info) { UseCounter::Count(CurrentExecutionContext(info.GetIsolate()), - UseCounter::kHTMLEmbedElementGetter); + WebFeature::kHTMLEmbedElementGetter); GetScriptableObjectProperty(name, info); } @@ -129,7 +129,7 @@ void V8HTMLObjectElement::namedPropertyGetterCustom( const AtomicString& name, const v8::PropertyCallbackInfo& info) { UseCounter::Count(CurrentExecutionContext(info.GetIsolate()), - UseCounter::kHTMLObjectElementGetter); + WebFeature::kHTMLObjectElementGetter); GetScriptableObjectProperty(name, info); } @@ -138,7 +138,7 @@ void V8HTMLEmbedElement::namedPropertySetterCustom( v8::Local value, const v8::PropertyCallbackInfo& info) { UseCounter::Count(CurrentExecutionContext(info.GetIsolate()), - UseCounter::kHTMLEmbedElementSetter); + WebFeature::kHTMLEmbedElementSetter); SetScriptableObjectProperty(name, value, info); } @@ -147,7 +147,7 @@ void V8HTMLObjectElement::namedPropertySetterCustom( v8::Local value, const v8::PropertyCallbackInfo& info) { UseCounter::Count(CurrentExecutionContext(info.GetIsolate()), - UseCounter::kHTMLObjectElementSetter); + WebFeature::kHTMLObjectElementSetter); SetScriptableObjectProperty(name, value, info); } diff --git a/third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp b/third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp index 9e4b7b8d05840e..fca0a09d19ae12 100644 --- a/third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp @@ -211,7 +211,7 @@ void V8Window::postMessageMethodCustom( LocalDOMWindow* source = CurrentDOMWindow(info.GetIsolate()); DCHECK(window); - UseCounter::Count(source->GetFrame(), UseCounter::kWindowPostMessage); + UseCounter::Count(source->GetFrame(), WebFeature::kWindowPostMessage); // If called directly by WebCore we don't have a calling context. if (!source) { @@ -313,7 +313,7 @@ void V8Window::namedPropertyGetterCustom( Frame* child = frame->Tree().ScopedChild(name); if (child) { UseCounter::Count(CurrentExecutionContext(info.GetIsolate()), - UseCounter::kNamedAccessOnWindow_ChildBrowsingContext); + WebFeature::kNamedAccessOnWindow_ChildBrowsingContext); // step 3. Remove each browsing context from childBrowsingContexts whose // active document's origin is not same origin with activeDocument's origin @@ -327,7 +327,7 @@ void V8Window::namedPropertyGetterCustom( UseCounter::Count( CurrentExecutionContext(info.GetIsolate()), - UseCounter:: + WebFeature:: kNamedAccessOnWindow_ChildBrowsingContext_CrossOriginNameMismatch); // In addition to the above spec'ed case, we return the child window // regardless of step 3 due to crbug.com/701489 for the time being. @@ -361,14 +361,14 @@ void V8Window::namedPropertyGetterCustom( if (!has_named_item && has_id_item && !doc->ContainsMultipleElementsWithId(name)) { - UseCounter::Count(doc, UseCounter::kDOMClobberedVariableAccessed); + UseCounter::Count(doc, WebFeature::kDOMClobberedVariableAccessed); V8SetReturnValueFast(info, doc->getElementById(name), window); return; } HTMLCollection* items = doc->WindowNamedItems(name); if (!items->IsEmpty()) { - UseCounter::Count(doc, UseCounter::kDOMClobberedVariableAccessed); + UseCounter::Count(doc, WebFeature::kDOMClobberedVariableAccessed); // TODO(esprehn): Firefox doesn't return an HTMLCollection here if there's // multiple with the same name, but Chrome and Safari does. What's the diff --git a/third_party/WebKit/Source/bindings/templates/constants.cpp.tmpl b/third_party/WebKit/Source/bindings/templates/constants.cpp.tmpl index ff8dc553801ce4..222337966475ed 100644 --- a/third_party/WebKit/Source/bindings/templates/constants.cpp.tmpl +++ b/third_party/WebKit/Source/bindings/templates/constants.cpp.tmpl @@ -2,10 +2,10 @@ {% macro constant_getter_callback(constant) %} void {{v8_class_or_partial}}::{{constant.name}}ConstantGetterCallback(v8::Local, const v8::PropertyCallbackInfo& info) { {% if constant.deprecate_as %} - Deprecation::CountDeprecation(CurrentExecutionContext(info.GetIsolate()), UseCounter::k{{constant.deprecate_as}}); + Deprecation::CountDeprecation(CurrentExecutionContext(info.GetIsolate()), WebFeature::k{{constant.deprecate_as}}); {% endif %} {% if constant.measure_as %} - UseCounter::Count(CurrentExecutionContext(info.GetIsolate()), UseCounter::k{{constant.measure_as('ConstantGetter')}}); + UseCounter::Count(CurrentExecutionContext(info.GetIsolate()), WebFeature::k{{constant.measure_as('ConstantGetter')}}); {% endif %} {% if constant.idl_type in ('Double', 'Float') %} V8SetReturnValue(info, {{constant.value}}); diff --git a/third_party/WebKit/Source/bindings/templates/dictionary_v8.cpp.tmpl b/third_party/WebKit/Source/bindings/templates/dictionary_v8.cpp.tmpl index 7b718cb97970be..c47cf8f359b301 100644 --- a/third_party/WebKit/Source/bindings/templates/dictionary_v8.cpp.tmpl +++ b/third_party/WebKit/Source/bindings/templates/dictionary_v8.cpp.tmpl @@ -74,7 +74,7 @@ void {{v8_class}}::toImpl(v8::Isolate* isolate, v8::Local v8Value, {{ {% endif %} } else { {% if member.deprecate_as %} - Deprecation::CountDeprecation(CurrentExecutionContext(isolate), UseCounter::k{{member.deprecate_as}}); + Deprecation::CountDeprecation(CurrentExecutionContext(isolate), WebFeature::k{{member.deprecate_as}}); {% endif %} {{v8_value_to_local_cpp_value(member) | indent}} {% if member.is_interface_type %} diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestConstants.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestConstants.cpp index 882d358edeab1a..4fbca80666b9ab 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestConstants.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestConstants.cpp @@ -60,12 +60,12 @@ namespace TestConstantsV8Internal { } // namespace TestConstantsV8Internal void V8TestConstants::DEPRECATED_CONSTANTConstantGetterCallback(v8::Local, const v8::PropertyCallbackInfo& info) { - Deprecation::CountDeprecation(CurrentExecutionContext(info.GetIsolate()), UseCounter::kConstant); + Deprecation::CountDeprecation(CurrentExecutionContext(info.GetIsolate()), WebFeature::kConstant); V8SetReturnValueInt(info, 1); } void V8TestConstants::MEASURED_CONSTANTConstantGetterCallback(v8::Local, const v8::PropertyCallbackInfo& info) { - UseCounter::Count(CurrentExecutionContext(info.GetIsolate()), UseCounter::kConstant); + UseCounter::Count(CurrentExecutionContext(info.GetIsolate()), WebFeature::kConstant); V8SetReturnValueInt(info, 1); } diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionary.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionary.cpp index bda64395c8a507..8c7f0e9949713e 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionary.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionary.cpp @@ -154,7 +154,7 @@ void V8TestDictionary::toImpl(v8::Isolate* isolate, v8::Local v8Value if (deprecatedCreateMemberValue.IsEmpty() || deprecatedCreateMemberValue->IsUndefined()) { // Do nothing. } else { - Deprecation::CountDeprecation(CurrentExecutionContext(isolate), UseCounter::kCreateMember); + Deprecation::CountDeprecation(CurrentExecutionContext(isolate), WebFeature::kCreateMember); bool deprecatedCreateMember = NativeValueTraits::NativeValue(isolate, deprecatedCreateMemberValue, exceptionState); if (exceptionState.HadException()) return; diff --git a/third_party/WebKit/Source/build/scripts/templates/EventFactory.cpp.tmpl b/third_party/WebKit/Source/build/scripts/templates/EventFactory.cpp.tmpl index 5345c5b607d9be..1d5b5f88face2b 100644 --- a/third_party/WebKit/Source/build/scripts/templates/EventFactory.cpp.tmpl +++ b/third_party/WebKit/Source/build/scripts/templates/EventFactory.cpp.tmpl @@ -21,7 +21,7 @@ namespace blink { if (type == "{{event|script_name}}"{% if event.RuntimeEnabled %} && RuntimeEnabledFeatures::{{event.RuntimeEnabled}}(){% endif %}) { {% endif %} {% if not event|script_name|create_event_whitelist %} - UseCounter::Count(executionContext, UseCounter::k{{event|script_name|measure_name}}); + UseCounter::Count(executionContext, WebFeature::k{{event|script_name|measure_name}}); {% endif %} return {{event|cpp_name}}::Create(); } diff --git a/third_party/WebKit/Source/core/animation/Animation.cpp b/third_party/WebKit/Source/core/animation/Animation.cpp index 4ce267c2631366..19b5e3029b9b64 100644 --- a/third_party/WebKit/Source/core/animation/Animation.cpp +++ b/third_party/WebKit/Source/core/animation/Animation.cpp @@ -1115,7 +1115,7 @@ void Animation::AddedEventListener( EventTargetWithInlineData::AddedEventListener(event_type, registered_listener); if (event_type == EventTypeNames::finish) - UseCounter::Count(GetExecutionContext(), UseCounter::kAnimationFinishEvent); + UseCounter::Count(GetExecutionContext(), WebFeature::kAnimationFinishEvent); } void Animation::PauseForTesting(double pause_time) { diff --git a/third_party/WebKit/Source/core/animation/AnimationInputHelpers.cpp b/third_party/WebKit/Source/core/animation/AnimationInputHelpers.cpp index a8f7d556bbc2ac..2871b80e03e2a9 100644 --- a/third_party/WebKit/Source/core/animation/AnimationInputHelpers.cpp +++ b/third_party/WebKit/Source/core/animation/AnimationInputHelpers.cpp @@ -238,10 +238,10 @@ PassRefPtr AnimationInputHelpers::ParseTimingFunction( // for easing. See http://crbug.com/601672 if (string == "function (a){return a}") { UseCounter::Count(*document, - UseCounter::kWebAnimationsEasingAsFunctionLinear); + WebFeature::kWebAnimationsEasingAsFunctionLinear); } else { UseCounter::Count(*document, - UseCounter::kWebAnimationsEasingAsFunctionOther); + WebFeature::kWebAnimationsEasingAsFunctionOther); } } } diff --git a/third_party/WebKit/Source/core/animation/KeyframeEffect.cpp b/third_party/WebKit/Source/core/animation/KeyframeEffect.cpp index 4773aca7457e20..ec087542cbe8bc 100644 --- a/third_party/WebKit/Source/core/animation/KeyframeEffect.cpp +++ b/third_party/WebKit/Source/core/animation/KeyframeEffect.cpp @@ -62,7 +62,7 @@ KeyframeEffect* KeyframeEffect::Create( if (element) { UseCounter::Count( element->GetDocument(), - UseCounter::kAnimationConstructorKeyframeListEffectObjectTiming); + WebFeature::kAnimationConstructorKeyframeListEffectObjectTiming); } Timing timing; Document* document = element ? &element->GetDocument() : nullptr; @@ -83,7 +83,7 @@ KeyframeEffect* KeyframeEffect::Create( if (element) { UseCounter::Count( element->GetDocument(), - UseCounter::kAnimationConstructorKeyframeListEffectNoTiming); + WebFeature::kAnimationConstructorKeyframeListEffectNoTiming); } return Create(element, EffectInput::Convert(element, effect_input, execution_context, diff --git a/third_party/WebKit/Source/core/animation/KeyframeEffectModel.cpp b/third_party/WebKit/Source/core/animation/KeyframeEffectModel.cpp index fd12a410ddc1a7..fac358bbb884de 100644 --- a/third_party/WebKit/Source/core/animation/KeyframeEffectModel.cpp +++ b/third_party/WebKit/Source/core/animation/KeyframeEffectModel.cpp @@ -127,7 +127,7 @@ bool KeyframeEffectModelBase::SnapshotAllCompositorKeyframes( } if (updated && has_neutral_compositable_keyframe) { UseCounter::Count(element.GetDocument(), - UseCounter::kSyntheticKeyframesInCompositedCSSAnimation); + WebFeature::kSyntheticKeyframesInCompositedCSSAnimation); } return updated; } diff --git a/third_party/WebKit/Source/core/animation/KeyframeEffectReadOnly.cpp b/third_party/WebKit/Source/core/animation/KeyframeEffectReadOnly.cpp index 23560aef1f63c6..b2b42cd88563ec 100644 --- a/third_party/WebKit/Source/core/animation/KeyframeEffectReadOnly.cpp +++ b/third_party/WebKit/Source/core/animation/KeyframeEffectReadOnly.cpp @@ -45,7 +45,7 @@ KeyframeEffectReadOnly* KeyframeEffectReadOnly::Create( if (element) { UseCounter::Count( element->GetDocument(), - UseCounter::kAnimationConstructorKeyframeListEffectObjectTiming); + WebFeature::kAnimationConstructorKeyframeListEffectObjectTiming); } Timing timing; Document* document = element ? &element->GetDocument() : nullptr; @@ -66,7 +66,7 @@ KeyframeEffectReadOnly* KeyframeEffectReadOnly::Create( if (element) { UseCounter::Count( element->GetDocument(), - UseCounter::kAnimationConstructorKeyframeListEffectNoTiming); + WebFeature::kAnimationConstructorKeyframeListEffectNoTiming); } return Create(element, EffectInput::Convert(element, effect_input, execution_context, diff --git a/third_party/WebKit/Source/core/animation/css/CSSAnimations.cpp b/third_party/WebKit/Source/core/animation/css/CSSAnimations.cpp index 05800646f03dbd..e34b3c479b47ab 100644 --- a/third_party/WebKit/Source/core/animation/css/CSSAnimations.cpp +++ b/third_party/WebKit/Source/core/animation/css/CSSAnimations.cpp @@ -184,7 +184,7 @@ StringKeyframeEffectModel* CreateKeyframeEffectModel( StringKeyframeEffectModel::Create(keyframes, &keyframes[0]->Easing()); if (animation_index > 0 && model->HasSyntheticKeyframes()) { UseCounter::Count(element_for_scoping->GetDocument(), - UseCounter::kCSSAnimationsStackedNeutralKeyframe); + WebFeature::kCSSAnimationsStackedNeutralKeyframe); } return model; } diff --git a/third_party/WebKit/Source/core/css/CSSFontSelector.cpp b/third_party/WebKit/Source/core/css/CSSFontSelector.cpp index 4ac4e176f996a0..152ef01b7e1f13 100644 --- a/third_party/WebKit/Source/core/css/CSSFontSelector.cpp +++ b/third_party/WebKit/Source/core/css/CSSFontSelector.cpp @@ -176,7 +176,7 @@ void CSSFontSelector::UpdateGenericFontFamilySettings(Document& document) { void CSSFontSelector::ReportNotDefGlyph() const { DCHECK(document_); - UseCounter::Count(document_, UseCounter::kFontShapingNotDefGlyphObserved); + UseCounter::Count(document_, WebFeature::kFontShapingNotDefGlyphObserved); } DEFINE_TRACE(CSSFontSelector) { diff --git a/third_party/WebKit/Source/core/css/CSSKeyframesRule.cpp b/third_party/WebKit/Source/core/css/CSSKeyframesRule.cpp index 77cc53b6684187..0f5ea9614ee46a 100644 --- a/third_party/WebKit/Source/core/css/CSSKeyframesRule.cpp +++ b/third_party/WebKit/Source/core/css/CSSKeyframesRule.cpp @@ -178,7 +178,7 @@ CSSKeyframeRule* CSSKeyframesRule::AnonymousIndexedGetter( CSSStyleSheet::SingleOwnerDocument(parentStyleSheet()); if (parent_document) { UseCounter::Count(*parent_document, - UseCounter::kCSSKeyframesRuleAnonymousIndexedGetter); + WebFeature::kCSSKeyframesRuleAnonymousIndexedGetter); } return Item(index); } diff --git a/third_party/WebKit/Source/core/css/CSSMatrix.cpp b/third_party/WebKit/Source/core/css/CSSMatrix.cpp index 227272c8a45d41..c123e4b5f66896 100644 --- a/third_party/WebKit/Source/core/css/CSSMatrix.cpp +++ b/third_party/WebKit/Source/core/css/CSSMatrix.cpp @@ -44,10 +44,10 @@ namespace blink { CSSMatrix* CSSMatrix::Create(ExecutionContext* execution_context, const String& s, ExceptionState& exception_state) { - UseCounter::Count(execution_context, UseCounter::kWebKitCSSMatrix); + UseCounter::Count(execution_context, WebFeature::kWebKitCSSMatrix); if (!s.IsEmpty()) { UseCounter::Count(execution_context, - UseCounter::kWebkitCSSMatrixConstructFromString); + WebFeature::kWebkitCSSMatrixConstructFromString); } return new CSSMatrix(s, exception_state); } diff --git a/third_party/WebKit/Source/core/css/CSSSyntaxDescriptor.cpp b/third_party/WebKit/Source/core/css/CSSSyntaxDescriptor.cpp index a7ad42544e3b61..da74bdea7bdf1c 100644 --- a/third_party/WebKit/Source/core/css/CSSSyntaxDescriptor.cpp +++ b/third_party/WebKit/Source/core/css/CSSSyntaxDescriptor.cpp @@ -163,8 +163,7 @@ const CSSValue* ConsumeSingleType(const CSSSyntaxComponent& syntax, case CSSSyntaxType::kInteger: return ConsumeInteger(range); case CSSSyntaxType::kAngle: - return ConsumeAngle(range, *context, - WTF::Optional()); + return ConsumeAngle(range, *context, WTF::Optional()); case CSSSyntaxType::kTime: return ConsumeTime(range, ValueRange::kValueRangeAll); case CSSSyntaxType::kResolution: diff --git a/third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp b/third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp index 62b2b59037e198..625c78bc85acda 100644 --- a/third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp +++ b/third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp @@ -370,7 +370,7 @@ static bool DevicePixelRatioMediaFeatureEval(const MediaQueryExpValue& value, MediaFeaturePrefix op, const MediaValues& media_values) { UseCounter::Count(media_values.GetDocument(), - UseCounter::kPrefixedDevicePixelRatioMediaFeature); + WebFeature::kPrefixedDevicePixelRatioMediaFeature); return (!value.IsValid() || value.unit == CSSPrimitiveValue::UnitType::kNumber) && @@ -534,7 +534,7 @@ static bool MinDevicePixelRatioMediaFeatureEval( MediaFeaturePrefix, const MediaValues& media_values) { UseCounter::Count(media_values.GetDocument(), - UseCounter::kPrefixedMinDevicePixelRatioMediaFeature); + WebFeature::kPrefixedMinDevicePixelRatioMediaFeature); return DevicePixelRatioMediaFeatureEval(value, kMinPrefix, media_values); } @@ -544,7 +544,7 @@ static bool MaxDevicePixelRatioMediaFeatureEval( MediaFeaturePrefix, const MediaValues& media_values) { UseCounter::Count(media_values.GetDocument(), - UseCounter::kPrefixedMaxDevicePixelRatioMediaFeature); + WebFeature::kPrefixedMaxDevicePixelRatioMediaFeature); return DevicePixelRatioMediaFeatureEval(value, kMaxPrefix, media_values); } @@ -613,7 +613,7 @@ static bool Transform3dMediaFeatureEval(const MediaQueryExpValue& value, MediaFeaturePrefix op, const MediaValues& media_values) { UseCounter::Count(media_values.GetDocument(), - UseCounter::kPrefixedTransform3dMediaFeature); + WebFeature::kPrefixedTransform3dMediaFeature); bool return_value_if_no_parameter; int have3d_rendering; diff --git a/third_party/WebKit/Source/core/css/SelectorChecker.cpp b/third_party/WebKit/Source/core/css/SelectorChecker.cpp index f533d5eea4e8e1..8548b6a59fed9d 100644 --- a/third_party/WebKit/Source/core/css/SelectorChecker.cpp +++ b/third_party/WebKit/Source/core/css/SelectorChecker.cpp @@ -419,7 +419,7 @@ SelectorChecker::MatchStatus SelectorChecker::MatchForRelation( if (!is_ua_rule_ && mode_ != kQueryingRules && context.selector->GetPseudoType() == CSSSelector::kPseudoShadow) { Deprecation::CountDeprecation(context.element->GetDocument(), - UseCounter::kCSSSelectorPseudoShadow); + WebFeature::kCSSSelectorPseudoShadow); } // If we're in the same tree-scope as the scoping element, then following // a shadow descendant combinator would escape that and thus the scope. @@ -438,7 +438,7 @@ SelectorChecker::MatchStatus SelectorChecker::MatchForRelation( case CSSSelector::kShadowDeep: { if (!is_ua_rule_ && mode_ != kQueryingRules) { Deprecation::CountDeprecation(context.element->GetDocument(), - UseCounter::kCSSDeepCombinator); + WebFeature::kCSSDeepCombinator); } if (ShadowRoot* root = context.element->ContainingShadowRoot()) { if (root->GetType() == ShadowRootType::kUserAgent) @@ -454,7 +454,7 @@ SelectorChecker::MatchStatus SelectorChecker::MatchForRelation( kSelectorMatches) { if (context.element->IsInShadowTree()) { UseCounter::Count(context.element->GetDocument(), - UseCounter::kCSSDeepCombinatorAndShadow); + WebFeature::kCSSDeepCombinatorAndShadow); } return kSelectorMatches; } @@ -469,7 +469,7 @@ SelectorChecker::MatchStatus SelectorChecker::MatchForRelation( MatchStatus match = MatchSelector(next_context, result); if (match == kSelectorMatches && context.element->IsInShadowTree()) { UseCounter::Count(context.element->GetDocument(), - UseCounter::kCSSDeepCombinatorAndShadow); + WebFeature::kCSSDeepCombinatorAndShadow); } if (match == kSelectorMatches || match == kSelectorFailsCompletely) return match; @@ -482,7 +482,7 @@ SelectorChecker::MatchStatus SelectorChecker::MatchForRelation( case CSSSelector::kShadowPiercingDescendant: { DCHECK_EQ(mode_, kQueryingRules); UseCounter::Count(context.element->GetDocument(), - UseCounter::kCSSShadowPiercingDescendantCombinator); + WebFeature::kCSSShadowPiercingDescendantCombinator); // TODO(kochi): parentOrOpenShadowHostElement() is necessary because // SelectorQuery can pass V0 shadow roots. All closed shadow roots are // already filtered out, thus once V0 is removed this logic can use @@ -657,7 +657,7 @@ static bool AnyAttributeMatches(Element& element, AttributeValueMatches(attribute_item, match, selector_value, kTextCaseASCIIInsensitive)) { UseCounter::Count(element.GetDocument(), - UseCounter::kCaseInsensitiveAttrSelectorMatch); + WebFeature::kCaseInsensitiveAttrSelectorMatch); return true; } if (selector_attr.NamespaceURI() != g_star_atom) diff --git a/third_party/WebKit/Source/core/css/StyleSheetList.cpp b/third_party/WebKit/Source/core/css/StyleSheetList.cpp index a204fdeb89948d..b1ed63c3ef96dd 100644 --- a/third_party/WebKit/Source/core/css/StyleSheetList.cpp +++ b/third_party/WebKit/Source/core/css/StyleSheetList.cpp @@ -63,7 +63,7 @@ HTMLStyleElement* StyleSheetList::GetNamedItem(const AtomicString& name) const { CSSStyleSheet* StyleSheetList::AnonymousNamedGetter(const AtomicString& name) { if (GetDocument()) { UseCounter::Count(*GetDocument(), - UseCounter::kStyleSheetListAnonymousNamedGetter); + WebFeature::kStyleSheetListAnonymousNamedGetter); } HTMLStyleElement* item = GetNamedItem(name); if (!item) diff --git a/third_party/WebKit/Source/core/css/parser/CSSAtRuleID.cpp b/third_party/WebKit/Source/core/css/parser/CSSAtRuleID.cpp index 4e9575c315cf2e..d7b1963bae510b 100644 --- a/third_party/WebKit/Source/core/css/parser/CSSAtRuleID.cpp +++ b/third_party/WebKit/Source/core/css/parser/CSSAtRuleID.cpp @@ -36,43 +36,43 @@ CSSAtRuleID CssAtRuleID(StringView name) { } void CountAtRule(const CSSParserContext* context, CSSAtRuleID rule_id) { - UseCounter::Feature feature; + WebFeature feature; switch (rule_id) { case kCSSAtRuleCharset: - feature = UseCounter::kCSSAtRuleCharset; + feature = WebFeature::kCSSAtRuleCharset; break; case kCSSAtRuleFontFace: - feature = UseCounter::kCSSAtRuleFontFace; + feature = WebFeature::kCSSAtRuleFontFace; break; case kCSSAtRuleImport: - feature = UseCounter::kCSSAtRuleImport; + feature = WebFeature::kCSSAtRuleImport; break; case kCSSAtRuleKeyframes: - feature = UseCounter::kCSSAtRuleKeyframes; + feature = WebFeature::kCSSAtRuleKeyframes; break; case kCSSAtRuleMedia: - feature = UseCounter::kCSSAtRuleMedia; + feature = WebFeature::kCSSAtRuleMedia; break; case kCSSAtRuleNamespace: - feature = UseCounter::kCSSAtRuleNamespace; + feature = WebFeature::kCSSAtRuleNamespace; break; case kCSSAtRulePage: - feature = UseCounter::kCSSAtRulePage; + feature = WebFeature::kCSSAtRulePage; break; case kCSSAtRuleSupports: - feature = UseCounter::kCSSAtRuleSupports; + feature = WebFeature::kCSSAtRuleSupports; break; case kCSSAtRuleViewport: - feature = UseCounter::kCSSAtRuleViewport; + feature = WebFeature::kCSSAtRuleViewport; break; case kCSSAtRuleWebkitKeyframes: - feature = UseCounter::kCSSAtRuleWebkitKeyframes; + feature = WebFeature::kCSSAtRuleWebkitKeyframes; break; case kCSSAtRuleApply: - feature = UseCounter::kCSSAtRuleApply; + feature = WebFeature::kCSSAtRuleApply; break; case kCSSAtRuleInvalid: diff --git a/third_party/WebKit/Source/core/css/parser/CSSParserContext.cpp b/third_party/WebKit/Source/core/css/parser/CSSParserContext.cpp index 5d36453e24bcff..fe11bce6113bf6 100644 --- a/third_party/WebKit/Source/core/css/parser/CSSParserContext.cpp +++ b/third_party/WebKit/Source/core/css/parser/CSSParserContext.cpp @@ -165,12 +165,12 @@ KURL CSSParserContext::CompleteURL(const String& url) const { return KURL(BaseURL(), url, Charset()); } -void CSSParserContext::Count(UseCounter::Feature feature) const { +void CSSParserContext::Count(WebFeature feature) const { if (IsUseCounterRecordingEnabled()) UseCounter::Count(*document_, feature); } -void CSSParserContext::CountDeprecation(UseCounter::Feature feature) const { +void CSSParserContext::CountDeprecation(WebFeature feature) const { if (IsUseCounterRecordingEnabled()) Deprecation::CountDeprecation(*document_, feature); } diff --git a/third_party/WebKit/Source/core/css/parser/CSSParserContext.h b/third_party/WebKit/Source/core/css/parser/CSSParserContext.h index 2e3b2ae618d827..d096d52b64b12e 100644 --- a/third_party/WebKit/Source/core/css/parser/CSSParserContext.h +++ b/third_party/WebKit/Source/core/css/parser/CSSParserContext.h @@ -82,9 +82,9 @@ class CORE_EXPORT CSSParserContext KURL CompleteURL(const String& url) const; - void Count(UseCounter::Feature) const; + void Count(WebFeature) const; void Count(CSSParserMode, CSSPropertyID) const; - void CountDeprecation(UseCounter::Feature) const; + void CountDeprecation(WebFeature) const; bool IsUseCounterRecordingEnabled() const { return document_; } bool IsDocumentHandleEqual(const Document* other) const; diff --git a/third_party/WebKit/Source/core/css/parser/CSSParserImpl.cpp b/third_party/WebKit/Source/core/css/parser/CSSParserImpl.cpp index c2f9d0d9ecb05b..73ac4128cb0095 100644 --- a/third_party/WebKit/Source/core/css/parser/CSSParserImpl.cpp +++ b/third_party/WebKit/Source/core/css/parser/CSSParserImpl.cpp @@ -705,7 +705,7 @@ StyleRuleKeyframes* CSSParserImpl::ConsumeKeyframesRule( if (name_token.GetType() == kIdentToken) { name = name_token.Value().ToString(); } else if (name_token.GetType() == kStringToken && webkit_prefixed) { - context_->Count(UseCounter::kQuotedKeyframesRule); + context_->Count(WebFeature::kQuotedKeyframesRule); name = name_token.Value().ToString(); } else { return nullptr; // Parse error; expected ident token in @keyframes header diff --git a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp index 506fb5b414a3fe..fa4a3331271ce6 100644 --- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp +++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp @@ -607,7 +607,7 @@ static CSSFunctionValue* ConsumeFilterFunction( parsed_value = ParseSingleShadow(args, context->Mode(), false); } else { if (args.AtEnd()) { - context->Count(UseCounter::kCSSFilterFunctionNoArguments); + context->Count(WebFeature::kCSSFilterFunctionNoArguments); return filter_value; } if (filter_type == CSSValueBrightness) { @@ -617,7 +617,7 @@ static CSSFunctionValue* ConsumeFilterFunction( parsed_value = ConsumeNumber(args, kValueRangeAll); } else if (filter_type == CSSValueHueRotate) { parsed_value = - ConsumeAngle(args, *context, UseCounter::kUnitlessZeroAngleFilter); + ConsumeAngle(args, *context, WebFeature::kUnitlessZeroAngleFilter); } else if (filter_type == CSSValueBlur) { parsed_value = ConsumeLength(args, kHTMLStandardMode, kValueRangeNonNegative); @@ -687,14 +687,13 @@ static CSSValue* ConsumeTextDecorationLine(CSSParserTokenRange& range) { static CSSValue* ConsumeOffsetRotate(CSSParserTokenRange& range, const CSSParserContext& context) { - CSSValue* angle = - ConsumeAngle(range, context, Optional()); + CSSValue* angle = ConsumeAngle(range, context, Optional()); CSSValue* keyword = ConsumeIdent(range); if (!angle && !keyword) return nullptr; if (!angle) { - angle = ConsumeAngle(range, context, Optional()); + angle = ConsumeAngle(range, context, Optional()); } CSSValueList* list = CSSValueList::CreateSpaceSeparated(); @@ -744,7 +743,7 @@ static CSSValue* ConsumePerspective(CSSParserTokenRange& range, double perspective; if (!ConsumeNumberRaw(range, perspective)) return nullptr; - context->Count(UseCounter::kUnitlessPerspectiveInPerspectiveProperty); + context->Count(WebFeature::kUnitlessPerspectiveInPerspectiveProperty); parsed_value = CSSPrimitiveValue::Create( perspective, CSSPrimitiveValue::UnitType::kPixels); } @@ -1525,31 +1524,31 @@ static void CountKeywordOnlyPropertyUsage(CSSPropertyID property, return; switch (property) { case CSSPropertyWebkitAppearance: { - UseCounter::Feature feature; + WebFeature feature; if (value_id == CSSValueNone) { - feature = UseCounter::kCSSValueAppearanceNone; + feature = WebFeature::kCSSValueAppearanceNone; } else { - feature = UseCounter::kCSSValueAppearanceNotNone; + feature = WebFeature::kCSSValueAppearanceNotNone; if (value_id == CSSValueButton) - feature = UseCounter::kCSSValueAppearanceButton; + feature = WebFeature::kCSSValueAppearanceButton; else if (value_id == CSSValueCaret) - feature = UseCounter::kCSSValueAppearanceCaret; + feature = WebFeature::kCSSValueAppearanceCaret; else if (value_id == CSSValueCheckbox) - feature = UseCounter::kCSSValueAppearanceCheckbox; + feature = WebFeature::kCSSValueAppearanceCheckbox; else if (value_id == CSSValueMenulist) - feature = UseCounter::kCSSValueAppearanceMenulist; + feature = WebFeature::kCSSValueAppearanceMenulist; else if (value_id == CSSValueMenulistButton) - feature = UseCounter::kCSSValueAppearanceMenulistButton; + feature = WebFeature::kCSSValueAppearanceMenulistButton; else if (value_id == CSSValueListbox) - feature = UseCounter::kCSSValueAppearanceListbox; + feature = WebFeature::kCSSValueAppearanceListbox; else if (value_id == CSSValueRadio) - feature = UseCounter::kCSSValueAppearanceRadio; + feature = WebFeature::kCSSValueAppearanceRadio; else if (value_id == CSSValueSearchfield) - feature = UseCounter::kCSSValueAppearanceSearchField; + feature = WebFeature::kCSSValueAppearanceSearchField; else if (value_id == CSSValueTextfield) - feature = UseCounter::kCSSValueAppearanceTextField; + feature = WebFeature::kCSSValueAppearanceTextField; else - feature = UseCounter::kCSSValueAppearanceOthers; + feature = WebFeature::kCSSValueAppearanceOthers; } context->Count(feature); break; @@ -1558,13 +1557,13 @@ static void CountKeywordOnlyPropertyUsage(CSSPropertyID property, case CSSPropertyWebkitUserModify: { switch (value_id) { case CSSValueReadOnly: - context->Count(UseCounter::kCSSValueUserModifyReadOnly); + context->Count(WebFeature::kCSSValueUserModifyReadOnly); break; case CSSValueReadWrite: - context->Count(UseCounter::kCSSValueUserModifyReadWrite); + context->Count(WebFeature::kCSSValueUserModifyReadWrite); break; case CSSValueReadWritePlaintextOnly: - context->Count(UseCounter::kCSSValueUserModifyReadWritePlaintextOnly); + context->Count(WebFeature::kCSSValueUserModifyReadWritePlaintextOnly); break; default: NOTREACHED(); @@ -1628,13 +1627,13 @@ const CSSValue* CSSPropertyParser::ParseSingleValue( case CSSPropertyScrollSnapDestination: // TODO(crbug.com/724912): Retire scroll-snap-destination return ConsumePosition(range_, *context_, UnitlessQuirk::kForbid, - Optional()); + Optional()); case CSSPropertyObjectPosition: return ConsumePosition(range_, *context_, UnitlessQuirk::kForbid, - UseCounter::kThreeValuedPositionObjectPosition); + WebFeature::kThreeValuedPositionObjectPosition); case CSSPropertyPerspectiveOrigin: return ConsumePosition(range_, *context_, UnitlessQuirk::kForbid, - UseCounter::kThreeValuedPositionPerspectiveOrigin); + WebFeature::kThreeValuedPositionPerspectiveOrigin); case CSSPropertyWebkitHyphenateCharacter: case CSSPropertyWebkitLocale: return ConsumeLocale(range_); @@ -2603,7 +2602,7 @@ static bool ConsumeBackgroundPosition(CSSParserTokenRange& range, CSSValue* position_x = nullptr; CSSValue* position_y = nullptr; if (!ConsumePosition(range, *context, unitless, - UseCounter::kThreeValuedPositionBackground, position_x, + WebFeature::kThreeValuedPositionBackground, position_x, position_y)) return false; AddBackgroundValue(result_x, position_x); @@ -2685,7 +2684,7 @@ bool CSSPropertyParser::ConsumeBackgroundShorthand( } else if (property == CSSPropertyBackgroundPositionX || property == CSSPropertyWebkitMaskPositionX) { if (!ConsumePosition(range_, *context_, UnitlessQuirk::kForbid, - UseCounter::kThreeValuedPositionBackground, + WebFeature::kThreeValuedPositionBackground, value, value_y)) continue; } else if (property == CSSPropertyBackgroundSize || diff --git a/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp b/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp index 0bf341130fec99..524e3439f3b84f 100644 --- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp +++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp @@ -332,10 +332,9 @@ CSSPrimitiveValue* ConsumeGradientLengthOrPercent( return ConsumeLengthOrPercent(range, context.Mode(), value_range, unitless); } -CSSPrimitiveValue* ConsumeAngle( - CSSParserTokenRange& range, - const CSSParserContext& context, - WTF::Optional unitlessZeroFeature) { +CSSPrimitiveValue* ConsumeAngle(CSSParserTokenRange& range, + const CSSParserContext& context, + WTF::Optional unitlessZeroFeature) { const CSSParserToken& token = range.Peek(); if (token.GetType() == kDimensionToken) { switch (token.GetUnitType()) { @@ -733,7 +732,7 @@ static void PositionFromThreeOrFourValues(CSSValue** values, bool ConsumePosition(CSSParserTokenRange& range, const CSSParserContext& context, UnitlessQuirk unitless, - WTF::Optional threeValuePosition, + WTF::Optional threeValuePosition, CSSValue*& result_x, CSSValue*& result_y) { bool horizontal_edge = false; @@ -804,11 +803,10 @@ bool ConsumePosition(CSSParserTokenRange& range, return true; } -CSSValuePair* ConsumePosition( - CSSParserTokenRange& range, - const CSSParserContext& context, - UnitlessQuirk unitless, - WTF::Optional threeValuePosition) { +CSSValuePair* ConsumePosition(CSSParserTokenRange& range, + const CSSParserContext& context, + UnitlessQuirk unitless, + WTF::Optional threeValuePosition) { CSSValue* result_x = nullptr; CSSValue* result_y = nullptr; if (ConsumePosition(range, context, unitless, threeValuePosition, result_x, @@ -979,7 +977,7 @@ static CSSPrimitiveValue* ConsumeGradientAngleOrPercent( UnitlessQuirk) { const CSSParserToken& token = range.Peek(); if (token.GetType() == kDimensionToken || token.GetType() == kNumberToken) { - return ConsumeAngle(range, context, WTF::Optional()); + return ConsumeAngle(range, context, WTF::Optional()); } if (token.GetType() == kPercentageToken) return ConsumePercent(range, value_range); @@ -1155,7 +1153,7 @@ static CSSValue* ConsumeRadialGradient(CSSParserTokenRange& args, if (args.Peek().Id() == CSSValueAt) { args.ConsumeIncludingWhitespace(); ConsumePosition(args, context, UnitlessQuirk::kForbid, - UseCounter::kThreeValuedPositionGradient, center_x, + WebFeature::kThreeValuedPositionGradient, center_x, center_y); if (!(center_x && center_y)) return nullptr; @@ -1182,7 +1180,7 @@ static CSSValue* ConsumeLinearGradient(CSSParserTokenRange& args, CSSGradientType gradient_type) { bool expect_comma = true; const CSSPrimitiveValue* angle = - ConsumeAngle(args, context, UseCounter::kUnitlessZeroAngleGradient); + ConsumeAngle(args, context, WebFeature::kUnitlessZeroAngleGradient); const CSSIdentifierValue* end_x = nullptr; const CSSIdentifierValue* end_y = nullptr; if (!angle) { @@ -1222,8 +1220,8 @@ static CSSValue* ConsumeConicGradient(CSSParserTokenRange& args, const CSSPrimitiveValue* from_angle = nullptr; if (ConsumeIdent(args)) { - if (!(from_angle = ConsumeAngle(args, context, - WTF::Optional()))) + if (!(from_angle = + ConsumeAngle(args, context, WTF::Optional()))) return nullptr; } @@ -1231,7 +1229,7 @@ static CSSValue* ConsumeConicGradient(CSSParserTokenRange& args, CSSValue* center_y = nullptr; if (ConsumeIdent(args)) { if (!ConsumePosition(args, context, UnitlessQuirk::kForbid, - UseCounter::kThreeValuedPositionGradient, center_x, + WebFeature::kThreeValuedPositionGradient, center_x, center_y)) return nullptr; } @@ -1337,11 +1335,11 @@ static CSSValue* ConsumeGeneratedImage(CSSParserTokenRange& range, } else if (id == CSSValueRepeatingRadialGradient) { result = ConsumeRadialGradient(args, *context, kRepeating); } else if (id == CSSValueWebkitLinearGradient) { - context->Count(UseCounter::kDeprecatedWebKitLinearGradient); + context->Count(WebFeature::kDeprecatedWebKitLinearGradient); result = ConsumeLinearGradient(args, *context, kNonRepeating, kCSSPrefixedLinearGradient); } else if (id == CSSValueWebkitRepeatingLinearGradient) { - context->Count(UseCounter::kDeprecatedWebKitRepeatingLinearGradient); + context->Count(WebFeature::kDeprecatedWebKitRepeatingLinearGradient); result = ConsumeLinearGradient(args, *context, kRepeating, kCSSPrefixedLinearGradient); } else if (id == CSSValueRepeatingLinearGradient) { @@ -1351,13 +1349,13 @@ static CSSValue* ConsumeGeneratedImage(CSSParserTokenRange& range, result = ConsumeLinearGradient(args, *context, kNonRepeating, kCSSLinearGradient); } else if (id == CSSValueWebkitGradient) { - context->Count(UseCounter::kDeprecatedWebKitGradient); + context->Count(WebFeature::kDeprecatedWebKitGradient); result = ConsumeDeprecatedGradient(args, context->Mode()); } else if (id == CSSValueWebkitRadialGradient) { - context->Count(UseCounter::kDeprecatedWebKitRadialGradient); + context->Count(WebFeature::kDeprecatedWebKitRadialGradient); result = ConsumeDeprecatedRadialGradient(args, *context, kNonRepeating); } else if (id == CSSValueWebkitRepeatingRadialGradient) { - context->Count(UseCounter::kDeprecatedWebKitRepeatingRadialGradient); + context->Count(WebFeature::kDeprecatedWebKitRepeatingRadialGradient); result = ConsumeDeprecatedRadialGradient(args, *context, kRepeating); } else if (id == CSSValueConicGradient) { result = ConsumeConicGradient(args, *context, kNonRepeating); diff --git a/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.h b/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.h index 3d42a0ba71e0c5..fe5e17adbb5dfe 100644 --- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.h +++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.h @@ -57,10 +57,9 @@ CSSPrimitiveValue* ConsumeLengthOrPercent( ValueRange, UnitlessQuirk = UnitlessQuirk::kForbid); -CSSPrimitiveValue* ConsumeAngle( - CSSParserTokenRange&, - const CSSParserContext&, - WTF::Optional unitlessZeroFeature); +CSSPrimitiveValue* ConsumeAngle(CSSParserTokenRange&, + const CSSParserContext&, + WTF::Optional unitlessZeroFeature); CSSPrimitiveValue* ConsumeTime(CSSParserTokenRange&, ValueRange); CSSPrimitiveValue* ConsumeResolution(CSSParserTokenRange&); @@ -84,15 +83,14 @@ CSSValue* ConsumeColor(CSSParserTokenRange&, CSSValue* ConsumeLineWidth(CSSParserTokenRange&, CSSParserMode, UnitlessQuirk); -CSSValuePair* ConsumePosition( - CSSParserTokenRange&, - const CSSParserContext&, - UnitlessQuirk, - WTF::Optional threeValuePosition); +CSSValuePair* ConsumePosition(CSSParserTokenRange&, + const CSSParserContext&, + UnitlessQuirk, + WTF::Optional threeValuePosition); bool ConsumePosition(CSSParserTokenRange&, const CSSParserContext&, UnitlessQuirk, - WTF::Optional threeValuePosition, + WTF::Optional threeValuePosition, CSSValue*& result_x, CSSValue*& result_y); bool ConsumeOneOrTwoValuedPosition(CSSParserTokenRange&, diff --git a/third_party/WebKit/Source/core/css/parser/CSSSelectorParser.cpp b/third_party/WebKit/Source/core/css/parser/CSSSelectorParser.cpp index a1988722c94c52..1896a4763f7ea3 100644 --- a/third_party/WebKit/Source/core/css/parser/CSSSelectorParser.cpp +++ b/third_party/WebKit/Source/core/css/parser/CSSSelectorParser.cpp @@ -835,44 +835,44 @@ void CSSSelectorParser::RecordUsageAndDeprecations( selector = CSSSelectorList::Next(*selector)) { for (const CSSSelector* current = selector; current; current = current->TagHistory()) { - UseCounter::Feature feature = UseCounter::kNumberOfFeatures; + WebFeature feature = WebFeature::kNumberOfFeatures; switch (current->GetPseudoType()) { case CSSSelector::kPseudoAny: - feature = UseCounter::kCSSSelectorPseudoAny; + feature = WebFeature::kCSSSelectorPseudoAny; break; case CSSSelector::kPseudoUnresolved: - feature = UseCounter::kCSSSelectorPseudoUnresolved; + feature = WebFeature::kCSSSelectorPseudoUnresolved; break; case CSSSelector::kPseudoDefined: - feature = UseCounter::kCSSSelectorPseudoDefined; + feature = WebFeature::kCSSSelectorPseudoDefined; break; case CSSSelector::kPseudoSlotted: - feature = UseCounter::kCSSSelectorPseudoSlotted; + feature = WebFeature::kCSSSelectorPseudoSlotted; break; case CSSSelector::kPseudoContent: - feature = UseCounter::kCSSSelectorPseudoContent; + feature = WebFeature::kCSSSelectorPseudoContent; break; case CSSSelector::kPseudoHost: - feature = UseCounter::kCSSSelectorPseudoHost; + feature = WebFeature::kCSSSelectorPseudoHost; break; case CSSSelector::kPseudoHostContext: - feature = UseCounter::kCSSSelectorPseudoHostContext; + feature = WebFeature::kCSSSelectorPseudoHostContext; break; case CSSSelector::kPseudoFullScreenAncestor: - feature = UseCounter::kCSSSelectorPseudoFullScreenAncestor; + feature = WebFeature::kCSSSelectorPseudoFullScreenAncestor; break; case CSSSelector::kPseudoFullScreen: - feature = UseCounter::kCSSSelectorPseudoFullScreen; + feature = WebFeature::kCSSSelectorPseudoFullScreen; break; case CSSSelector::kPseudoListBox: if (context_->Mode() != kUASheetMode) - feature = UseCounter::kCSSSelectorInternalPseudoListBox; + feature = WebFeature::kCSSSelectorInternalPseudoListBox; break; case CSSSelector::kPseudoWebKitCustomElement: if (context_->Mode() != kUASheetMode) { if (current->Value() == "-internal-media-controls-overlay-cast-button") { - feature = UseCounter:: + feature = WebFeature:: kCSSSelectorInternalMediaControlsOverlayCastButton; } } @@ -880,21 +880,21 @@ void CSSSelectorParser::RecordUsageAndDeprecations( case CSSSelector::kPseudoSpatialNavigationFocus: if (context_->Mode() != kUASheetMode) { feature = - UseCounter::kCSSSelectorInternalPseudoSpatialNavigationFocus; + WebFeature::kCSSSelectorInternalPseudoSpatialNavigationFocus; } break; case CSSSelector::kPseudoReadOnly: if (context_->Mode() != kUASheetMode) - feature = UseCounter::kCSSSelectorPseudoReadOnly; + feature = WebFeature::kCSSSelectorPseudoReadOnly; break; case CSSSelector::kPseudoReadWrite: if (context_->Mode() != kUASheetMode) - feature = UseCounter::kCSSSelectorPseudoReadWrite; + feature = WebFeature::kCSSSelectorPseudoReadWrite; break; default: break; } - if (feature != UseCounter::kNumberOfFeatures) { + if (feature != WebFeature::kNumberOfFeatures) { if (!Deprecation::DeprecationMessage(feature).IsEmpty() && style_sheet_->AnyOwnerDocument()) { Deprecation::CountDeprecation(*style_sheet_->AnyOwnerDocument(), @@ -904,7 +904,7 @@ void CSSSelectorParser::RecordUsageAndDeprecations( } } if (current->Relation() == CSSSelector::kIndirectAdjacent) - context_->Count(UseCounter::kCSSSelectorIndirectAdjacent); + context_->Count(WebFeature::kCSSSelectorIndirectAdjacent); if (current->SelectorList()) RecordUsageAndDeprecations(*current->SelectorList()); } diff --git a/third_party/WebKit/Source/core/css/properties/CSSPropertyAPICursor.cpp b/third_party/WebKit/Source/core/css/properties/CSSPropertyAPICursor.cpp index 9f01751974393f..7df161d3e75834 100644 --- a/third_party/WebKit/Source/core/css/properties/CSSPropertyAPICursor.cpp +++ b/third_party/WebKit/Source/core/css/properties/CSSPropertyAPICursor.cpp @@ -48,9 +48,9 @@ const CSSValue* CSSPropertyAPICursor::parseSingleValue( CSSValueID id = range.Peek().Id(); if (!range.AtEnd()) { if (id == CSSValueWebkitZoomIn) - context.Count(UseCounter::kPrefixedCursorZoomIn); + context.Count(WebFeature::kPrefixedCursorZoomIn); else if (id == CSSValueWebkitZoomOut) - context.Count(UseCounter::kPrefixedCursorZoomOut); + context.Count(WebFeature::kPrefixedCursorZoomOut); } CSSValue* cursor_type = nullptr; if (id == CSSValueHand) { diff --git a/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIImageOrientation.cpp b/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIImageOrientation.cpp index 7624d160771d23..c87c1ad7ba2c59 100644 --- a/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIImageOrientation.cpp +++ b/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIImageOrientation.cpp @@ -21,7 +21,7 @@ const CSSValue* CSSPropertyAPIImageOrientation::parseSingleValue( return CSSPropertyParserHelpers::ConsumeIdent(range); if (range.Peek().GetType() != kNumberToken) { CSSPrimitiveValue* angle = CSSPropertyParserHelpers::ConsumeAngle( - range, context, WTF::Optional()); + range, context, WTF::Optional()); if (angle && angle->GetDoubleValue() == 0) return angle; } diff --git a/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIOffsetAnchor.cpp b/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIOffsetAnchor.cpp index bf605632db9c1f..16b4d7226db6ae 100644 --- a/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIOffsetAnchor.cpp +++ b/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIOffsetAnchor.cpp @@ -22,7 +22,7 @@ const CSSValue* CSSPropertyAPIOffsetAnchor::parseSingleValue( if (id == CSSValueAuto) return ConsumeIdent(range); return ConsumePosition(range, context, UnitlessQuirk::kForbid, - Optional()); + Optional()); } } // namespace blink diff --git a/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIOffsetPosition.cpp b/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIOffsetPosition.cpp index ad45dccf2b3818..2b3a2b167f47e9 100644 --- a/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIOffsetPosition.cpp +++ b/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIOffsetPosition.cpp @@ -22,11 +22,11 @@ const CSSValue* CSSPropertyAPIOffsetPosition::parseSingleValue( if (id == CSSValueAuto) return ConsumeIdent(range); CSSValue* value = ConsumePosition(range, context, UnitlessQuirk::kForbid, - Optional()); + Optional()); // Count when we receive a valid position other than 'auto'. if (value && value->IsValuePair()) - context.Count(UseCounter::kCSSOffsetInEffect); + context.Count(WebFeature::kCSSOffsetInEffect); return value; } diff --git a/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIRotate.cpp b/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIRotate.cpp index 389101962ed642..ad59521a9a9ad9 100644 --- a/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIRotate.cpp +++ b/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIRotate.cpp @@ -36,7 +36,7 @@ const CSSValue* CSSPropertyAPIRotate::parseSingleValue( } CSSValue* rotation = CSSPropertyParserHelpers::ConsumeAngle( - range, context, WTF::Optional()); + range, context, WTF::Optional()); if (!rotation) return nullptr; list->Append(*rotation); diff --git a/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIScrollSnapCoordinate.cpp b/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIScrollSnapCoordinate.cpp index bc15860c614700..95a03eb3009d1e 100644 --- a/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIScrollSnapCoordinate.cpp +++ b/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIScrollSnapCoordinate.cpp @@ -21,7 +21,7 @@ static CSSValueList* ConsumePositionList(CSSParserTokenRange& range, CSSValueList* positions = CSSValueList::CreateCommaSeparated(); do { CSSValue* position = ConsumePosition(range, context, UnitlessQuirk::kForbid, - Optional()); + Optional()); if (!position) return nullptr; positions->Append(*position); diff --git a/third_party/WebKit/Source/core/css/properties/CSSPropertyAPITransform.cpp b/third_party/WebKit/Source/core/css/properties/CSSPropertyAPITransform.cpp index c2bf72f0d4dc19..69efb481f7eef8 100644 --- a/third_party/WebKit/Source/core/css/properties/CSSPropertyAPITransform.cpp +++ b/third_party/WebKit/Source/core/css/properties/CSSPropertyAPITransform.cpp @@ -44,7 +44,7 @@ bool ConsumePerspective(CSSParserTokenRange& args, perspective < 0) { return false; } - context->Count(UseCounter::kUnitlessPerspectiveInTransformProperty); + context->Count(WebFeature::kUnitlessPerspectiveInTransformProperty); parsed_value = CSSPrimitiveValue::Create( perspective, CSSPrimitiveValue::UnitType::kPixels); } @@ -96,14 +96,14 @@ CSSValue* ConsumeTransformValue(CSSParserTokenRange& range, case CSSValueSkewY: case CSSValueSkew: parsed_value = CSSPropertyParserHelpers::ConsumeAngle( - args, *context, UseCounter::kUnitlessZeroAngleTransform); + args, *context, WebFeature::kUnitlessZeroAngleTransform); if (!parsed_value) return nullptr; if (function_id == CSSValueSkew && CSSPropertyParserHelpers::ConsumeCommaIncludingWhitespace(args)) { transform_value->Append(*parsed_value); parsed_value = CSSPropertyParserHelpers::ConsumeAngle( - args, *context, UseCounter::kUnitlessZeroAngleTransform); + args, *context, WebFeature::kUnitlessZeroAngleTransform); if (!parsed_value) return nullptr; } @@ -168,7 +168,7 @@ CSSValue* ConsumeTransformValue(CSSParserTokenRange& range, return nullptr; } parsed_value = CSSPropertyParserHelpers::ConsumeAngle( - args, *context, UseCounter::kUnitlessZeroAngleTransform); + args, *context, WebFeature::kUnitlessZeroAngleTransform); if (!parsed_value) return nullptr; break; diff --git a/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIZoom.cpp b/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIZoom.cpp index 5c8de41bf59a8e..cfa7e5a2aa42f3 100644 --- a/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIZoom.cpp +++ b/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIZoom.cpp @@ -33,7 +33,7 @@ const CSSValue* CSSPropertyAPIZoom::parseSingleValue( ToCSSPrimitiveValue(zoom)->GetDoubleValue() == 1) || (token.GetType() == kPercentageToken && ToCSSPrimitiveValue(zoom)->GetDoubleValue() == 100))) - context.Count(UseCounter::kCSSZoomNotEqualToOne); + context.Count(WebFeature::kCSSZoomNotEqualToOne); } return zoom; } diff --git a/third_party/WebKit/Source/core/css/properties/CSSPropertyAnimationNameUtils.cpp b/third_party/WebKit/Source/core/css/properties/CSSPropertyAnimationNameUtils.cpp index 074d4dcfe5224d..4cac2416eef010 100644 --- a/third_party/WebKit/Source/core/css/properties/CSSPropertyAnimationNameUtils.cpp +++ b/third_party/WebKit/Source/core/css/properties/CSSPropertyAnimationNameUtils.cpp @@ -18,7 +18,7 @@ CSSValue* CSSPropertyAnimationNameUtils::ConsumeAnimationName( if (allow_quoted_name && range.Peek().GetType() == kStringToken) { // Legacy support for strings in prefixed animations. - context->Count(UseCounter::kQuotedAnimationName); + context->Count(WebFeature::kQuotedAnimationName); const CSSParserToken& token = range.ConsumeIncludingWhitespace(); if (EqualIgnoringASCIICase(token.Value(), "none")) diff --git a/third_party/WebKit/Source/core/css/properties/CSSPropertyLengthUtils.cpp b/third_party/WebKit/Source/core/css/properties/CSSPropertyLengthUtils.cpp index 88248843848ed6..569bd46d395d85 100644 --- a/third_party/WebKit/Source/core/css/properties/CSSPropertyLengthUtils.cpp +++ b/third_party/WebKit/Source/core/css/properties/CSSPropertyLengthUtils.cpp @@ -19,16 +19,16 @@ bool ValidWidthOrHeightKeyword(CSSValueID id, const CSSParserContext& context) { id == CSSValueFitContent) { switch (id) { case CSSValueWebkitMinContent: - context.Count(UseCounter::kCSSValuePrefixedMinContent); + context.Count(WebFeature::kCSSValuePrefixedMinContent); break; case CSSValueWebkitMaxContent: - context.Count(UseCounter::kCSSValuePrefixedMaxContent); + context.Count(WebFeature::kCSSValuePrefixedMaxContent); break; case CSSValueWebkitFillAvailable: - context.Count(UseCounter::kCSSValuePrefixedFillAvailable); + context.Count(WebFeature::kCSSValuePrefixedFillAvailable); break; case CSSValueWebkitFitContent: - context.Count(UseCounter::kCSSValuePrefixedFitContent); + context.Count(WebFeature::kCSSValuePrefixedFitContent); break; default: break; diff --git a/third_party/WebKit/Source/core/css/properties/CSSPropertyOffsetPathUtils.cpp b/third_party/WebKit/Source/core/css/properties/CSSPropertyOffsetPathUtils.cpp index 373479c0a4b078..711cf4b182ac38 100644 --- a/third_party/WebKit/Source/core/css/properties/CSSPropertyOffsetPathUtils.cpp +++ b/third_party/WebKit/Source/core/css/properties/CSSPropertyOffsetPathUtils.cpp @@ -57,7 +57,7 @@ CSSValue* ConsumeRay(CSSParserTokenRange& range, while (!function_args.AtEnd()) { if (!angle) { angle = CSSPropertyParserHelpers::ConsumeAngle( - function_args, context, WTF::Optional()); + function_args, context, WTF::Optional()); if (angle) continue; } @@ -96,7 +96,7 @@ CSSValue* CSSPropertyOffsetPathUtils::ConsumeOffsetPath( // Count when we receive a valid path other than 'none'. if (value && !value->IsIdentifierValue()) - context.Count(UseCounter::kCSSOffsetInEffect); + context.Count(WebFeature::kCSSOffsetInEffect); return value; } diff --git a/third_party/WebKit/Source/core/css/properties/CSSPropertyShapeUtils.cpp b/third_party/WebKit/Source/core/css/properties/CSSPropertyShapeUtils.cpp index 3c3d156dc1f6ed..6cd69ac26ccf2d 100644 --- a/third_party/WebKit/Source/core/css/properties/CSSPropertyShapeUtils.cpp +++ b/third_party/WebKit/Source/core/css/properties/CSSPropertyShapeUtils.cpp @@ -35,7 +35,7 @@ static CSSBasicShapeCircleValue* ConsumeBasicShapeCircle( CSSValue* center_x = nullptr; CSSValue* center_y = nullptr; if (!ConsumePosition(args, context, UnitlessQuirk::kForbid, - UseCounter::kThreeValuedPositionBasicShape, center_x, + WebFeature::kThreeValuedPositionBasicShape, center_x, center_y)) return nullptr; shape->SetCenterX(center_x); @@ -59,7 +59,7 @@ static CSSBasicShapeEllipseValue* ConsumeBasicShapeEllipse( CSSValue* center_x = nullptr; CSSValue* center_y = nullptr; if (!ConsumePosition(args, context, UnitlessQuirk::kForbid, - UseCounter::kThreeValuedPositionBasicShape, center_x, + WebFeature::kThreeValuedPositionBasicShape, center_x, center_y)) return nullptr; shape->SetCenterX(center_x); diff --git a/third_party/WebKit/Source/core/css/resolver/FilterOperationResolver.cpp b/third_party/WebKit/Source/core/css/resolver/FilterOperationResolver.cpp index 0d1f58d0a81126..c603991e35dffc 100644 --- a/third_party/WebKit/Source/core/css/resolver/FilterOperationResolver.cpp +++ b/third_party/WebKit/Source/core/css/resolver/FilterOperationResolver.cpp @@ -76,44 +76,44 @@ static void CountFilterUse(FilterOperation::OperationType operation_type, const Document& document) { // This variable is always reassigned, but MSVC thinks it might be left // uninitialized. - UseCounter::Feature feature = UseCounter::kNumberOfFeatures; + WebFeature feature = WebFeature::kNumberOfFeatures; switch (operation_type) { case FilterOperation::NONE: case FilterOperation::BOX_REFLECT: NOTREACHED(); return; case FilterOperation::REFERENCE: - feature = UseCounter::kCSSFilterReference; + feature = WebFeature::kCSSFilterReference; break; case FilterOperation::GRAYSCALE: - feature = UseCounter::kCSSFilterGrayscale; + feature = WebFeature::kCSSFilterGrayscale; break; case FilterOperation::SEPIA: - feature = UseCounter::kCSSFilterSepia; + feature = WebFeature::kCSSFilterSepia; break; case FilterOperation::SATURATE: - feature = UseCounter::kCSSFilterSaturate; + feature = WebFeature::kCSSFilterSaturate; break; case FilterOperation::HUE_ROTATE: - feature = UseCounter::kCSSFilterHueRotate; + feature = WebFeature::kCSSFilterHueRotate; break; case FilterOperation::INVERT: - feature = UseCounter::kCSSFilterInvert; + feature = WebFeature::kCSSFilterInvert; break; case FilterOperation::OPACITY: - feature = UseCounter::kCSSFilterOpacity; + feature = WebFeature::kCSSFilterOpacity; break; case FilterOperation::BRIGHTNESS: - feature = UseCounter::kCSSFilterBrightness; + feature = WebFeature::kCSSFilterBrightness; break; case FilterOperation::CONTRAST: - feature = UseCounter::kCSSFilterContrast; + feature = WebFeature::kCSSFilterContrast; break; case FilterOperation::BLUR: - feature = UseCounter::kCSSFilterBlur; + feature = WebFeature::kCSSFilterBlur; break; case FilterOperation::DROP_SHADOW: - feature = UseCounter::kCSSFilterDropShadow; + feature = WebFeature::kCSSFilterDropShadow; break; }; UseCounter::Count(document, feature); diff --git a/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp b/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp index 3468e4685a4a67..d561f3f6cb0dcf 100644 --- a/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp +++ b/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp @@ -359,11 +359,11 @@ static void AdjustStyleForDisplay(ComputedStyle& style, if (style.PaddingBefore().IsPercentOrCalc() || style.PaddingAfter().IsPercentOrCalc()) { UseCounter::Count(document, - UseCounter::kFlexboxPercentagePaddingVertical); + WebFeature::kFlexboxPercentagePaddingVertical); } if (style.MarginBefore().IsPercentOrCalc() || style.MarginAfter().IsPercentOrCalc()) { - UseCounter::Count(document, UseCounter::kFlexboxPercentageMarginVertical); + UseCounter::Count(document, WebFeature::kFlexboxPercentageMarginVertical); } } } diff --git a/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp b/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp index 5dea806fd3f8d8..2c6c1efdda5aa3 100644 --- a/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp +++ b/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp @@ -195,7 +195,7 @@ static bool ConvertFontFamilyName( family_name = AtomicString(ToCSSFontFamilyValue(value).Value()); #if OS(MACOSX) if (family_name == FontCache::LegacySystemFontFamily()) { - UseCounter::Count(state.GetDocument(), UseCounter::kBlinkMacSystemFont); + UseCounter::Count(state.GetDocument(), WebFeature::kBlinkMacSystemFont); family_name = FontFamilyNames::system_ui; } #endif diff --git a/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp b/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp index 6bdbd0cacca447..f642b89607c2a6 100644 --- a/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp +++ b/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp @@ -748,7 +748,7 @@ PassRefPtr StyleResolver::StyleForElement( ToCSSIdentifierValue(*value).GetValueID() == CSSValueBlock) { UseCounter::Count( element->GetDocument(), - UseCounter::kSummaryElementWithDisplayBlockAuthorRule); + WebFeature::kSummaryElementWithDisplayBlockAuthorRule); } } } diff --git a/third_party/WebKit/Source/core/dom/ClassicScript.cpp b/third_party/WebKit/Source/core/dom/ClassicScript.cpp index a4b726bb84f2a2..e54792f2e5736a 100644 --- a/third_party/WebKit/Source/core/dom/ClassicScript.cpp +++ b/third_party/WebKit/Source/core/dom/ClassicScript.cpp @@ -31,15 +31,15 @@ void LogScriptMIMEType(LocalFrame* frame, !is_text && mime_type.StartsWith("application/", kTextCaseASCIIInsensitive); - UseCounter::Feature feature = + WebFeature feature = is_same_origin - ? (is_text ? UseCounter::kSameOriginTextScript - : is_application ? UseCounter::kSameOriginApplicationScript - : UseCounter::kSameOriginOtherScript) + ? (is_text ? WebFeature::kSameOriginTextScript + : is_application ? WebFeature::kSameOriginApplicationScript + : WebFeature::kSameOriginOtherScript) : (is_text - ? UseCounter::kCrossOriginTextScript - : is_application ? UseCounter::kCrossOriginApplicationScript - : UseCounter::kCrossOriginOtherScript); + ? WebFeature::kCrossOriginTextScript + : is_application ? WebFeature::kCrossOriginApplicationScript + : WebFeature::kCrossOriginOtherScript); UseCounter::Count(frame, feature); } @@ -82,13 +82,13 @@ bool ClassicScript::CheckMIMETypeBeforeRunScript( "' because its MIME type ('" + mime_type + "') is not executable.")); if (mime_type.StartsWith("image/")) - UseCounter::Count(frame, UseCounter::kBlockedSniffingImageToScript); + UseCounter::Count(frame, WebFeature::kBlockedSniffingImageToScript); else if (mime_type.StartsWith("audio/")) - UseCounter::Count(frame, UseCounter::kBlockedSniffingAudioToScript); + UseCounter::Count(frame, WebFeature::kBlockedSniffingAudioToScript); else if (mime_type.StartsWith("video/")) - UseCounter::Count(frame, UseCounter::kBlockedSniffingVideoToScript); + UseCounter::Count(frame, WebFeature::kBlockedSniffingVideoToScript); else if (mime_type == "text/csv") - UseCounter::Count(frame, UseCounter::kBlockedSniffingCSVToScript); + UseCounter::Count(frame, WebFeature::kBlockedSniffingCSVToScript); return false; } diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp index 71537b4ed44a8a..9daa4f8ca93cff 100644 --- a/third_party/WebKit/Source/core/dom/Document.cpp +++ b/third_party/WebKit/Source/core/dom/Document.cpp @@ -418,8 +418,8 @@ static bool IsValidElementName(Document* document, const String& name) { // bindings is too slow. UseCounter::Count(document, is_valid_dom_name - ? UseCounter::kElementNameDOMValidHTMLParserInvalid - : UseCounter::kElementNameDOMInvalidHTMLParserValid); + ? WebFeature::kElementNameDOMValidHTMLParserInvalid + : WebFeature::kElementNameDOMInvalidHTMLParserValid); } return is_valid_dom_name; } @@ -784,7 +784,7 @@ String GetTypeExtension(Document* document, if (string_or_options.isString()) { UseCounter::Count(document, - UseCounter::kDocumentCreateElement2ndArgStringHandling); + WebFeature::kDocumentCreateElement2ndArgStringHandling); return string_or_options.getAsString(); } @@ -1104,7 +1104,7 @@ ProcessingInstruction* Document::createProcessingInstruction( } if (IsHTMLDocument()) { UseCounter::Count(*this, - UseCounter::kHTMLDocumentCreateProcessingInstruction); + WebFeature::kHTMLDocumentCreateProcessingInstruction); } return ProcessingInstruction::Create(*this, target, data); } @@ -1902,7 +1902,7 @@ void Document::InheritHtmlAndBodyElementStyles(StyleRecalcChange change) { // might want to try to eliminate some day (eg. for ScrollTopLeftInterop - // see http://crbug.com/157855). if (body_style && !body_style->IsOverflowVisible()) - UseCounter::Count(*this, UseCounter::kBodyScrollsInAdditionToViewport); + UseCounter::Count(*this, WebFeature::kBodyScrollsInAdditionToViewport); } } @@ -3546,7 +3546,7 @@ void Document::SetBaseURLOverride(const KURL& url) { } void Document::ProcessBaseElement() { - UseCounter::Count(*this, UseCounter::kBaseElement); + UseCounter::Count(*this, WebFeature::kBaseElement); // Find the first href attribute in a base element and the first target // attribute in a base element. @@ -3567,7 +3567,7 @@ void Document::ProcessBaseElement() { } if (GetContentSecurityPolicy()->IsActive()) { UseCounter::Count(*this, - UseCounter::kContentSecurityPolicyWithBaseElement); + WebFeature::kContentSecurityPolicyWithBaseElement); } } @@ -3582,13 +3582,13 @@ void Document::ProcessBaseElement() { if (!base_element_url.IsEmpty()) { if (base_element_url.ProtocolIsData()) { - UseCounter::Count(*this, UseCounter::kBaseWithDataHref); + UseCounter::Count(*this, WebFeature::kBaseWithDataHref); AddConsoleMessage(ConsoleMessage::Create( kSecurityMessageSource, kErrorMessageLevel, "'data:' URLs may not be used as base URLs for a document.")); } if (!this->GetSecurityOrigin()->CanRequest(base_element_url)) - UseCounter::Count(*this, UseCounter::kBaseWithCrossOriginHref); + UseCounter::Count(*this, WebFeature::kBaseWithCrossOriginHref); } if (base_element_url != base_element_url_ && @@ -3600,9 +3600,9 @@ void Document::ProcessBaseElement() { if (target) { if (target->Contains('\n') || target->Contains('\r')) - UseCounter::Count(*this, UseCounter::kBaseWithNewlinesInTarget); + UseCounter::Count(*this, WebFeature::kBaseWithNewlinesInTarget); if (target->Contains('<')) - UseCounter::Count(*this, UseCounter::kBaseWithOpenBracketInTarget); + UseCounter::Count(*this, WebFeature::kBaseWithOpenBracketInTarget); base_target_ = *target; } else { base_target_ = g_null_atom; @@ -4732,22 +4732,22 @@ void Document::AddMutationEventListenerTypeIfEnabled( void Document::AddListenerTypeIfNeeded(const AtomicString& event_type, EventTarget& event_target) { if (event_type == EventTypeNames::DOMSubtreeModified) { - UseCounter::Count(*this, UseCounter::kDOMSubtreeModifiedEvent); + UseCounter::Count(*this, WebFeature::kDOMSubtreeModifiedEvent); AddMutationEventListenerTypeIfEnabled(kDOMSubtreeModifiedListener); } else if (event_type == EventTypeNames::DOMNodeInserted) { - UseCounter::Count(*this, UseCounter::kDOMNodeInsertedEvent); + UseCounter::Count(*this, WebFeature::kDOMNodeInsertedEvent); AddMutationEventListenerTypeIfEnabled(kDOMNodeInsertedListener); } else if (event_type == EventTypeNames::DOMNodeRemoved) { - UseCounter::Count(*this, UseCounter::kDOMNodeRemovedEvent); + UseCounter::Count(*this, WebFeature::kDOMNodeRemovedEvent); AddMutationEventListenerTypeIfEnabled(kDOMNodeRemovedListener); } else if (event_type == EventTypeNames::DOMNodeRemovedFromDocument) { - UseCounter::Count(*this, UseCounter::kDOMNodeRemovedFromDocumentEvent); + UseCounter::Count(*this, WebFeature::kDOMNodeRemovedFromDocumentEvent); AddMutationEventListenerTypeIfEnabled(kDOMNodeRemovedFromDocumentListener); } else if (event_type == EventTypeNames::DOMNodeInsertedIntoDocument) { - UseCounter::Count(*this, UseCounter::kDOMNodeInsertedIntoDocumentEvent); + UseCounter::Count(*this, WebFeature::kDOMNodeInsertedIntoDocumentEvent); AddMutationEventListenerTypeIfEnabled(kDOMNodeInsertedIntoDocumentListener); } else if (event_type == EventTypeNames::DOMCharacterDataModified) { - UseCounter::Count(*this, UseCounter::kDOMCharacterDataModifiedEvent); + UseCounter::Count(*this, WebFeature::kDOMCharacterDataModifiedEvent); AddMutationEventListenerTypeIfEnabled(kDOMCharacterDataModifiedListener); } else if (event_type == EventTypeNames::webkitAnimationStart || event_type == EventTypeNames::animationstart) { @@ -4899,7 +4899,7 @@ String Document::domain() const { void Document::setDomain(const String& raw_domain, ExceptionState& exception_state) { - UseCounter::Count(*this, UseCounter::kDocumentSetDomain); + UseCounter::Count(*this, WebFeature::kDocumentSetDomain); if (IsSandboxed(kSandboxDocumentDomain)) { exception_state.ThrowSecurityError( @@ -5335,18 +5335,18 @@ KURL Document::OpenSearchDescriptionURL() { continue; // Count usage; perhaps we can lock this to secure contexts. - UseCounter::Feature osd_disposition; + WebFeature osd_disposition; RefPtr target = SecurityOrigin::Create(link_element->Href()); if (IsSecureContext()) { osd_disposition = target->IsPotentiallyTrustworthy() - ? UseCounter::kOpenSearchSecureOriginSecureTarget - : UseCounter::kOpenSearchSecureOriginInsecureTarget; + ? WebFeature::kOpenSearchSecureOriginSecureTarget + : WebFeature::kOpenSearchSecureOriginInsecureTarget; } else { osd_disposition = target->IsPotentiallyTrustworthy() - ? UseCounter::kOpenSearchInsecureOriginSecureTarget - : UseCounter::kOpenSearchInsecureOriginInsecureTarget; + ? WebFeature::kOpenSearchInsecureOriginSecureTarget + : WebFeature::kOpenSearchInsecureOriginInsecureTarget; } UseCounter::Count(*this, osd_disposition); @@ -5386,7 +5386,7 @@ void Document::setDesignMode(const String& value) { bool new_value = design_mode_; if (DeprecatedEqualIgnoringCase(value, "on")) { new_value = true; - UseCounter::Count(*this, UseCounter::kDocumentDesignModeEnabeld); + UseCounter::Count(*this, WebFeature::kDocumentDesignModeEnabeld); } else if (DeprecatedEqualIgnoringCase(value, "off")) { new_value = false; } @@ -6302,7 +6302,7 @@ Touch* Document::createTouch(DOMWindow* window, if (radius_x || radius_y || rotation_angle || force) { UseCounter::Count(*this, - UseCounter::kDocumentCreateTouchMoreThanSevenArguments); + WebFeature::kDocumentCreateTouchMoreThanSevenArguments); } // FIXME: It's not clear from the documentation at @@ -6677,11 +6677,11 @@ bool Document::IsSecureContext() const { if (GetSandboxFlags() != kSandboxNone) { UseCounter::Count( *this, is_secure - ? UseCounter::kSecureContextCheckForSandboxedOriginPassed - : UseCounter::kSecureContextCheckForSandboxedOriginFailed); + ? WebFeature::kSecureContextCheckForSandboxedOriginPassed + : WebFeature::kSecureContextCheckForSandboxedOriginFailed); } - UseCounter::Count(*this, is_secure ? UseCounter::kSecureContextCheckPassed - : UseCounter::kSecureContextCheckFailed); + UseCounter::Count(*this, is_secure ? WebFeature::kSecureContextCheckPassed + : WebFeature::kSecureContextCheckFailed); return is_secure; } @@ -6706,7 +6706,7 @@ void Document::SetShadowCascadeOrder(ShadowCascadeOrder order) { if (order == ShadowCascadeOrder::kShadowCascadeV0) { may_contain_v0_shadow_ = true; if (shadow_cascade_order_ == ShadowCascadeOrder::kShadowCascadeV1) - UseCounter::Count(*this, UseCounter::kMixedShadowRootV0AndV1); + UseCounter::Count(*this, WebFeature::kMixedShadowRootV0AndV1); } // For V0 -> V1 upgrade, we need style recalculation for the whole document. @@ -6715,7 +6715,7 @@ void Document::SetShadowCascadeOrder(ShadowCascadeOrder order) { this->SetNeedsStyleRecalc( kSubtreeStyleChange, StyleChangeReasonForTracing::Create(StyleChangeReason::kShadow)); - UseCounter::Count(*this, UseCounter::kMixedShadowRootV0AndV1); + UseCounter::Count(*this, WebFeature::kMixedShadowRootV0AndV1); } if (order > shadow_cascade_order_) diff --git a/third_party/WebKit/Source/core/dom/DocumentOrShadowRoot.h b/third_party/WebKit/Source/core/dom/DocumentOrShadowRoot.h index 028eb226ddd957..88de32976584ac 100644 --- a/third_party/WebKit/Source/core/dom/DocumentOrShadowRoot.h +++ b/third_party/WebKit/Source/core/dom/DocumentOrShadowRoot.h @@ -45,7 +45,7 @@ class DocumentOrShadowRoot { } static Element* pointerLockElement(Document& document) { - UseCounter::Count(document, UseCounter::kDocumentPointerLockElement); + UseCounter::Count(document, WebFeature::kDocumentPointerLockElement); const Element* target = document.PointerLockElement(); if (!target) return nullptr; @@ -55,7 +55,7 @@ class DocumentOrShadowRoot { // unnecessary. if (target && target->IsInV0ShadowTree()) { UseCounter::Count(document, - UseCounter::kDocumentPointerLockElementInV0Shadow); + WebFeature::kDocumentPointerLockElementInV0Shadow); return const_cast(target); } return document.AdjustedElement(*target); @@ -68,7 +68,7 @@ class DocumentOrShadowRoot { if (!shadow_root.IsV1()) return nullptr; UseCounter::Count(shadow_root.GetDocument(), - UseCounter::kShadowRootPointerLockElement); + WebFeature::kShadowRootPointerLockElement); const Element* target = shadow_root.GetDocument().PointerLockElement(); if (!target) return nullptr; diff --git a/third_party/WebKit/Source/core/dom/Element.cpp b/third_party/WebKit/Source/core/dom/Element.cpp index 694da3a5783ee8..042d9431a726d0 100644 --- a/third_party/WebKit/Source/core/dom/Element.cpp +++ b/third_party/WebKit/Source/core/dom/Element.cpp @@ -2310,15 +2310,15 @@ ShadowRoot* Element::attachShadow(const ScriptState* script_state, : ShadowRootType::kClosed; if (type == ShadowRootType::kClosed) - UseCounter::Count(GetDocument(), UseCounter::kElementAttachShadowClosed); + UseCounter::Count(GetDocument(), WebFeature::kElementAttachShadowClosed); else if (type == ShadowRootType::kOpen) - UseCounter::Count(GetDocument(), UseCounter::kElementAttachShadowOpen); + UseCounter::Count(GetDocument(), WebFeature::kElementAttachShadowOpen); ShadowRoot* shadow_root = CreateShadowRootInternal(type, exception_state); if (shadow_root_init_dict.hasDelegatesFocus()) { shadow_root->SetDelegatesFocus(shadow_root_init_dict.delegatesFocus()); - UseCounter::Count(GetDocument(), UseCounter::kShadowRootDelegatesFocus); + UseCounter::Count(GetDocument(), WebFeature::kShadowRootDelegatesFocus); } return shadow_root; @@ -2473,7 +2473,7 @@ Attr* Element::setAttributeNode(Attr* attr_node, attr_node->name() != attr_node->name().LowerASCII()) UseCounter::Count( GetDocument(), - UseCounter:: + WebFeature:: kNonHTMLElementSetAttributeNodeFromHTMLDocumentNameNotLowercase); SynchronizeAllAttributes(); diff --git a/third_party/WebKit/Source/core/dom/ElementFullscreen.cpp b/third_party/WebKit/Source/core/dom/ElementFullscreen.cpp index 34842ffdfbb117..cbf182c760c6d7 100644 --- a/third_party/WebKit/Source/core/dom/ElementFullscreen.cpp +++ b/third_party/WebKit/Source/core/dom/ElementFullscreen.cpp @@ -16,7 +16,7 @@ void ElementFullscreen::requestFullscreen(Element& element) { void ElementFullscreen::webkitRequestFullscreen(Element& element) { if (element.IsInShadowTree()) { UseCounter::Count(element.GetDocument(), - UseCounter::kPrefixedElementRequestFullscreenInShadow); + WebFeature::kPrefixedElementRequestFullscreenInShadow); } Fullscreen::RequestFullscreen(element, Fullscreen::RequestType::kPrefixed); } diff --git a/third_party/WebKit/Source/core/dom/ExecutionContext.cpp b/third_party/WebKit/Source/core/dom/ExecutionContext.cpp index 5edb42b4feaf9f..98c91f3007bad2 100644 --- a/third_party/WebKit/Source/core/dom/ExecutionContext.cpp +++ b/third_party/WebKit/Source/core/dom/ExecutionContext.cpp @@ -226,9 +226,9 @@ void ExecutionContext::ParseAndSetReferrerPolicy(const String& policies, void ExecutionContext::SetReferrerPolicy(ReferrerPolicy referrer_policy) { // When a referrer policy has already been set, the latest value takes // precedence. - UseCounter::Count(this, UseCounter::kSetReferrerPolicy); + UseCounter::Count(this, WebFeature::kSetReferrerPolicy); if (referrer_policy_ != kReferrerPolicyDefault) - UseCounter::Count(this, UseCounter::kResetReferrerPolicy); + UseCounter::Count(this, WebFeature::kResetReferrerPolicy); referrer_policy_ = referrer_policy; } diff --git a/third_party/WebKit/Source/core/dom/Fullscreen.cpp b/third_party/WebKit/Source/core/dom/Fullscreen.cpp index 209f73cc0bb0f8..65159dc45672b6 100644 --- a/third_party/WebKit/Source/core/dom/Fullscreen.cpp +++ b/third_party/WebKit/Source/core/dom/Fullscreen.cpp @@ -98,7 +98,7 @@ bool AllowedToRequestFullscreen(Document& document) { // The algorithm is triggered by a user generated orientation change. if (ScopedOrientationChangeIndicator::ProcessingOrientationChange()) { UseCounter::Count(document, - UseCounter::kFullscreenAllowedByOrientationChange); + WebFeature::kFullscreenAllowedByOrientationChange); return true; } @@ -278,7 +278,7 @@ Element* Fullscreen::FullscreenElementForBindingFrom(TreeScope& scope) { // shadow tree, even though it leaks the Shadow DOM. if (element->IsInV0ShadowTree()) { UseCounter::Count(scope.GetDocument(), - UseCounter::kDocumentFullscreenElementInV0Shadow); + WebFeature::kDocumentFullscreenElementInV0Shadow); return element; } } else if (!ToShadowRoot(scope.RootNode()).IsV1()) { @@ -303,7 +303,7 @@ Element* Fullscreen::CurrentFullScreenElementForBindingFrom( // tree, even though it leaks the Shadow DOM. if (element->IsInV0ShadowTree()) { UseCounter::Count(document, - UseCounter::kDocumentFullscreenElementInV0Shadow); + WebFeature::kDocumentFullscreenElementInV0Shadow); return element; } return document.AdjustedElement(*element); @@ -364,9 +364,9 @@ void Fullscreen::RequestFullscreen(Element& element, // fullscreen element. if (!for_cross_process_descendant) { if (document.IsSecureContext()) { - UseCounter::Count(document, UseCounter::kFullscreenSecureOrigin); + UseCounter::Count(document, WebFeature::kFullscreenSecureOrigin); } else { - UseCounter::Count(document, UseCounter::kFullscreenInsecureOrigin); + UseCounter::Count(document, WebFeature::kFullscreenInsecureOrigin); HostsUsingFeatures::CountAnyWorld( document, HostsUsingFeatures::Feature::kFullscreenInsecureHost); } @@ -399,10 +399,10 @@ void Fullscreen::RequestFullscreen(Element& element, // are good candidates. See https://github.com/whatwg/fullscreen/pull/91 if (isHTMLDialogElement(element)) { UseCounter::Count(document, - UseCounter::kRequestFullscreenForDialogElement); + WebFeature::kRequestFullscreenForDialogElement); if (element.IsInTopLayer()) { UseCounter::Count( - document, UseCounter::kRequestFullscreenForDialogElementInTopLayer); + document, WebFeature::kRequestFullscreenForDialogElementInTopLayer); } } @@ -484,7 +484,7 @@ void Fullscreen::RequestFullscreen(Element& element, // 6. Optionally, perform some animation. if (From(document).pending_fullscreen_element_) { UseCounter::Count(document, - UseCounter::kFullscreenRequestWithPendingElement); + WebFeature::kFullscreenRequestWithPendingElement); } From(document).pending_fullscreen_element_ = &element; document.GetFrame()->GetChromeClient().EnterFullscreen( diff --git a/third_party/WebKit/Source/core/dom/MessagePort.cpp b/third_party/WebKit/Source/core/dom/MessagePort.cpp index 9f1dad09c13783..fb7e959bb1e85f 100644 --- a/third_party/WebKit/Source/core/dom/MessagePort.cpp +++ b/third_party/WebKit/Source/core/dom/MessagePort.cpp @@ -260,7 +260,7 @@ MessagePortChannelArray MessagePort::DisentanglePorts( visited.insert(port); } - UseCounter::Count(context, UseCounter::kMessagePortsTransferred); + UseCounter::Count(context, WebFeature::kMessagePortsTransferred); // Passed-in ports passed validity checks, so we can disentangle them. MessagePortChannelArray port_array(ports.size()); diff --git a/third_party/WebKit/Source/core/dom/Node.cpp b/third_party/WebKit/Source/core/dom/Node.cpp index ae77970a58b6ee..1cf63d4744e5dd 100644 --- a/third_party/WebKit/Source/core/dom/Node.cpp +++ b/third_party/WebKit/Source/core/dom/Node.cpp @@ -2165,7 +2165,7 @@ void Node::HandleLocalEvents(Event& event) { if (IsDisabledFormControl(this) && event.IsMouseEvent() && !RuntimeEnabledFeatures::SendMouseEventsDisabledFormControlsEnabled()) { UseCounter::Count(GetDocument(), - UseCounter::kDispatchMouseEventOnDisabledFormControl); + WebFeature::kDispatchMouseEventOnDisabledFormControl); return; } diff --git a/third_party/WebKit/Source/core/dom/PseudoElement.cpp b/third_party/WebKit/Source/core/dom/PseudoElement.cpp index 913858be4601d7..95892525df1183 100644 --- a/third_party/WebKit/Source/core/dom/PseudoElement.cpp +++ b/third_party/WebKit/Source/core/dom/PseudoElement.cpp @@ -94,7 +94,7 @@ PseudoElement::PseudoElement(Element* parent, PseudoId pseudo_id) if ((pseudo_id == kPseudoIdBefore || pseudo_id == kPseudoIdAfter) && parent->HasTagName(HTMLNames::inputTag)) { UseCounter::Count(parent->GetDocument(), - UseCounter::kPseudoBeforeAfterForInputElement); + WebFeature::kPseudoBeforeAfterForInputElement); } } diff --git a/third_party/WebKit/Source/core/dom/SinkDocument.cpp b/third_party/WebKit/Source/core/dom/SinkDocument.cpp index 9fe219aa4a85a9..adb63ecca01d93 100644 --- a/third_party/WebKit/Source/core/dom/SinkDocument.cpp +++ b/third_party/WebKit/Source/core/dom/SinkDocument.cpp @@ -48,9 +48,9 @@ SinkDocument::SinkDocument(const DocumentInit& initializer) : HTMLDocument(initializer) { SetCompatibilityMode(kQuirksMode); LockCompatibilityMode(); - UseCounter::Count(*this, UseCounter::kSinkDocument); + UseCounter::Count(*this, WebFeature::kSinkDocument); if (!IsInMainFrame()) - UseCounter::Count(*this, UseCounter::kSinkDocumentInFrame); + UseCounter::Count(*this, WebFeature::kSinkDocumentInFrame); } DocumentParser* SinkDocument::CreateParser() { diff --git a/third_party/WebKit/Source/core/dom/StyleEngineContext.cpp b/third_party/WebKit/Source/core/dom/StyleEngineContext.cpp index e1fa3775316980..0afa2e2ee5553e 100644 --- a/third_party/WebKit/Source/core/dom/StyleEngineContext.cpp +++ b/third_party/WebKit/Source/core/dom/StyleEngineContext.cpp @@ -39,7 +39,7 @@ void StyleEngineContext::AddingPendingSheet(const Document& document) { added_pending_sheet_before_body_ = !document.body(); if (!added_pending_sheet_before_body_) { UseCounter::Count(document, - UseCounter::kPendingStylesheetAddedAfterBodyStarted); + WebFeature::kPendingStylesheetAddedAfterBodyStarted); } } } diff --git a/third_party/WebKit/Source/core/dom/custom/V0CustomElement.cpp b/third_party/WebKit/Source/core/dom/custom/V0CustomElement.cpp index 778df42a4ec99d..2958ba236395b5 100644 --- a/third_party/WebKit/Source/core/dom/custom/V0CustomElement.cpp +++ b/third_party/WebKit/Source/core/dom/custom/V0CustomElement.cpp @@ -112,8 +112,8 @@ void V0CustomElement::Define(Element* element, UseCounter::Count( element->GetDocument(), definition->Descriptor().IsTypeExtension() - ? UseCounter::kV0CustomElementsCreateTypeExtensionElement - : UseCounter::kV0CustomElementsCreateCustomTagElement); + ? WebFeature::kV0CustomElementsCreateTypeExtensionElement + : WebFeature::kV0CustomElementsCreateCustomTagElement); element->V0SetCustomElementDefinition(definition); V0CustomElementScheduler::ScheduleCallback( definition->Callbacks(), element, diff --git a/third_party/WebKit/Source/core/dom/custom/V0CustomElementRegistry.cpp b/third_party/WebKit/Source/core/dom/custom/V0CustomElementRegistry.cpp index 4544c34f65f74d..6ece6b0e5010aa 100644 --- a/third_party/WebKit/Source/core/dom/custom/V0CustomElementRegistry.cpp +++ b/third_party/WebKit/Source/core/dom/custom/V0CustomElementRegistry.cpp @@ -112,15 +112,15 @@ V0CustomElementDefinition* V0CustomElementRegistry::RegisterElement( if (valid_names & V0CustomElement::kEmbedderNames) { UseCounter::Count(document, - UseCounter::kV0CustomElementsRegisterEmbedderElement); + WebFeature::kV0CustomElementsRegisterEmbedderElement); } else if (tag_name.NamespaceURI() == SVGNames::svgNamespaceURI) { UseCounter::Count(document, - UseCounter::kV0CustomElementsRegisterSVGElement); + WebFeature::kV0CustomElementsRegisterSVGElement); } else { UseCounter::Count( document, descriptor.IsTypeExtension() - ? UseCounter::kV0CustomElementsRegisterHTMLTypeExtension - : UseCounter::kV0CustomElementsRegisterHTMLCustomTag); + ? WebFeature::kV0CustomElementsRegisterHTMLTypeExtension + : WebFeature::kV0CustomElementsRegisterHTMLCustomTag); } return definition; diff --git a/third_party/WebKit/Source/core/dom/shadow/ElementShadow.cpp b/third_party/WebKit/Source/core/dom/shadow/ElementShadow.cpp index 2b0a30a12be926..8508993596ce62 100644 --- a/third_party/WebKit/Source/core/dom/shadow/ElementShadow.cpp +++ b/third_party/WebKit/Source/core/dom/shadow/ElementShadow.cpp @@ -63,7 +63,7 @@ ShadowRoot& ElementShadow::AddShadowRoot(Element& shadow_host, if (type == ShadowRootType::V0 && shadow_root_) { DCHECK_EQ(shadow_root_->GetType(), ShadowRootType::V0); Deprecation::CountDeprecation(shadow_host.GetDocument(), - UseCounter::kElementCreateShadowRootMultiple); + WebFeature::kElementCreateShadowRootMultiple); } if (shadow_root_) { diff --git a/third_party/WebKit/Source/core/editing/DOMSelection.cpp b/third_party/WebKit/Source/core/editing/DOMSelection.cpp index 180773fbaf07be..8b87be9eac6b35 100644 --- a/third_party/WebKit/Source/core/editing/DOMSelection.cpp +++ b/third_party/WebKit/Source/core/editing/DOMSelection.cpp @@ -88,7 +88,7 @@ void DOMSelection::UpdateFrameSelection(const SelectionInDOMTree& selection, frame_selection.DidSetSelectionDeprecated(); if (GetFrame() && GetFrame()->GetDocument() && focused_element != GetFrame()->GetDocument()->FocusedElement()) - UseCounter::Count(GetFrame(), UseCounter::kSelectionFuncionsChangeFocus); + UseCounter::Count(GetFrame(), WebFeature::kSelectionFuncionsChangeFocus); } const VisibleSelection& DOMSelection::GetVisibleSelection() const { @@ -241,7 +241,7 @@ void DOMSelection::collapse(Node* node, // 1. If node is null, this method must behave identically as // removeAllRanges() and abort these steps. if (!node) { - UseCounter::Count(GetFrame(), UseCounter::kSelectionCollapseNull); + UseCounter::Count(GetFrame(), WebFeature::kSelectionCollapseNull); GetFrame()->Selection().Clear(); return; } @@ -364,12 +364,12 @@ void DOMSelection::setBaseAndExtent(Node* base_node, // TODO(editing-dev): Behavior on where base or extent is null is still // under discussion: https://github.com/w3c/selection-api/issues/72 if (!base_node) { - UseCounter::Count(GetFrame(), UseCounter::kSelectionSetBaseAndExtentNull); + UseCounter::Count(GetFrame(), WebFeature::kSelectionSetBaseAndExtentNull); GetFrame()->Selection().Clear(); return; } if (!extent_node) { - UseCounter::Count(GetFrame(), UseCounter::kSelectionSetBaseAndExtentNull); + UseCounter::Count(GetFrame(), WebFeature::kSelectionSetBaseAndExtentNull); extent_offset = 0; } @@ -464,7 +464,7 @@ void DOMSelection::modify(const String& alter_string, GetFrame()->Selection().Modify(alter, direction, granularity); if (GetFrame() && GetFrame()->GetDocument() && focused_element != GetFrame()->GetDocument()->FocusedElement()) - UseCounter::Count(GetFrame(), UseCounter::kSelectionFuncionsChangeFocus); + UseCounter::Count(GetFrame(), WebFeature::kSelectionFuncionsChangeFocus); } // https://www.w3.org/TR/selection-api/#dom-selection-extend @@ -667,7 +667,7 @@ void DOMSelection::addRange(Range* new_range) { // warning message for a while, and continue to collect the usage data. // . Deprecation::CountDeprecation(GetFrame(), - UseCounter::kSelectionAddRangeIntersect); + WebFeature::kSelectionAddRangeIntersect); } // https://www.w3.org/TR/selection-api/#dom-selection-deletefromdocument diff --git a/third_party/WebKit/Source/core/editing/Editor.cpp b/third_party/WebKit/Source/core/editing/Editor.cpp index 23432fbc41012d..e31a15ba917ac6 100644 --- a/third_party/WebKit/Source/core/editing/Editor.cpp +++ b/third_party/WebKit/Source/core/editing/Editor.cpp @@ -1289,10 +1289,10 @@ void Editor::PerformDelete() { static void CountEditingEvent(ExecutionContext* execution_context, const Event* event, - UseCounter::Feature feature_on_input, - UseCounter::Feature feature_on_text_area, - UseCounter::Feature feature_on_content_editable, - UseCounter::Feature feature_on_non_node) { + WebFeature feature_on_input, + WebFeature feature_on_text_area, + WebFeature feature_on_content_editable, + WebFeature feature_on_non_node) { EventTarget* event_target = event->target(); Node* node = event_target->ToNode(); if (!node) { @@ -1331,29 +1331,29 @@ void Editor::CountEvent(ExecutionContext* execution_context, if (event->type() == EventTypeNames::textInput) { CountEditingEvent(execution_context, event, - UseCounter::kTextInputEventOnInput, - UseCounter::kTextInputEventOnTextArea, - UseCounter::kTextInputEventOnContentEditable, - UseCounter::kTextInputEventOnNotNode); + WebFeature::kTextInputEventOnInput, + WebFeature::kTextInputEventOnTextArea, + WebFeature::kTextInputEventOnContentEditable, + WebFeature::kTextInputEventOnNotNode); return; } if (event->type() == EventTypeNames::webkitBeforeTextInserted) { CountEditingEvent(execution_context, event, - UseCounter::kWebkitBeforeTextInsertedOnInput, - UseCounter::kWebkitBeforeTextInsertedOnTextArea, - UseCounter::kWebkitBeforeTextInsertedOnContentEditable, - UseCounter::kWebkitBeforeTextInsertedOnNotNode); + WebFeature::kWebkitBeforeTextInsertedOnInput, + WebFeature::kWebkitBeforeTextInsertedOnTextArea, + WebFeature::kWebkitBeforeTextInsertedOnContentEditable, + WebFeature::kWebkitBeforeTextInsertedOnNotNode); return; } if (event->type() == EventTypeNames::webkitEditableContentChanged) { CountEditingEvent( execution_context, event, - UseCounter::kWebkitEditableContentChangedOnInput, - UseCounter::kWebkitEditableContentChangedOnTextArea, - UseCounter::kWebkitEditableContentChangedOnContentEditable, - UseCounter::kWebkitEditableContentChangedOnNotNode); + WebFeature::kWebkitEditableContentChangedOnInput, + WebFeature::kWebkitEditableContentChangedOnTextArea, + WebFeature::kWebkitEditableContentChangedOnContentEditable, + WebFeature::kWebkitEditableContentChangedOnNotNode); } } @@ -1808,7 +1808,7 @@ void Editor::TidyUpHTMLStructure(Document& document) { kJSMessageSource, kWarningMessageLevel, "document.execCommand() doesn't work with an invalid HTML structure. It " "is corrected automatically.")); - UseCounter::Count(document, UseCounter::kExecCommandAltersHTMLStructure); + UseCounter::Count(document, WebFeature::kExecCommandAltersHTMLStructure); Element* root = HTMLHtmlElement::Create(document); if (existing_head) diff --git a/third_party/WebKit/Source/core/editing/commands/DocumentExecCommand.cpp b/third_party/WebKit/Source/core/editing/commands/DocumentExecCommand.cpp index d49bb32b0111e2..bd98b83b41b8ce 100644 --- a/third_party/WebKit/Source/core/editing/commands/DocumentExecCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/DocumentExecCommand.cpp @@ -62,7 +62,7 @@ bool Document::execCommand(const String& command_name, return false; } if (FocusedElement() && IsTextControlElement(*FocusedElement())) - UseCounter::Count(*this, UseCounter::kExecCommandOnInputOrTextarea); + UseCounter::Count(*this, WebFeature::kExecCommandOnInputOrTextarea); // We don't allow recursive |execCommand()| to protect against attack code. // Recursive call of |execCommand()| could be happened by moving iframe diff --git a/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp b/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp index b93ff4ef238d52..8f2fb52bf0fd11 100644 --- a/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp @@ -116,7 +116,7 @@ static bool IsInterchangeHTMLBRElement(const Node* node) { interchange_newline_class_string) return false; UseCounter::Count(node->GetDocument(), - UseCounter::kEditingAppleInterchangeNewline); + WebFeature::kEditingAppleInterchangeNewline); return true; } diff --git a/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp b/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp index 01c8e34919701a..d5c752d284c59a 100644 --- a/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp +++ b/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp @@ -220,11 +220,11 @@ TextIteratorAlgorithm::~TextIteratorAlgorithm() { if (!document) return; if (behavior_.ForInnerText()) - UseCounter::Count(document, UseCounter::kInnerTextWithShadowTree); + UseCounter::Count(document, WebFeature::kInnerTextWithShadowTree); if (behavior_.ForSelectionToString()) - UseCounter::Count(document, UseCounter::kSelectionToStringWithShadowTree); + UseCounter::Count(document, WebFeature::kSelectionToStringWithShadowTree); if (behavior_.ForWindowFind()) - UseCounter::Count(document, UseCounter::kWindowFindWithShadowTree); + UseCounter::Count(document, WebFeature::kWindowFindWithShadowTree); } template diff --git a/third_party/WebKit/Source/core/events/Event.cpp b/third_party/WebKit/Source/core/events/Event.cpp index ab9741b60c4566..18fc7182b7d953 100644 --- a/third_party/WebKit/Source/core/events/Event.cpp +++ b/third_party/WebKit/Source/core/events/Event.cpp @@ -142,10 +142,10 @@ bool Event::legacyReturnValue(ScriptState* script_state) const { bool return_value = !defaultPrevented(); if (return_value) { UseCounter::Count(ExecutionContext::From(script_state), - UseCounter::kEventGetReturnValueTrue); + WebFeature::kEventGetReturnValueTrue); } else { UseCounter::Count(ExecutionContext::From(script_state), - UseCounter::kEventGetReturnValueFalse); + WebFeature::kEventGetReturnValueFalse); } return return_value; } @@ -153,10 +153,10 @@ bool Event::legacyReturnValue(ScriptState* script_state) const { void Event::setLegacyReturnValue(ScriptState* script_state, bool return_value) { if (return_value) { UseCounter::Count(ExecutionContext::From(script_state), - UseCounter::kEventSetReturnValueTrue); + WebFeature::kEventSetReturnValueTrue); } else { UseCounter::Count(ExecutionContext::From(script_state), - UseCounter::kEventSetReturnValueFalse); + WebFeature::kEventSetReturnValueFalse); } SetDefaultPrevented(!return_value); } diff --git a/third_party/WebKit/Source/core/events/EventDispatcher.cpp b/third_party/WebKit/Source/core/events/EventDispatcher.cpp index e3ec4651fe284d..951b34593a573f 100644 --- a/third_party/WebKit/Source/core/events/EventDispatcher.cpp +++ b/third_party/WebKit/Source/core/events/EventDispatcher.cpp @@ -308,7 +308,7 @@ inline void EventDispatcher::DispatchEventPostProcess( event_->type() == EventTypeNames::mousedown && isHTMLSelectElement(*node_)) { UseCounter::Count(node_->GetDocument(), - UseCounter::kUntrustedMouseDownEventDispatchedToSelect); + WebFeature::kUntrustedMouseDownEventDispatchedToSelect); } } diff --git a/third_party/WebKit/Source/core/events/EventTarget.cpp b/third_party/WebKit/Source/core/events/EventTarget.cpp index f6f2cdeecf3e6a..c7041b8697b9b7 100644 --- a/third_party/WebKit/Source/core/events/EventTarget.cpp +++ b/third_party/WebKit/Source/core/events/EventTarget.cpp @@ -199,8 +199,8 @@ void EventTarget::SetDefaultAddEventListenerOptions( if (options.hasPassive()) { UseCounter::Count(executing_window->document(), options.passive() - ? UseCounter::kAddEventListenerPassiveTrue - : UseCounter::kAddEventListenerPassiveFalse); + ? WebFeature::kAddEventListenerPassiveTrue + : WebFeature::kAddEventListenerPassiveFalse); } } @@ -240,7 +240,7 @@ void EventTarget::SetDefaultAddEventListenerOptions( options.setPassive(true); if (executing_window) { UseCounter::Count(executing_window->document(), - UseCounter::kSmoothScrollJSInterventionActivated); + WebFeature::kSmoothScrollJSInterventionActivated); } return; } @@ -345,22 +345,22 @@ void EventTarget::AddedEventListener( if (event_type == EventTypeNames::auxclick) { if (LocalDOMWindow* executing_window = this->ExecutingWindow()) { UseCounter::Count(executing_window->document(), - UseCounter::kAuxclickAddListenerCount); + WebFeature::kAuxclickAddListenerCount); } } else if (event_type == EventTypeNames::appinstalled) { if (LocalDOMWindow* executing_window = this->ExecutingWindow()) { UseCounter::Count(executing_window->document(), - UseCounter::kAppInstalledEventAddListener); + WebFeature::kAppInstalledEventAddListener); } } else if (EventUtil::IsPointerEventType(event_type)) { if (LocalDOMWindow* executing_window = this->ExecutingWindow()) { UseCounter::Count(executing_window->document(), - UseCounter::kPointerEventAddListenerCount); + WebFeature::kPointerEventAddListenerCount); } } else if (event_type == EventTypeNames::slotchange) { if (LocalDOMWindow* executing_window = this->ExecutingWindow()) { UseCounter::Count(executing_window->document(), - UseCounter::kSlotChangeEventAddListener); + WebFeature::kSlotChangeEventAddListener); } } else if (EventUtil::IsDOMMutationEventType(event_type)) { if (ExecutionContext* context = GetExecutionContext()) { @@ -543,33 +543,33 @@ void EventTarget::CountLegacyEvents( const AtomicString& legacy_type_name, EventListenerVector* listeners_vector, EventListenerVector* legacy_listeners_vector) { - UseCounter::Feature unprefixed_feature; - UseCounter::Feature prefixed_feature; - UseCounter::Feature prefixed_and_unprefixed_feature; + WebFeature unprefixed_feature; + WebFeature prefixed_feature; + WebFeature prefixed_and_unprefixed_feature; if (legacy_type_name == EventTypeNames::webkitTransitionEnd) { - prefixed_feature = UseCounter::kPrefixedTransitionEndEvent; - unprefixed_feature = UseCounter::kUnprefixedTransitionEndEvent; + prefixed_feature = WebFeature::kPrefixedTransitionEndEvent; + unprefixed_feature = WebFeature::kUnprefixedTransitionEndEvent; prefixed_and_unprefixed_feature = - UseCounter::kPrefixedAndUnprefixedTransitionEndEvent; + WebFeature::kPrefixedAndUnprefixedTransitionEndEvent; } else if (legacy_type_name == EventTypeNames::webkitAnimationEnd) { - prefixed_feature = UseCounter::kPrefixedAnimationEndEvent; - unprefixed_feature = UseCounter::kUnprefixedAnimationEndEvent; + prefixed_feature = WebFeature::kPrefixedAnimationEndEvent; + unprefixed_feature = WebFeature::kUnprefixedAnimationEndEvent; prefixed_and_unprefixed_feature = - UseCounter::kPrefixedAndUnprefixedAnimationEndEvent; + WebFeature::kPrefixedAndUnprefixedAnimationEndEvent; } else if (legacy_type_name == EventTypeNames::webkitAnimationStart) { - prefixed_feature = UseCounter::kPrefixedAnimationStartEvent; - unprefixed_feature = UseCounter::kUnprefixedAnimationStartEvent; + prefixed_feature = WebFeature::kPrefixedAnimationStartEvent; + unprefixed_feature = WebFeature::kUnprefixedAnimationStartEvent; prefixed_and_unprefixed_feature = - UseCounter::kPrefixedAndUnprefixedAnimationStartEvent; + WebFeature::kPrefixedAndUnprefixedAnimationStartEvent; } else if (legacy_type_name == EventTypeNames::webkitAnimationIteration) { - prefixed_feature = UseCounter::kPrefixedAnimationIterationEvent; - unprefixed_feature = UseCounter::kUnprefixedAnimationIterationEvent; + prefixed_feature = WebFeature::kPrefixedAnimationIterationEvent; + unprefixed_feature = WebFeature::kUnprefixedAnimationIterationEvent; prefixed_and_unprefixed_feature = - UseCounter::kPrefixedAndUnprefixedAnimationIterationEvent; + WebFeature::kPrefixedAndUnprefixedAnimationIterationEvent; } else if (legacy_type_name == EventTypeNames::mousewheel) { - prefixed_feature = UseCounter::kMouseWheelEvent; - unprefixed_feature = UseCounter::kWheelEvent; - prefixed_and_unprefixed_feature = UseCounter::kMouseWheelAndWheelEvent; + prefixed_feature = WebFeature::kMouseWheelEvent; + unprefixed_feature = WebFeature::kWheelEvent; + prefixed_and_unprefixed_feature = WebFeature::kMouseWheelAndWheelEvent; } else { return; } @@ -631,7 +631,7 @@ DispatchEventResult EventTarget::FireEventListeners(Event* event) { bool EventTarget::CheckTypeThenUseCount(const Event* event, const AtomicString& event_type_to_count, - const UseCounter::Feature feature) { + const WebFeature feature) { if (event->type() == event_type_to_count) { if (LocalDOMWindow* executing_window = this->ExecutingWindow()) UseCounter::Count(executing_window->document(), feature); @@ -650,46 +650,46 @@ bool EventTarget::FireEventListeners(Event* event, // excludes new event listeners. if (CheckTypeThenUseCount(event, EventTypeNames::beforeunload, - UseCounter::kDocumentBeforeUnloadFired)) { + WebFeature::kDocumentBeforeUnloadFired)) { if (LocalDOMWindow* executing_window = this->ExecutingWindow()) { if (executing_window != executing_window->top()) { UseCounter::Count(executing_window->document(), - UseCounter::kSubFrameBeforeUnloadFired); + WebFeature::kSubFrameBeforeUnloadFired); } } } else if (CheckTypeThenUseCount(event, EventTypeNames::unload, - UseCounter::kDocumentUnloadFired)) { + WebFeature::kDocumentUnloadFired)) { } else if (CheckTypeThenUseCount(event, EventTypeNames::DOMFocusIn, - UseCounter::kDOMFocusInOutEvent)) { + WebFeature::kDOMFocusInOutEvent)) { } else if (CheckTypeThenUseCount(event, EventTypeNames::DOMFocusOut, - UseCounter::kDOMFocusInOutEvent)) { + WebFeature::kDOMFocusInOutEvent)) { } else if (CheckTypeThenUseCount(event, EventTypeNames::focusin, - UseCounter::kFocusInOutEvent)) { + WebFeature::kFocusInOutEvent)) { } else if (CheckTypeThenUseCount(event, EventTypeNames::focusout, - UseCounter::kFocusInOutEvent)) { + WebFeature::kFocusInOutEvent)) { } else if (CheckTypeThenUseCount(event, EventTypeNames::textInput, - UseCounter::kTextInputFired)) { + WebFeature::kTextInputFired)) { } else if (CheckTypeThenUseCount(event, EventTypeNames::touchstart, - UseCounter::kTouchStartFired)) { + WebFeature::kTouchStartFired)) { } else if (CheckTypeThenUseCount(event, EventTypeNames::mousedown, - UseCounter::kMouseDownFired)) { + WebFeature::kMouseDownFired)) { } else if (CheckTypeThenUseCount(event, EventTypeNames::pointerdown, - UseCounter::kPointerDownFired)) { + WebFeature::kPointerDownFired)) { if (LocalDOMWindow* executing_window = this->ExecutingWindow()) { if (event->IsPointerEvent() && static_cast(event)->pointerType() == "touch") { UseCounter::Count(executing_window->document(), - UseCounter::kPointerDownFiredForTouch); + WebFeature::kPointerDownFiredForTouch); } } } else if (CheckTypeThenUseCount(event, EventTypeNames::pointerenter, - UseCounter::kPointerEnterLeaveFired)) { + WebFeature::kPointerEnterLeaveFired)) { } else if (CheckTypeThenUseCount(event, EventTypeNames::pointerleave, - UseCounter::kPointerEnterLeaveFired)) { + WebFeature::kPointerEnterLeaveFired)) { } else if (CheckTypeThenUseCount(event, EventTypeNames::pointerover, - UseCounter::kPointerOverOutFired)) { + WebFeature::kPointerOverOutFired)) { } else if (CheckTypeThenUseCount(event, EventTypeNames::pointerout, - UseCounter::kPointerOverOutFired)) { + WebFeature::kPointerOverOutFired)) { } ExecutionContext* context = GetExecutionContext(); diff --git a/third_party/WebKit/Source/core/events/EventTarget.h b/third_party/WebKit/Source/core/events/EventTarget.h index 3462258983db65..54f46ffbda10bf 100644 --- a/third_party/WebKit/Source/core/events/EventTarget.h +++ b/third_party/WebKit/Source/core/events/EventTarget.h @@ -215,7 +215,7 @@ class CORE_EXPORT EventTarget : public GarbageCollectedFinalized, // event type matches. bool CheckTypeThenUseCount(const Event*, const AtomicString&, - const UseCounter::Feature); + const WebFeature); bool FireEventListeners(Event*, EventTargetData*, EventListenerVector&); void CountLegacyEvents(const AtomicString& legacy_type_name, diff --git a/third_party/WebKit/Source/core/events/TouchEvent.cpp b/third_party/WebKit/Source/core/events/TouchEvent.cpp index 7248df4bf55f06..e89b7c25c77749 100644 --- a/third_party/WebKit/Source/core/events/TouchEvent.cpp +++ b/third_party/WebKit/Source/core/events/TouchEvent.cpp @@ -269,7 +269,7 @@ void TouchEvent::preventDefault() { if (view() && view()->IsLocalDOMWindow() && view()->GetFrame()) { UseCounter::Count( ToLocalFrame(view()->GetFrame()), - UseCounter::kUncancelableTouchEventPreventDefaulted); + WebFeature::kUncancelableTouchEventPreventDefaulted); } if (native_event_ && @@ -280,7 +280,7 @@ void TouchEvent::preventDefault() { if (view() && view()->IsLocalDOMWindow() && view()->GetFrame()) { UseCounter::Count( ToLocalFrame(view()->GetFrame()), - UseCounter:: + WebFeature:: kUncancelableTouchEventDueToMainThreadResponsivenessPreventDefaulted); } message_source = kInterventionMessageSource; @@ -328,12 +328,12 @@ void TouchEvent::preventDefault() { switch (HandlingPassive()) { case PassiveMode::kNotPassiveDefault: UseCounter::Count(ToLocalFrame(view()->GetFrame()), - UseCounter::kTouchEventPreventedNoTouchAction); + WebFeature::kTouchEventPreventedNoTouchAction); break; case PassiveMode::kPassiveForcedDocumentLevel: UseCounter::Count( ToLocalFrame(view()->GetFrame()), - UseCounter::kTouchEventPreventedForcedDocumentPassiveNoTouchAction); + WebFeature::kTouchEventPreventedForcedDocumentPassiveNoTouchAction); break; default: break; diff --git a/third_party/WebKit/Source/core/events/TouchEventTest.cpp b/third_party/WebKit/Source/core/events/TouchEventTest.cpp index 5b45014908122a..020e218bc74535 100644 --- a/third_party/WebKit/Source/core/events/TouchEventTest.cpp +++ b/third_party/WebKit/Source/core/events/TouchEventTest.cpp @@ -87,10 +87,10 @@ TEST_F(TouchEventTest, PreventDefaultUncancelable) { EXPECT_THAT(MessageSources(), ElementsAre(kJSMessageSource)); EXPECT_TRUE(UseCounter::IsCounted( - GetDocument(), UseCounter::kUncancelableTouchEventPreventDefaulted)); + GetDocument(), WebFeature::kUncancelableTouchEventPreventDefaulted)); EXPECT_FALSE(UseCounter::IsCounted( GetDocument(), - UseCounter:: + WebFeature:: kUncancelableTouchEventDueToMainThreadResponsivenessPreventDefaulted)); } @@ -110,10 +110,10 @@ TEST_F(TouchEventTest, EXPECT_THAT(MessageSources(), ElementsAre(kInterventionMessageSource)); EXPECT_TRUE(UseCounter::IsCounted( - GetDocument(), UseCounter::kUncancelableTouchEventPreventDefaulted)); + GetDocument(), WebFeature::kUncancelableTouchEventPreventDefaulted)); EXPECT_TRUE(UseCounter::IsCounted( GetDocument(), - UseCounter:: + WebFeature:: kUncancelableTouchEventDueToMainThreadResponsivenessPreventDefaulted)); } diff --git a/third_party/WebKit/Source/core/events/VisualViewportResizeEvent.cpp b/third_party/WebKit/Source/core/events/VisualViewportResizeEvent.cpp index 060f05da840994..85f8019ec3bd9f 100644 --- a/third_party/WebKit/Source/core/events/VisualViewportResizeEvent.cpp +++ b/third_party/WebKit/Source/core/events/VisualViewportResizeEvent.cpp @@ -18,7 +18,7 @@ VisualViewportResizeEvent::VisualViewportResizeEvent() void VisualViewportResizeEvent::DoneDispatchingEventAtCurrentTarget() { UseCounter::Count(currentTarget()->GetExecutionContext(), - UseCounter::kVisualViewportResizeFired); + WebFeature::kVisualViewportResizeFired); } } // namespace blink diff --git a/third_party/WebKit/Source/core/events/VisualViewportScrollEvent.cpp b/third_party/WebKit/Source/core/events/VisualViewportScrollEvent.cpp index 3c10f1fb891944..0dcd9ccf91ffe0 100644 --- a/third_party/WebKit/Source/core/events/VisualViewportScrollEvent.cpp +++ b/third_party/WebKit/Source/core/events/VisualViewportScrollEvent.cpp @@ -18,7 +18,7 @@ VisualViewportScrollEvent::VisualViewportScrollEvent() void VisualViewportScrollEvent::DoneDispatchingEventAtCurrentTarget() { UseCounter::Count(currentTarget()->GetExecutionContext(), - UseCounter::kVisualViewportScrollFired); + WebFeature::kVisualViewportScrollFired); } } // namespace blink diff --git a/third_party/WebKit/Source/core/exported/SharedWorkerRepositoryClientImpl.cpp b/third_party/WebKit/Source/core/exported/SharedWorkerRepositoryClientImpl.cpp index c03a778463467d..8c31ca61859752 100644 --- a/third_party/WebKit/Source/core/exported/SharedWorkerRepositoryClientImpl.cpp +++ b/third_party/WebKit/Source/core/exported/SharedWorkerRepositoryClientImpl.cpp @@ -79,10 +79,10 @@ class SharedWorkerConnectListener final case kWebWorkerCreationErrorNone: return; case kWebWorkerCreationErrorSecureContextMismatch: - UseCounter::Feature feature = + WebFeature feature = is_secure_context - ? UseCounter::kNonSecureSharedWorkerAccessedFromSecureContext - : UseCounter::kSecureSharedWorkerAccessedFromNonSecureContext; + ? WebFeature::kNonSecureSharedWorkerAccessedFromSecureContext + : WebFeature::kSecureSharedWorkerAccessedFromNonSecureContext; UseCounter::Count(document, feature); return; } @@ -97,7 +97,7 @@ class SharedWorkerConnectListener final void CountFeature(uint32_t feature) override { UseCounter::Count(worker_->GetExecutionContext(), - static_cast(feature)); + static_cast(feature)); } Persistent worker_; diff --git a/third_party/WebKit/Source/core/fileapi/Blob.cpp b/third_party/WebKit/Source/core/fileapi/Blob.cpp index 795a698e80ee5d..33f38374f91604 100644 --- a/third_party/WebKit/Source/core/fileapi/Blob.cpp +++ b/third_party/WebKit/Source/core/fileapi/Blob.cpp @@ -96,7 +96,7 @@ Blob* Blob::Create( DCHECK(options.hasEndings()); bool normalize_line_endings_to_native = options.endings() == "native"; if (normalize_line_endings_to_native) - UseCounter::Count(context, UseCounter::kFileAPINativeLineEndings); + UseCounter::Count(context, WebFeature::kFileAPINativeLineEndings); std::unique_ptr blob_data = BlobData::Create(); blob_data->SetContentType(NormalizeType(options.type())); diff --git a/third_party/WebKit/Source/core/fileapi/File.cpp b/third_party/WebKit/Source/core/fileapi/File.cpp index cb17626d0a44b1..51f2e35df9c98c 100644 --- a/third_party/WebKit/Source/core/fileapi/File.cpp +++ b/third_party/WebKit/Source/core/fileapi/File.cpp @@ -133,7 +133,7 @@ File* File::Create( DCHECK(options.hasEndings()); bool normalize_line_endings_to_native = options.endings() == "native"; if (normalize_line_endings_to_native) - UseCounter::Count(context, UseCounter::kFileAPINativeLineEndings); + UseCounter::Count(context, WebFeature::kFileAPINativeLineEndings); std::unique_ptr blob_data = BlobData::Create(); blob_data->SetContentType(NormalizeType(options.type())); diff --git a/third_party/WebKit/Source/core/fileapi/URLFileAPI.cpp b/third_party/WebKit/Source/core/fileapi/URLFileAPI.cpp index 4483c6d7fcd323..d7669235f7af7f 100644 --- a/third_party/WebKit/Source/core/fileapi/URLFileAPI.cpp +++ b/third_party/WebKit/Source/core/fileapi/URLFileAPI.cpp @@ -31,7 +31,7 @@ String URLFileAPI::createObjectURL(ScriptState* script_state, return String(); } - UseCounter::Count(execution_context, UseCounter::kCreateObjectURLBlob); + UseCounter::Count(execution_context, WebFeature::kCreateObjectURLBlob); return DOMURL::CreatePublicURL(execution_context, blob, blob->Uuid()); } diff --git a/third_party/WebKit/Source/core/frame/DOMWindow.cpp b/third_party/WebKit/Source/core/frame/DOMWindow.cpp index 792f78ec63ec7d..1d00e718abcc33 100644 --- a/third_party/WebKit/Source/core/frame/DOMWindow.cpp +++ b/third_party/WebKit/Source/core/frame/DOMWindow.cpp @@ -224,17 +224,17 @@ void DOMWindow::postMessage(PassRefPtr message, if (MixedContentChecker::IsMixedContent(source_document->GetSecurityOrigin(), target_url)) { UseCounter::Count(source->GetFrame(), - UseCounter::kPostMessageFromSecureToInsecure); + WebFeature::kPostMessageFromSecureToInsecure); } else if (MixedContentChecker::IsMixedContent( GetFrame()->GetSecurityContext()->GetSecurityOrigin(), source_document->Url())) { UseCounter::Count(source->GetFrame(), - UseCounter::kPostMessageFromInsecureToSecure); + WebFeature::kPostMessageFromInsecureToSecure); if (MixedContentChecker::IsMixedContent( GetFrame()->Tree().Top().GetSecurityContext()->GetSecurityOrigin(), source_document->Url())) { UseCounter::Count(source->GetFrame(), - UseCounter::kPostMessageFromInsecureToSecureToplevel); + WebFeature::kPostMessageFromInsecureToSecureToplevel); } } @@ -243,7 +243,7 @@ void DOMWindow::postMessage(PassRefPtr message, SecurityViolationReportingPolicy::kSuppressReporting)) { UseCounter::Count( source->GetFrame(), - UseCounter::kPostMessageOutgoingWouldBeBlockedByConnectSrc); + WebFeature::kPostMessageOutgoingWouldBeBlockedByConnectSrc); } MessageEvent* event = diff --git a/third_party/WebKit/Source/core/frame/Deprecation.h b/third_party/WebKit/Source/core/frame/Deprecation.h index a8b4028397f3ee..99fe14d9ab2828 100644 --- a/third_party/WebKit/Source/core/frame/Deprecation.h +++ b/third_party/WebKit/Source/core/frame/Deprecation.h @@ -42,37 +42,12 @@ class CORE_EXPORT Deprecation { static void CountDeprecation(const LocalFrame*, WebFeature); static void CountDeprecation(ExecutionContext*, WebFeature); static void CountDeprecation(const Document&, WebFeature); - static void CountDeprecation(const LocalFrame* frame, - UseCounter::Feature feature) { - return CountDeprecation(frame, static_cast(feature)); - } - static void CountDeprecation(ExecutionContext* exec_context, - UseCounter::Feature feature) { - return CountDeprecation(exec_context, static_cast(feature)); - } - static void CountDeprecation(const Document& document, - UseCounter::Feature feature) { - return CountDeprecation(document, static_cast(feature)); - } // Count only features if they're being used in an iframe which does not // have script access into the top level document. static void CountDeprecationCrossOriginIframe(const LocalFrame*, WebFeature); static void CountDeprecationCrossOriginIframe(const Document&, WebFeature); static String DeprecationMessage(WebFeature); - static void CountDeprecationCrossOriginIframe(const LocalFrame* frame, - UseCounter::Feature feature) { - return CountDeprecationCrossOriginIframe(frame, - static_cast(feature)); - } - static void CountDeprecationCrossOriginIframe(const Document& document, - UseCounter::Feature feature) { - return CountDeprecationCrossOriginIframe(document, - static_cast(feature)); - } - static String DeprecationMessage(UseCounter::Feature feature) { - return DeprecationMessage(static_cast(feature)); - } // Note: this is only public for tests. bool IsSuppressed(CSSPropertyID unresolved_property); diff --git a/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp b/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp index de9e58092dfba2..90e2efa7b28ad4 100644 --- a/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp +++ b/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp @@ -696,7 +696,7 @@ void LocalDOMWindow::DispatchMessageEventWithOriginCheck( sender, RedirectStatus::kNoRedirect, SecurityViolationReportingPolicy::kSuppressReporting)) { UseCounter::Count( - GetFrame(), UseCounter::kPostMessageIncomingWouldBeBlockedByConnectSrc); + GetFrame(), WebFeature::kPostMessageIncomingWouldBeBlockedByConnectSrc); } DispatchEvent(event); @@ -728,7 +728,7 @@ void LocalDOMWindow::print(ScriptState* script_state) { if (script_state && v8::MicrotasksScope::IsRunningMicrotasks(script_state->GetIsolate())) { - UseCounter::Count(document(), UseCounter::kDuring_Microtask_Print); + UseCounter::Count(document(), WebFeature::kDuring_Microtask_Print); } if (GetFrame()->IsLoading()) { @@ -737,7 +737,7 @@ void LocalDOMWindow::print(ScriptState* script_state) { } UseCounter::CountCrossOriginIframe(*document(), - UseCounter::kCrossOriginWindowPrint); + WebFeature::kCrossOriginWindowPrint); should_print_when_finished_loading_ = false; page->GetChromeClient().Print(GetFrame()); @@ -754,7 +754,7 @@ void LocalDOMWindow::alert(ScriptState* script_state, const String& message) { return; if (document()->IsSandboxed(kSandboxModals)) { - UseCounter::Count(document(), UseCounter::kDialogInSandboxedContext); + UseCounter::Count(document(), WebFeature::kDialogInSandboxedContext); GetFrameConsole()->AddMessage(ConsoleMessage::Create( kSecurityMessageSource, kErrorMessageLevel, "Ignored call to 'alert()'. The document is sandboxed, and the " @@ -764,27 +764,27 @@ void LocalDOMWindow::alert(ScriptState* script_state, const String& message) { switch (document()->GetEngagementLevel()) { case mojom::blink::EngagementLevel::NONE: - UseCounter::Count(document(), UseCounter::kAlertEngagementNone); + UseCounter::Count(document(), WebFeature::kAlertEngagementNone); break; case mojom::blink::EngagementLevel::MINIMAL: - UseCounter::Count(document(), UseCounter::kAlertEngagementMinimal); + UseCounter::Count(document(), WebFeature::kAlertEngagementMinimal); break; case mojom::blink::EngagementLevel::LOW: - UseCounter::Count(document(), UseCounter::kAlertEngagementLow); + UseCounter::Count(document(), WebFeature::kAlertEngagementLow); break; case mojom::blink::EngagementLevel::MEDIUM: - UseCounter::Count(document(), UseCounter::kAlertEngagementMedium); + UseCounter::Count(document(), WebFeature::kAlertEngagementMedium); break; case mojom::blink::EngagementLevel::HIGH: - UseCounter::Count(document(), UseCounter::kAlertEngagementHigh); + UseCounter::Count(document(), WebFeature::kAlertEngagementHigh); break; case mojom::blink::EngagementLevel::MAX: - UseCounter::Count(document(), UseCounter::kAlertEngagementMax); + UseCounter::Count(document(), WebFeature::kAlertEngagementMax); break; } if (v8::MicrotasksScope::IsRunningMicrotasks(script_state->GetIsolate())) { - UseCounter::Count(document(), UseCounter::kDuring_Microtask_Alert); + UseCounter::Count(document(), WebFeature::kDuring_Microtask_Alert); } document()->UpdateStyleAndLayoutTree(); @@ -794,7 +794,7 @@ void LocalDOMWindow::alert(ScriptState* script_state, const String& message) { return; UseCounter::CountCrossOriginIframe(*document(), - UseCounter::kCrossOriginWindowAlert); + WebFeature::kCrossOriginWindowAlert); page->GetChromeClient().OpenJavaScriptAlert(GetFrame(), message); } @@ -804,7 +804,7 @@ bool LocalDOMWindow::confirm(ScriptState* script_state, const String& message) { return false; if (document()->IsSandboxed(kSandboxModals)) { - UseCounter::Count(document(), UseCounter::kDialogInSandboxedContext); + UseCounter::Count(document(), WebFeature::kDialogInSandboxedContext); GetFrameConsole()->AddMessage(ConsoleMessage::Create( kSecurityMessageSource, kErrorMessageLevel, "Ignored call to 'confirm()'. The document is sandboxed, and the " @@ -814,27 +814,27 @@ bool LocalDOMWindow::confirm(ScriptState* script_state, const String& message) { switch (document()->GetEngagementLevel()) { case mojom::blink::EngagementLevel::NONE: - UseCounter::Count(document(), UseCounter::kConfirmEngagementNone); + UseCounter::Count(document(), WebFeature::kConfirmEngagementNone); break; case mojom::blink::EngagementLevel::MINIMAL: - UseCounter::Count(document(), UseCounter::kConfirmEngagementMinimal); + UseCounter::Count(document(), WebFeature::kConfirmEngagementMinimal); break; case mojom::blink::EngagementLevel::LOW: - UseCounter::Count(document(), UseCounter::kConfirmEngagementLow); + UseCounter::Count(document(), WebFeature::kConfirmEngagementLow); break; case mojom::blink::EngagementLevel::MEDIUM: - UseCounter::Count(document(), UseCounter::kConfirmEngagementMedium); + UseCounter::Count(document(), WebFeature::kConfirmEngagementMedium); break; case mojom::blink::EngagementLevel::HIGH: - UseCounter::Count(document(), UseCounter::kConfirmEngagementHigh); + UseCounter::Count(document(), WebFeature::kConfirmEngagementHigh); break; case mojom::blink::EngagementLevel::MAX: - UseCounter::Count(document(), UseCounter::kConfirmEngagementMax); + UseCounter::Count(document(), WebFeature::kConfirmEngagementMax); break; } if (v8::MicrotasksScope::IsRunningMicrotasks(script_state->GetIsolate())) { - UseCounter::Count(document(), UseCounter::kDuring_Microtask_Confirm); + UseCounter::Count(document(), WebFeature::kDuring_Microtask_Confirm); } document()->UpdateStyleAndLayoutTree(); @@ -844,7 +844,7 @@ bool LocalDOMWindow::confirm(ScriptState* script_state, const String& message) { return false; UseCounter::CountCrossOriginIframe(*document(), - UseCounter::kCrossOriginWindowConfirm); + WebFeature::kCrossOriginWindowConfirm); return page->GetChromeClient().OpenJavaScriptConfirm(GetFrame(), message); } @@ -856,7 +856,7 @@ String LocalDOMWindow::prompt(ScriptState* script_state, return String(); if (document()->IsSandboxed(kSandboxModals)) { - UseCounter::Count(document(), UseCounter::kDialogInSandboxedContext); + UseCounter::Count(document(), WebFeature::kDialogInSandboxedContext); GetFrameConsole()->AddMessage(ConsoleMessage::Create( kSecurityMessageSource, kErrorMessageLevel, "Ignored call to 'prompt()'. The document is sandboxed, and the " @@ -866,27 +866,27 @@ String LocalDOMWindow::prompt(ScriptState* script_state, switch (document()->GetEngagementLevel()) { case mojom::blink::EngagementLevel::NONE: - UseCounter::Count(document(), UseCounter::kPromptEngagementNone); + UseCounter::Count(document(), WebFeature::kPromptEngagementNone); break; case mojom::blink::EngagementLevel::MINIMAL: - UseCounter::Count(document(), UseCounter::kPromptEngagementMinimal); + UseCounter::Count(document(), WebFeature::kPromptEngagementMinimal); break; case mojom::blink::EngagementLevel::LOW: - UseCounter::Count(document(), UseCounter::kPromptEngagementLow); + UseCounter::Count(document(), WebFeature::kPromptEngagementLow); break; case mojom::blink::EngagementLevel::MEDIUM: - UseCounter::Count(document(), UseCounter::kPromptEngagementMedium); + UseCounter::Count(document(), WebFeature::kPromptEngagementMedium); break; case mojom::blink::EngagementLevel::HIGH: - UseCounter::Count(document(), UseCounter::kPromptEngagementHigh); + UseCounter::Count(document(), WebFeature::kPromptEngagementHigh); break; case mojom::blink::EngagementLevel::MAX: - UseCounter::Count(document(), UseCounter::kPromptEngagementMax); + UseCounter::Count(document(), WebFeature::kPromptEngagementMax); break; } if (v8::MicrotasksScope::IsRunningMicrotasks(script_state->GetIsolate())) { - UseCounter::Count(document(), UseCounter::kDuring_Microtask_Prompt); + UseCounter::Count(document(), WebFeature::kDuring_Microtask_Prompt); } document()->UpdateStyleAndLayoutTree(); @@ -901,7 +901,7 @@ String LocalDOMWindow::prompt(ScriptState* script_state, return return_value; UseCounter::CountCrossOriginIframe(*document(), - UseCounter::kCrossOriginWindowPrompt); + WebFeature::kCrossOriginWindowPrompt); return String(); } @@ -1436,10 +1436,10 @@ void LocalDOMWindow::AddedEventListener( } if (event_type == EventTypeNames::unload) { - UseCounter::Count(document(), UseCounter::kDocumentUnloadRegistered); + UseCounter::Count(document(), WebFeature::kDocumentUnloadRegistered); AddUnloadEventListener(this); } else if (event_type == EventTypeNames::beforeunload) { - UseCounter::Count(document(), UseCounter::kDocumentBeforeUnloadRegistered); + UseCounter::Count(document(), WebFeature::kDocumentBeforeUnloadRegistered); if (AllowsBeforeUnloadListeners(this)) { // This is confusingly named. It doesn't actually add the listener. It // just increments a count so that we know we have listeners registered @@ -1449,7 +1449,7 @@ void LocalDOMWindow::AddedEventListener( } else { // Subframes return false from allowsBeforeUnloadListeners. UseCounter::Count(document(), - UseCounter::kSubFrameBeforeUnloadRegistered); + WebFeature::kSubFrameBeforeUnloadRegistered); } } } @@ -1601,9 +1601,9 @@ DOMWindow* LocalDOMWindow::open(const String& url_string, if (!first_frame) return nullptr; - UseCounter::Count(*active_document, UseCounter::kDOMWindowOpen); + UseCounter::Count(*active_document, WebFeature::kDOMWindowOpen); if (!window_features_string.IsEmpty()) - UseCounter::Count(*active_document, UseCounter::kDOMWindowOpenFeatures); + UseCounter::Count(*active_document, WebFeature::kDOMWindowOpenFeatures); // Get the target frame for the special cases of _top and _parent. // In those cases, we schedule a location change right now and return early. diff --git a/third_party/WebKit/Source/core/frame/LocalFrame.cpp b/third_party/WebKit/Source/core/frame/LocalFrame.cpp index a60db70103ece4..079317a5cbdab3 100644 --- a/third_party/WebKit/Source/core/frame/LocalFrame.cpp +++ b/third_party/WebKit/Source/core/frame/LocalFrame.cpp @@ -944,9 +944,9 @@ bool LocalFrame::CanNavigate(const Frame& target_frame) { // Top navigation in sandbox with or w/o 'allow-top-navigation'. if (target_frame != this && sandboxed && target_frame == Tree().Top()) { - UseCounter::Count(this, UseCounter::kTopNavInSandbox); + UseCounter::Count(this, WebFeature::kTopNavInSandbox); if (!has_user_gesture) { - UseCounter::Count(this, UseCounter::kTopNavInSandboxWithoutGesture); + UseCounter::Count(this, WebFeature::kTopNavInSandboxWithoutGesture); } } @@ -963,12 +963,12 @@ bool LocalFrame::CanNavigate(const Frame& target_frame) { if (has_user_gesture) framebust_params |= kUserGestureBit; - UseCounter::Count(this, UseCounter::kTopNavigationFromSubFrame); + UseCounter::Count(this, WebFeature::kTopNavigationFromSubFrame); if (sandboxed) { // Sandboxed with 'allow-top-navigation'. - UseCounter::Count(this, UseCounter::kTopNavInSandboxWithPerm); + UseCounter::Count(this, WebFeature::kTopNavInSandboxWithPerm); if (!has_user_gesture) { UseCounter::Count(this, - UseCounter::kTopNavInSandboxWithPermButNoGesture); + WebFeature::kTopNavInSandboxWithPermButNoGesture); } } diff --git a/third_party/WebKit/Source/core/frame/SubresourceIntegrity.cpp b/third_party/WebKit/Source/core/frame/SubresourceIntegrity.cpp index 2eb35697636960..8686087bd00d56 100644 --- a/third_party/WebKit/Source/core/frame/SubresourceIntegrity.cpp +++ b/third_party/WebKit/Source/core/frame/SubresourceIntegrity.cpp @@ -132,7 +132,7 @@ bool SubresourceIntegrity::CheckSubresourceIntegrity( const Resource& resource) { if (!resource.IsEligibleForIntegrityCheck(document.GetSecurityOrigin())) { UseCounter::Count(document, - UseCounter::kSRIElementIntegrityAttributeButIneligible); + WebFeature::kSRIElementIntegrityAttributeButIneligible); LogErrorToConsole("Subresource Integrity: The resource '" + resource_url.ElidedString() + "' has an integrity attribute, but the resource " @@ -204,7 +204,7 @@ bool SubresourceIntegrity::CheckSubresourceIntegrity( if (DigestsEqual(digest, converted_hash_vector)) { UseCounter::Count( &execution_context, - UseCounter::kSRIElementWithMatchingIntegrityAttribute); + WebFeature::kSRIElementWithMatchingIntegrityAttribute); return true; } } @@ -228,7 +228,7 @@ bool SubresourceIntegrity::CheckSubresourceIntegrity( resource_url.ElidedString() + "'. The resource has been blocked."; } UseCounter::Count(&execution_context, - UseCounter::kSRIElementWithNonMatchingIntegrityAttribute); + WebFeature::kSRIElementWithNonMatchingIntegrityAttribute); return false; } @@ -360,7 +360,7 @@ SubresourceIntegrity::ParseIntegrityAttribute( *execution_context); UseCounter::Count( execution_context, - UseCounter::kSRIElementWithUnparsableIntegrityAttribute); + WebFeature::kSRIElementWithUnparsableIntegrityAttribute); } continue; } @@ -376,7 +376,7 @@ SubresourceIntegrity::ParseIntegrityAttribute( *execution_context); UseCounter::Count( execution_context, - UseCounter::kSRIElementWithUnparsableIntegrityAttribute); + WebFeature::kSRIElementWithUnparsableIntegrityAttribute); } continue; } @@ -393,7 +393,7 @@ SubresourceIntegrity::ParseIntegrityAttribute( *execution_context); UseCounter::Count( execution_context, - UseCounter::kSRIElementWithUnparsableIntegrityAttribute); + WebFeature::kSRIElementWithUnparsableIntegrityAttribute); } continue; } diff --git a/third_party/WebKit/Source/core/frame/UseCounter.cpp b/third_party/WebKit/Source/core/frame/UseCounter.cpp index 47aeb08fa78ae7..e803c8551ac4a1 100644 --- a/third_party/WebKit/Source/core/frame/UseCounter.cpp +++ b/third_party/WebKit/Source/core/frame/UseCounter.cpp @@ -1102,7 +1102,7 @@ int UseCounter::MapCSSPropertyIdToCSSSampleIdForHistogram( UseCounter::UseCounter(Context context) : mute_count_(0), context_(context), - features_recorded_(kNumberOfFeatures), + features_recorded_(static_cast(WebFeature::kNumberOfFeatures)), css_recorded_(numCSSPropertyIDs), animated_css_recorded_(numCSSPropertyIDs) {} @@ -1174,7 +1174,7 @@ void UseCounter::DidCommitLoad(KURL url) { css_recorded_.ClearAll(); animated_css_recorded_.ClearAll(); if (context_ != kDisabledContext && !mute_count_) { - FeaturesHistogram().Count(kPageVisits); + FeaturesHistogram().Count(static_cast(WebFeature::kPageVisits)); if (context_ != kExtensionContext) { CssHistogram().Count(totalPagesMeasuredCSSSampleId()); AnimatedCSSHistogram().Count(totalPagesMeasuredCSSSampleId()); @@ -1331,13 +1331,13 @@ EnumerationHistogram& UseCounter::FeaturesHistogram() const { // So instead we just use a dedicated histogram for the SVG case. DEFINE_STATIC_LOCAL(blink::EnumerationHistogram, svg_histogram, ("Blink.UseCounter.SVGImage.Features", - blink::UseCounter::kNumberOfFeatures)); + static_cast(WebFeature::kNumberOfFeatures))); DEFINE_STATIC_LOCAL(blink::EnumerationHistogram, extension_histogram, ("Blink.UseCounter.Extensions.Features", - blink::UseCounter::kNumberOfFeatures)); - DEFINE_STATIC_LOCAL( - blink::EnumerationHistogram, histogram, - ("Blink.UseCounter.Features", blink::UseCounter::kNumberOfFeatures)); + static_cast(WebFeature::kNumberOfFeatures))); + DEFINE_STATIC_LOCAL(blink::EnumerationHistogram, histogram, + ("Blink.UseCounter.Features", + static_cast(WebFeature::kNumberOfFeatures))); switch (context_) { case kSVGImageContext: return svg_histogram; @@ -1381,19 +1381,21 @@ EnumerationHistogram& UseCounter::AnimatedCSSHistogram() const { */ static EnumerationHistogram& FeatureObserverHistogram() { - DEFINE_STATIC_LOCAL( - EnumerationHistogram, histogram, - ("WebCore.FeatureObserver", UseCounter::kNumberOfFeatures)); + DEFINE_STATIC_LOCAL(EnumerationHistogram, histogram, + ("WebCore.FeatureObserver", + static_cast(WebFeature::kNumberOfFeatures))); return histogram; } UseCounter::LegacyCounter::LegacyCounter() - : feature_bits_(kNumberOfFeatures), css_bits_(numCSSPropertyIDs) {} + : feature_bits_(static_cast(WebFeature::kNumberOfFeatures)), + css_bits_(numCSSPropertyIDs) {} UseCounter::LegacyCounter::~LegacyCounter() { // PageDestruction was intended to be used as a scale, but it's broken (due to // fast shutdown). See https://crbug.com/597963. - FeatureObserverHistogram().Count(kOBSOLETE_PageDestruction); + FeatureObserverHistogram().Count( + static_cast(WebFeature::kOBSOLETE_PageDestruction)); UpdateMeasurements(); } @@ -1407,8 +1409,8 @@ void UseCounter::LegacyCounter::CountCSS(CSSPropertyID property) { void UseCounter::LegacyCounter::UpdateMeasurements() { EnumerationHistogram& feature_histogram = FeatureObserverHistogram(); - feature_histogram.Count(kPageVisits); - for (size_t i = 0; i < kNumberOfFeatures; ++i) { + feature_histogram.Count(static_cast(WebFeature::kPageVisits)); + for (size_t i = 0; i < static_cast(WebFeature::kNumberOfFeatures); ++i) { if (feature_bits_.QuickGet(i)) feature_histogram.Count(i); } diff --git a/third_party/WebKit/Source/core/frame/UseCounter.h b/third_party/WebKit/Source/core/frame/UseCounter.h index 49ea05266d97d2..61fffbc1b1483a 100644 --- a/third_party/WebKit/Source/core/frame/UseCounter.h +++ b/third_party/WebKit/Source/core/frame/UseCounter.h @@ -78,10 +78,6 @@ class CORE_EXPORT UseCounter { UseCounter(Context = kDefaultContext); - enum Feature : uint32_t { -#include "public/platform/UseCounterFeature.def" - }; - // An interface to observe UseCounter changes. Note that this is never // notified when the counter is disabled by |m_muteCount| or when |m_context| // is kDisabledContext. @@ -99,16 +95,6 @@ class CORE_EXPORT UseCounter { static void Count(const LocalFrame*, WebFeature); static void Count(const Document&, WebFeature); static void Count(ExecutionContext*, WebFeature); - // TODO(lunalu): Deprecate Count() that takes UseCounter::Feature. - static void Count(const LocalFrame* frame, Feature feature) { - return Count(frame, static_cast(feature)); - } - static void Count(const Document& document, Feature feature) { - return Count(document, static_cast(feature)); - } - static void Count(ExecutionContext* exec_context, Feature feature) { - return Count(exec_context, static_cast(feature)); - } void Count(CSSParserMode, CSSPropertyID); void Count(WebFeature, const LocalFrame*); @@ -119,16 +105,10 @@ class CORE_EXPORT UseCounter { // Count only features if they're being used in an iframe which does not // have script access into the top level document. static void CountCrossOriginIframe(const Document&, WebFeature); - static void CountCrossOriginIframe(const Document& doc, Feature feature) { - return CountCrossOriginIframe(doc, static_cast(feature)); - } // Return whether the Feature was previously counted for this document. // NOTE: only for use in testing. static bool IsCounted(Document&, WebFeature); - static bool IsCounted(Document& doc, Feature feature) { - return IsCounted(doc, static_cast(feature)); - } // Return whether the CSSPropertyID was previously counted for this document. // NOTE: only for use in testing. static bool IsCounted(Document&, const String&); @@ -152,17 +132,11 @@ class CORE_EXPORT UseCounter { void UnmuteForInspector(); void RecordMeasurement(WebFeature); - void RecordMeasurement(Feature feature) { - return RecordMeasurement(static_cast(feature)); - } // Return whether the feature has been seen since the last page load // (except when muted). Does include features seen in documents which have // reporting disabled. bool HasRecordedMeasurement(WebFeature) const; - bool HasRecordedMeasurement(Feature feature) const { - return HasRecordedMeasurement(static_cast(feature)); - } DECLARE_TRACE(); diff --git a/third_party/WebKit/Source/core/frame/UseCounterTest.cpp b/third_party/WebKit/Source/core/frame/UseCounterTest.cpp index 9c4a3301d96644..672dec8a70445d 100644 --- a/third_party/WebKit/Source/core/frame/UseCounterTest.cpp +++ b/third_party/WebKit/Source/core/frame/UseCounterTest.cpp @@ -35,7 +35,7 @@ const char kExtensionUrl[] = "chrome-extension://dummysite/"; int GetPageVisitsBucketforHistogram(const std::string& histogram_name) { if (histogram_name.find("CSS") == std::string::npos) - return blink::UseCounter::kPageVisits; + return static_cast(blink::WebFeature::kPageVisits); // For CSS histograms, the page visits bucket should be 1. return 1; } @@ -258,7 +258,7 @@ TEST(UseCounterTest, InspectorDisablesMeasurement) { HistogramTester histogram_tester; // The specific feature we use here isn't important. - UseCounter::Feature feature = UseCounter::Feature::kSVGSMILElementInDocument; + WebFeature feature = WebFeature::kSVGSMILElementInDocument; CSSPropertyID property = CSSPropertyFontWeight; CSSParserMode parser_mode = kHTMLStandardMode; @@ -293,7 +293,8 @@ TEST(UseCounterTest, InspectorDisablesMeasurement) { EXPECT_TRUE(use_counter.HasRecordedMeasurement(feature)); use_counter.Count(parser_mode, property); EXPECT_TRUE(use_counter.IsCounted(property)); - histogram_tester.ExpectUniqueSample(kFeaturesHistogramName, feature, 1); + histogram_tester.ExpectUniqueSample(kFeaturesHistogramName, + static_cast(feature), 1); histogram_tester.ExpectUniqueSample( kCSSHistogramName, UseCounter::MapCSSPropertyIdToCSSSampleIdForHistogram(property), 1); @@ -301,14 +302,15 @@ TEST(UseCounterTest, InspectorDisablesMeasurement) { void ExpectHistograms(const HistogramTester& histogram_tester, int visits_count, - UseCounter::Feature feature, + WebFeature feature, int feature_count, CSSPropertyID property, int property_count) { histogram_tester.ExpectBucketCount(kFeaturesHistogramName, - UseCounter::kPageVisits, visits_count); - histogram_tester.ExpectBucketCount(kFeaturesHistogramName, feature, - feature_count); + static_cast(WebFeature::kPageVisits), + visits_count); + histogram_tester.ExpectBucketCount(kFeaturesHistogramName, + static_cast(feature), feature_count); histogram_tester.ExpectTotalCount(kFeaturesHistogramName, visits_count + feature_count); histogram_tester.ExpectBucketCount(kCSSHistogramName, 1, visits_count); @@ -325,81 +327,81 @@ TEST(UseCounterTest, MutedDocuments) { HistogramTester histogram_tester; // Counters triggered before any load are always reported. - use_counter.RecordMeasurement(UseCounter::kFetch); + use_counter.RecordMeasurement(WebFeature::kFetch); use_counter.Count(kHTMLStandardMode, CSSPropertyFontWeight); - ExpectHistograms(histogram_tester, 0, UseCounter::kFetch, 1, + ExpectHistograms(histogram_tester, 0, WebFeature::kFetch, 1, CSSPropertyFontWeight, 1); // Loading an internal page doesn't bump PageVisits and metrics not reported. use_counter.DidCommitLoad(URLTestHelpers::ToKURL(kInternalUrl)); - EXPECT_FALSE(use_counter.HasRecordedMeasurement(UseCounter::kFetch)); + EXPECT_FALSE(use_counter.HasRecordedMeasurement(WebFeature::kFetch)); EXPECT_FALSE(use_counter.IsCounted(CSSPropertyFontWeight)); - use_counter.RecordMeasurement(UseCounter::kFetch); + use_counter.RecordMeasurement(WebFeature::kFetch); use_counter.Count(kHTMLStandardMode, CSSPropertyFontWeight); - ExpectHistograms(histogram_tester, 0, UseCounter::kFetch, 1, + ExpectHistograms(histogram_tester, 0, WebFeature::kFetch, 1, CSSPropertyFontWeight, 1); // But the fact that the features were seen is still known. - EXPECT_TRUE(use_counter.HasRecordedMeasurement(UseCounter::kFetch)); + EXPECT_TRUE(use_counter.HasRecordedMeasurement(WebFeature::kFetch)); EXPECT_TRUE(use_counter.IsCounted(CSSPropertyFontWeight)); // Inspector muting then unmuting doesn't change the behavior. use_counter.MuteForInspector(); use_counter.UnmuteForInspector(); - use_counter.RecordMeasurement(UseCounter::kFetch); + use_counter.RecordMeasurement(WebFeature::kFetch); use_counter.Count(kHTMLStandardMode, CSSPropertyFontWeight); - ExpectHistograms(histogram_tester, 0, UseCounter::kFetch, 1, + ExpectHistograms(histogram_tester, 0, WebFeature::kFetch, 1, CSSPropertyFontWeight, 1); // If we now load a real web page, metrics are reported again. use_counter.DidCommitLoad(URLTestHelpers::ToKURL("http://foo.com/")); - use_counter.RecordMeasurement(UseCounter::kFetch); + use_counter.RecordMeasurement(WebFeature::kFetch); use_counter.Count(kHTMLStandardMode, CSSPropertyFontWeight); - ExpectHistograms(histogram_tester, 1, UseCounter::kFetch, 2, + ExpectHistograms(histogram_tester, 1, WebFeature::kFetch, 2, CSSPropertyFontWeight, 2); // HTTPs URLs are the same. use_counter.DidCommitLoad(URLTestHelpers::ToKURL(kHttpsUrl)); - use_counter.RecordMeasurement(UseCounter::kFetch); + use_counter.RecordMeasurement(WebFeature::kFetch); use_counter.Count(kHTMLStandardMode, CSSPropertyFontWeight); - ExpectHistograms(histogram_tester, 2, UseCounter::kFetch, 3, + ExpectHistograms(histogram_tester, 2, WebFeature::kFetch, 3, CSSPropertyFontWeight, 3); // Extensions aren't counted. use_counter.DidCommitLoad(URLTestHelpers::ToKURL(kExtensionUrl)); - use_counter.RecordMeasurement(UseCounter::kFetch); + use_counter.RecordMeasurement(WebFeature::kFetch); use_counter.Count(kHTMLStandardMode, CSSPropertyFontWeight); - ExpectHistograms(histogram_tester, 2, UseCounter::kFetch, 3, + ExpectHistograms(histogram_tester, 2, WebFeature::kFetch, 3, CSSPropertyFontWeight, 3); // Nor is devtools use_counter.DidCommitLoad( URLTestHelpers::ToKURL("chrome-devtools://1238ba908adf/")); - use_counter.RecordMeasurement(UseCounter::kFetch); + use_counter.RecordMeasurement(WebFeature::kFetch); use_counter.Count(kHTMLStandardMode, CSSPropertyFontWeight); - ExpectHistograms(histogram_tester, 2, UseCounter::kFetch, 3, + ExpectHistograms(histogram_tester, 2, WebFeature::kFetch, 3, CSSPropertyFontWeight, 3); // Nor are data URLs use_counter.DidCommitLoad( URLTestHelpers::ToKURL("data:text/plain,thisisaurl")); - use_counter.RecordMeasurement(UseCounter::kFetch); + use_counter.RecordMeasurement(WebFeature::kFetch); use_counter.Count(kHTMLStandardMode, CSSPropertyFontWeight); - ExpectHistograms(histogram_tester, 2, UseCounter::kFetch, 3, + ExpectHistograms(histogram_tester, 2, WebFeature::kFetch, 3, CSSPropertyFontWeight, 3); // Or empty URLs (a main frame with no Document) use_counter.DidCommitLoad(KURL()); - use_counter.RecordMeasurement(UseCounter::kFetch); + use_counter.RecordMeasurement(WebFeature::kFetch); use_counter.Count(kHTMLStandardMode, CSSPropertyFontWeight); - ExpectHistograms(histogram_tester, 2, UseCounter::kFetch, 3, + ExpectHistograms(histogram_tester, 2, WebFeature::kFetch, 3, CSSPropertyFontWeight, 3); // But file URLs are use_counter.DidCommitLoad(URLTestHelpers::ToKURL("file:///c/autoexec.bat")); - use_counter.RecordMeasurement(UseCounter::kFetch); + use_counter.RecordMeasurement(WebFeature::kFetch); use_counter.Count(kHTMLStandardMode, CSSPropertyFontWeight); - ExpectHistograms(histogram_tester, 3, UseCounter::kFetch, 4, + ExpectHistograms(histogram_tester, 3, WebFeature::kFetch, 4, CSSPropertyFontWeight, 4); } @@ -420,7 +422,7 @@ class DeprecationTest : public ::testing::Test { TEST_F(DeprecationTest, InspectorDisablesDeprecation) { // The specific feature we use here isn't important. - UseCounter::Feature feature = UseCounter::Feature::kCSSDeepCombinator; + WebFeature feature = WebFeature::kCSSDeepCombinator; CSSPropertyID property = CSSPropertyFontWeight; EXPECT_FALSE(deprecation_.IsSuppressed(property)); diff --git a/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp b/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp index a3a696cf1af09a..281ca4569824b0 100644 --- a/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp +++ b/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp @@ -841,7 +841,7 @@ bool CSPDirectiveList::AllowBaseURI( if (result && !CheckSource(OperativeDirective(base_uri_.Get()), url, redirect_status)) { UseCounter::Count(policy_->GetDocument(), - UseCounter::kBaseWouldBeBlockedByDefaultSrc); + WebFeature::kBaseWouldBeBlockedByDefaultSrc); } return result; @@ -878,7 +878,7 @@ bool CSPDirectiveList::AllowWorkerFromSource( child_src_ && CheckSource(child_src_, url, redirect_status)) { Deprecation::CountDeprecation( policy_->GetDocument(), - UseCounter::kChildSrcAllowedWorkerThatScriptSrcBlocked); + WebFeature::kChildSrcAllowedWorkerThatScriptSrcBlocked); return true; } diff --git a/third_party/WebKit/Source/core/frame/csp/CSPSource.cpp b/third_party/WebKit/Source/core/frame/csp/CSPSource.cpp index 5aba84c69459ad..3fb9dbfd33ecae 100644 --- a/third_party/WebKit/Source/core/frame/csp/CSPSource.cpp +++ b/third_party/WebKit/Source/core/frame/csp/CSPSource.cpp @@ -95,7 +95,7 @@ bool CSPSource::HostMatches(const String& host) const { // relying on that behavior. if (document && equal_hosts) { UseCounter::Count(*document, - UseCounter::kCSPSourceWildcardWouldMatchExactHost); + WebFeature::kCSPSourceWildcardWouldMatchExactHost); } } else { // host-part = 1*host-char *( "." 1*host-char ) diff --git a/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp b/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp index 5ddc38f0a71346..8619a851f6f203 100644 --- a/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp +++ b/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp @@ -126,8 +126,8 @@ bool ContentSecurityPolicy::IsNonceableElement(const Element* element) { UseCounter::Count( element->GetDocument(), - nonceable ? UseCounter::kCleanScriptElementWithNonce - : UseCounter::kPotentiallyInjectedScriptElementWithNonce); + nonceable ? WebFeature::kCleanScriptElementWithNonce + : WebFeature::kPotentiallyInjectedScriptElementWithNonce); // This behavior is locked behind the experimental flag for the moment; if we // decide to ship it, drop this check. https://crbug.com/639293 @@ -136,16 +136,15 @@ bool ContentSecurityPolicy::IsNonceableElement(const Element* element) { nonceable; } -static UseCounter::Feature GetUseCounterType( - ContentSecurityPolicyHeaderType type) { +static WebFeature GetUseCounterType(ContentSecurityPolicyHeaderType type) { switch (type) { case kContentSecurityPolicyHeaderTypeEnforce: - return UseCounter::kContentSecurityPolicy; + return WebFeature::kContentSecurityPolicy; case kContentSecurityPolicyHeaderTypeReport: - return UseCounter::kContentSecurityPolicyReportOnly; + return WebFeature::kContentSecurityPolicyReportOnly; } NOTREACHED(); - return UseCounter::kNumberOfFeatures; + return WebFeature::kNumberOfFeatures; } ContentSecurityPolicy::ContentSecurityPolicy() @@ -181,7 +180,7 @@ void ContentSecurityPolicy::ApplyPolicySideEffectsToExecutionContext() { // error messages, then poke at histograms. Document* document = this->GetDocument(); if (sandbox_mask_ != kSandboxNone) { - UseCounter::Count(execution_context_, UseCounter::kSandboxViaCSP); + UseCounter::Count(execution_context_, WebFeature::kSandboxViaCSP); if (document) document->EnforceSandboxFlags(sandbox_mask_); else @@ -201,7 +200,7 @@ void ContentSecurityPolicy::ApplyPolicySideEffectsToExecutionContext() { if (insecure_request_policy_ & kUpgradeInsecureRequests) { UseCounter::Count(execution_context_, - UseCounter::kUpgradeInsecureRequestsEnabled); + WebFeature::kUpgradeInsecureRequestsEnabled); if (!execution_context_->Url().Host().IsEmpty()) { execution_context_->GetSecurityContext().AddInsecureNavigationUpgrade( execution_context_->Url().Host().Impl()->GetHash()); @@ -216,7 +215,7 @@ void ContentSecurityPolicy::ApplyPolicySideEffectsToExecutionContext() { UseCounter::Count(execution_context_, GetUseCounterType(policy->HeaderType())); if (policy->AllowDynamic()) - UseCounter::Count(execution_context_, UseCounter::kCSPWithStrictDynamic); + UseCounter::Count(execution_context_, WebFeature::kCSPWithStrictDynamic); } // We disable 'eval()' even in the case of report-only policies, and rely on @@ -758,8 +757,8 @@ bool ContentSecurityPolicy::AllowScriptFromSource( UseCounter::Count( GetDocument(), parser_disposition == kParserInserted - ? UseCounter::kScriptWithCSPBypassingSchemeParserInserted - : UseCounter::kScriptWithCSPBypassingSchemeNotParserInserted); + ? WebFeature::kScriptWithCSPBypassingSchemeParserInserted + : WebFeature::kScriptWithCSPBypassingSchemeNotParserInserted); } return IsAllowedByAll<&CSPDirectiveList::AllowScriptFromSource>( policies_, url, nonce, hashes, parser_disposition, redirect_status, @@ -978,7 +977,7 @@ bool ContentSecurityPolicy::AllowWorkerContextFromSource( // impact of this backwards-incompatible change. // TODO(mkwst): We reverted this. if (Document* document = this->GetDocument()) { - UseCounter::Count(*document, UseCounter::kWorkerSubjectToCSP); + UseCounter::Count(*document, WebFeature::kWorkerSubjectToCSP); if (IsAllowedByAll<&CSPDirectiveList::AllowWorkerFromSource>( policies_, url, redirect_status, SecurityViolationReportingPolicy::kSuppressReporting, @@ -989,7 +988,7 @@ bool ContentSecurityPolicy::AllowWorkerContextFromSource( SecurityViolationReportingPolicy::kSuppressReporting, check_header_type)) { UseCounter::Count(*document, - UseCounter::kWorkerAllowedByChildBlockedByScript); + WebFeature::kWorkerAllowedByChildBlockedByScript); } } diff --git a/third_party/WebKit/Source/core/html/FormData.cpp b/third_party/WebKit/Source/core/html/FormData.cpp index c2e5cb1d5d7739..8314c4ea99f202 100644 --- a/third_party/WebKit/Source/core/html/FormData.cpp +++ b/third_party/WebKit/Source/core/html/FormData.cpp @@ -108,7 +108,7 @@ void FormData::append(ScriptState* script_state, const String& filename) { if (!blob) { UseCounter::Count(ExecutionContext::From(script_state), - UseCounter::kFormDataAppendNull); + WebFeature::kFormDataAppendNull); } append(name, blob, filename); } diff --git a/third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp b/third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp index a1e403cca10bb6..8a230f1bea84a7 100644 --- a/third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp @@ -310,7 +310,7 @@ void HTMLAnchorElement::SendPings(const KURL& destination_url) const { if (GetDocument().Fetcher()->Archive()) return; - UseCounter::Count(GetDocument(), UseCounter::kHTMLAnchorElementPingAttribute); + UseCounter::Count(GetDocument(), WebFeature::kHTMLAnchorElementPingAttribute); SpaceSplitString ping_urls(ping_value); for (unsigned i = 0; i < ping_urls.size(); i++) @@ -328,7 +328,7 @@ void HTMLAnchorElement::HandleClick(Event* event) { if (!isConnected()) { UseCounter::Count(GetDocument(), - UseCounter::kAnchorClickDispatchForNonConnectedNode); + WebFeature::kAnchorClickDispatchForNonConnectedNode); } StringBuilder url; @@ -353,7 +353,7 @@ void HTMLAnchorElement::HandleClick(Event* event) { kSupportReferrerPolicyLegacyKeywords, &policy) && !HasRel(kRelationNoReferrer)) { UseCounter::Count(GetDocument(), - UseCounter::kHTMLAnchorElementReferrerPolicyAttribute); + WebFeature::kHTMLAnchorElementReferrerPolicyAttribute); request.SetHTTPReferrer(SecurityPolicy::GenerateReferrer( policy, completed_url, GetDocument().OutgoingReferrer())); } diff --git a/third_party/WebKit/Source/core/html/HTMLBodyElement.cpp b/third_party/WebKit/Source/core/html/HTMLBodyElement.cpp index 791a7363263faf..5fc8c30c6e00db 100644 --- a/third_party/WebKit/Source/core/html/HTMLBodyElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLBodyElement.cpp @@ -193,7 +193,7 @@ void HTMLBodyElement::ParseAttribute( EventParameterName())); } else if (name == onselectionchangeAttr) { UseCounter::Count(GetDocument(), - UseCounter::kHTMLBodyElementOnSelectionChangeAttribute); + WebFeature::kHTMLBodyElementOnSelectionChangeAttribute); GetDocument().SetAttributeEventListener( EventTypeNames::selectionchange, CreateAttributeEventListener(GetDocument().GetFrame(), name, value, diff --git a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp index dd6658a67f2d64..d14730b3eaabd1 100644 --- a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp @@ -145,7 +145,7 @@ inline HTMLCanvasElement::HTMLCanvasElement(Document& document) did_fail_to_create_image_buffer_(false), image_buffer_is_clear_(false) { CanvasMetrics::CountCanvasContextUsage(CanvasMetrics::kCanvasCreated); - UseCounter::Count(document, UseCounter::kHTMLCanvasElement); + UseCounter::Count(document, WebFeature::kHTMLCanvasElement); } DEFINE_NODE_FACTORY(HTMLCanvasElement) diff --git a/third_party/WebKit/Source/core/html/HTMLContentElement.cpp b/third_party/WebKit/Source/core/html/HTMLContentElement.cpp index 2298b52abdf7d2..a6453a427e51a0 100644 --- a/third_party/WebKit/Source/core/html/HTMLContentElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLContentElement.cpp @@ -52,7 +52,7 @@ inline HTMLContentElement::HTMLContentElement(Document& document, should_parse_select_(false), is_valid_selector_(true), filter_(filter) { - UseCounter::Count(document, UseCounter::kHTMLContentElement); + UseCounter::Count(document, WebFeature::kHTMLContentElement); } HTMLContentElement::~HTMLContentElement() {} diff --git a/third_party/WebKit/Source/core/html/HTMLDataListElement.cpp b/third_party/WebKit/Source/core/html/HTMLDataListElement.cpp index 8075ff635b16cc..0c931c30188cee 100644 --- a/third_party/WebKit/Source/core/html/HTMLDataListElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLDataListElement.cpp @@ -43,7 +43,7 @@ inline HTMLDataListElement::HTMLDataListElement(Document& document) : HTMLElement(HTMLNames::datalistTag, document) {} HTMLDataListElement* HTMLDataListElement::Create(Document& document) { - UseCounter::Count(document, UseCounter::kDataListElement); + UseCounter::Count(document, WebFeature::kDataListElement); return new HTMLDataListElement(document); } diff --git a/third_party/WebKit/Source/core/html/HTMLDetailsElement.cpp b/third_party/WebKit/Source/core/html/HTMLDetailsElement.cpp index 655ff4e4d7a036..df96443f6361e1 100644 --- a/third_party/WebKit/Source/core/html/HTMLDetailsElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLDetailsElement.cpp @@ -75,7 +75,7 @@ HTMLDetailsElement* HTMLDetailsElement::Create(Document& document) { HTMLDetailsElement::HTMLDetailsElement(Document& document) : HTMLElement(detailsTag, document), is_open_(false) { - UseCounter::Count(document, UseCounter::kDetailsElement); + UseCounter::Count(document, WebFeature::kDetailsElement); } HTMLDetailsElement::~HTMLDetailsElement() {} diff --git a/third_party/WebKit/Source/core/html/HTMLDialogElement.cpp b/third_party/WebKit/Source/core/html/HTMLDialogElement.cpp index aa1769ab31fa58..1d9e1a693d6210 100644 --- a/third_party/WebKit/Source/core/html/HTMLDialogElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLDialogElement.cpp @@ -96,7 +96,7 @@ inline HTMLDialogElement::HTMLDialogElement(Document& document) centering_mode_(kNotCentered), centered_position_(0), return_value_("") { - UseCounter::Count(document, UseCounter::kDialogElement); + UseCounter::Count(document, WebFeature::kDialogElement); } DEFINE_NODE_FACTORY(HTMLDialogElement) @@ -171,7 +171,7 @@ void HTMLDialogElement::showModal(ExceptionState& exception_state) { // See comment in |Fullscreen::RequestFullscreen|. if (Fullscreen::IsInFullscreenElementStack(*this)) { UseCounter::Count(GetDocument(), - UseCounter::kShowModalForElementInFullscreenStack); + WebFeature::kShowModalForElementInFullscreenStack); } GetDocument().AddToTopLayer(this); diff --git a/third_party/WebKit/Source/core/html/HTMLElement.cpp b/third_party/WebKit/Source/core/html/HTMLElement.cpp index 7504a48ae6ae28..cdcb4598f15308 100644 --- a/third_party/WebKit/Source/core/html/HTMLElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLElement.cpp @@ -188,11 +188,11 @@ void HTMLElement::MapLanguageAttributeToLocale(const AtomicString& value, // FIXME: Remove the following UseCounter code when we collect enough // data. - UseCounter::Count(GetDocument(), UseCounter::kLangAttribute); + UseCounter::Count(GetDocument(), WebFeature::kLangAttribute); if (isHTMLHtmlElement(*this)) - UseCounter::Count(GetDocument(), UseCounter::kLangAttributeOnHTML); + UseCounter::Count(GetDocument(), WebFeature::kLangAttributeOnHTML); else if (isHTMLBodyElement(*this)) - UseCounter::Count(GetDocument(), UseCounter::kLangAttributeOnBody); + UseCounter::Count(GetDocument(), WebFeature::kLangAttributeOnBody); String html_language = value.GetString(); size_t first_separator = html_language.find('-'); if (first_separator != kNotFound) @@ -206,7 +206,7 @@ void HTMLElement::MapLanguageAttributeToLocale(const AtomicString& value, ui_language = ui_language.Left(first_separator); if (!DeprecatedEqualIgnoringCase(html_language, ui_language)) { UseCounter::Count(GetDocument(), - UseCounter::kLangAttributeDoesNotMatchToUILocale); + WebFeature::kLangAttributeDoesNotMatchToUILocale); } } else { // The empty string means the language is explicitly unknown. @@ -248,10 +248,10 @@ void HTMLElement::CollectStyleForPresentationAttribute( CSSValueBreakWord); AddPropertyToPresentationAttributeStyle(style, CSSPropertyWebkitLineBreak, CSSValueAfterWhiteSpace); - UseCounter::Count(GetDocument(), UseCounter::kContentEditableTrue); + UseCounter::Count(GetDocument(), WebFeature::kContentEditableTrue); if (HasTagName(htmlTag)) { UseCounter::Count(GetDocument(), - UseCounter::kContentEditableTrueOnHTML); + WebFeature::kContentEditableTrueOnHTML); } } else if (DeprecatedEqualIgnoringCase(value, "plaintext-only")) { AddPropertyToPresentationAttributeStyle( @@ -261,7 +261,7 @@ void HTMLElement::CollectStyleForPresentationAttribute( AddPropertyToPresentationAttributeStyle(style, CSSPropertyWebkitLineBreak, CSSValueAfterWhiteSpace); UseCounter::Count(GetDocument(), - UseCounter::kContentEditablePlainTextOnly); + WebFeature::kContentEditablePlainTextOnly); } else if (DeprecatedEqualIgnoringCase(value, "false")) { AddPropertyToPresentationAttributeStyle( style, CSSPropertyWebkitUserModify, CSSValueReadOnly); @@ -270,7 +270,7 @@ void HTMLElement::CollectStyleForPresentationAttribute( AddPropertyToPresentationAttributeStyle(style, CSSPropertyDisplay, CSSValueNone); } else if (name == draggableAttr) { - UseCounter::Count(GetDocument(), UseCounter::kDraggableAttribute); + UseCounter::Count(GetDocument(), WebFeature::kDraggableAttribute); if (DeprecatedEqualIgnoringCase(value, "true")) { AddPropertyToPresentationAttributeStyle(style, CSSPropertyWebkitUserDrag, CSSValueElement); @@ -465,7 +465,7 @@ void HTMLElement::ParseAttribute(const AttributeModificationParams& params) { } else if (params.name == langAttr) { PseudoStateChanged(CSSSelector::kPseudoLang); } else if (params.name == inertAttr) { - UseCounter::Count(GetDocument(), UseCounter::kInertAttribute); + UseCounter::Count(GetDocument(), WebFeature::kInertAttribute); } else if (params.name == nonceAttr) { if (params.new_value != g_empty_atom) setNonce(params.new_value); @@ -942,7 +942,7 @@ void HTMLElement::AddHTMLLengthToStyle(MutableStylePropertySet* style, return; if (property_id == CSSPropertyWidth && (dimension.IsPercentage() || dimension.IsRelative())) { - UseCounter::Count(GetDocument(), UseCounter::kHTMLElementDeprecatedWidth); + UseCounter::Count(GetDocument(), WebFeature::kHTMLElementDeprecatedWidth); } if (dimension.IsRelative()) return; diff --git a/third_party/WebKit/Source/core/html/HTMLFormControlElement.cpp b/third_party/WebKit/Source/core/html/HTMLFormControlElement.cpp index 1a9bfaa8a5bf26..c23b893d8ea5aa 100644 --- a/third_party/WebKit/Source/core/html/HTMLFormControlElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLFormControlElement.cpp @@ -154,7 +154,7 @@ void HTMLFormControlElement::ParseAttribute( const QualifiedName& name = params.name; if (name == formAttr) { FormAttributeChanged(); - UseCounter::Count(GetDocument(), UseCounter::kFormAttribute); + UseCounter::Count(GetDocument(), WebFeature::kFormAttribute); } else if (name == readonlyAttr) { if (params.old_value.IsNull() != params.new_value.IsNull()) { SetNeedsWillValidateCheck(); @@ -167,10 +167,10 @@ void HTMLFormControlElement::ParseAttribute( } else if (name == requiredAttr) { if (params.old_value.IsNull() != params.new_value.IsNull()) RequiredAttributeChanged(); - UseCounter::Count(GetDocument(), UseCounter::kRequiredAttribute); + UseCounter::Count(GetDocument(), WebFeature::kRequiredAttribute); } else if (name == autofocusAttr) { HTMLElement::ParseAttribute(params); - UseCounter::Count(GetDocument(), UseCounter::kAutoFocusAttribute); + UseCounter::Count(GetDocument(), WebFeature::kAutoFocusAttribute); } else { HTMLElement::ParseAttribute(params); } diff --git a/third_party/WebKit/Source/core/html/HTMLFormElement.cpp b/third_party/WebKit/Source/core/html/HTMLFormElement.cpp index 64cde65ce08087..f198a7ee6c16ef 100644 --- a/third_party/WebKit/Source/core/html/HTMLFormElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLFormElement.cpp @@ -76,7 +76,7 @@ HTMLFormElement::HTMLFormElement(Document& document) was_demoted_(false) {} HTMLFormElement* HTMLFormElement::Create(Document& document) { - UseCounter::Count(document, UseCounter::kFormElement); + UseCounter::Count(document, WebFeature::kFormElement); return new HTMLFormElement(document); } @@ -236,7 +236,7 @@ void HTMLFormElement::SubmitImplicitly(Event* event, } bool HTMLFormElement::ValidateInteractively() { - UseCounter::Count(GetDocument(), UseCounter::kFormValidationStarted); + UseCounter::Count(GetDocument(), WebFeature::kFormValidationStarted); for (const auto& element : ListedElements()) { if (element->IsFormControlElement()) ToHTMLFormControlElement(element)->HideVisibleValidationMessage(); @@ -247,7 +247,7 @@ bool HTMLFormElement::ValidateInteractively() { &unhandled_invalid_controls, kCheckValidityDispatchInvalidEvent)) return true; UseCounter::Count(GetDocument(), - UseCounter::kFormValidationAbortedSubmission); + WebFeature::kFormValidationAbortedSubmission); // Because the form has invalid controls, we abort the form submission and // show a validation message on a focusable form control. @@ -260,7 +260,7 @@ bool HTMLFormElement::ValidateInteractively() { if (unhandled->IsFocusable()) { unhandled->ShowValidationMessage(); UseCounter::Count(GetDocument(), - UseCounter::kFormValidationShowedMessage); + WebFeature::kFormValidationShowedMessage); break; } } @@ -307,7 +307,7 @@ void HTMLFormElement::PrepareForSubmission( if (element->IsFormControlElement() && ToHTMLFormControlElement(element)->BlocksFormSubmission()) { UseCounter::Count(GetDocument(), - UseCounter::kFormSubmittedWithUnclosedFormControl); + WebFeature::kFormSubmittedWithUnclosedFormControl); if (RuntimeEnabledFeatures::UnclosedFormControlIsInvalidEnabled()) { String tag_name = ToHTMLFormControlElement(element)->tagName(); GetDocument().AddConsoleMessage(ConsoleMessage::Create( @@ -331,7 +331,7 @@ void HTMLFormElement::PrepareForSubmission( if (submit_button && submit_button->FormNoValidate()) skip_validation = true; - UseCounter::Count(GetDocument(), UseCounter::kFormSubmissionStarted); + UseCounter::Count(GetDocument(), WebFeature::kFormSubmissionStarted); // Interactive validation must be done before dispatching the submit event. if (!skip_validation && !ValidateInteractively()) return; @@ -467,11 +467,11 @@ void HTMLFormElement::ScheduleFormSubmission(FormSubmission* submission) { if (!target_frame->GetPage()) return; - UseCounter::Count(GetDocument(), UseCounter::kFormsSubmitted); + UseCounter::Count(GetDocument(), WebFeature::kFormsSubmitted); if (MixedContentChecker::IsMixedFormAction(GetDocument().GetFrame(), submission->Action())) { UseCounter::Count(GetDocument().GetFrame(), - UseCounter::kMixedContentFormsSubmitted); + WebFeature::kMixedContentFormsSubmitted); } // TODO(lukasza): Investigate if the code below can uniformly handle remote @@ -530,7 +530,7 @@ void HTMLFormElement::ParseAttribute( if (MixedContentChecker::IsMixedFormAction(GetDocument().GetFrame(), action_url)) { UseCounter::Count(GetDocument().GetFrame(), - UseCounter::kMixedContentFormPresent); + WebFeature::kMixedContentFormPresent); } } else if (name == targetAttr) { attributes_.SetTarget(params.new_value); @@ -582,7 +582,7 @@ void HTMLFormElement::DidAssociateByParser() { if (!did_finish_parsing_children_) return; has_elements_associated_by_parser_ = true; - UseCounter::Count(GetDocument(), UseCounter::kFormAssociationByParser); + UseCounter::Count(GetDocument(), WebFeature::kFormAssociationByParser); } HTMLFormControlsCollection* HTMLFormElement::elements() { @@ -774,7 +774,7 @@ void HTMLFormElement::GetNamedElements( } else if (element_from_past && named_items.IsEmpty()) { named_items.push_back(element_from_past); UseCounter::Count(GetDocument(), - UseCounter::kFormNameAccessForPastNamesMap); + WebFeature::kFormNameAccessForPastNamesMap); } } @@ -818,14 +818,14 @@ void HTMLFormElement::AnonymousNamedGetter( !elements.IsEmpty() && isHTMLImageElement(*elements.front()); if (only_match_img) { UseCounter::Count(GetDocument(), - UseCounter::kFormNameAccessForImageElement); + WebFeature::kFormNameAccessForImageElement); // The following code has performance impact, but it should be small // because access via
name getter is rarely used. for (auto& element : elements) { if (isHTMLImageElement(*element) && !element->IsDescendantOf(this)) { UseCounter::Count( GetDocument(), - UseCounter::kFormNameAccessForNonDescendantImageElement); + WebFeature::kFormNameAccessForNonDescendantImageElement); break; } } @@ -840,7 +840,7 @@ void HTMLFormElement::AnonymousNamedGetter( void HTMLFormElement::SetDemoted(bool demoted) { if (demoted) - UseCounter::Count(GetDocument(), UseCounter::kDemotedFormElement); + UseCounter::Count(GetDocument(), WebFeature::kDemotedFormElement); was_demoted_ = demoted; } diff --git a/third_party/WebKit/Source/core/html/HTMLIFrameElement.cpp b/third_party/WebKit/Source/core/html/HTMLIFrameElement.cpp index 6ab11c6cbfe46a..112bed7932ac49 100644 --- a/third_party/WebKit/Source/core/html/HTMLIFrameElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLIFrameElement.cpp @@ -135,14 +135,14 @@ void HTMLIFrameElement::ParseAttribute( kOtherMessageSource, kErrorMessageLevel, "Error while parsing the 'sandbox' attribute: " + invalid_tokens)); } - UseCounter::Count(GetDocument(), UseCounter::kSandboxViaIFrame); + UseCounter::Count(GetDocument(), WebFeature::kSandboxViaIFrame); } else if (name == referrerpolicyAttr) { referrer_policy_ = kReferrerPolicyDefault; if (!value.IsNull()) { SecurityPolicy::ReferrerPolicyFromString( value, kSupportReferrerPolicyLegacyKeywords, &referrer_policy_); UseCounter::Count(GetDocument(), - UseCounter::kHTMLIFrameElementReferrerPolicyAttribute); + WebFeature::kHTMLIFrameElementReferrerPolicyAttribute); } } else if (name == allowfullscreenAttr) { bool old_allow_fullscreen = allow_fullscreen_; @@ -153,7 +153,7 @@ void HTMLIFrameElement::ParseAttribute( if (allow_fullscreen_ && ContentFrame()) { UseCounter::Count( GetDocument(), - UseCounter:: + WebFeature:: kHTMLIFrameElementAllowfullscreenAttributeSetAfterContentLoad); } FrameOwnerPropertiesChanged(); diff --git a/third_party/WebKit/Source/core/html/HTMLImageElement.cpp b/third_party/WebKit/Source/core/html/HTMLImageElement.cpp index 38907b23aa2ee3..202313fe2c1ad2 100644 --- a/third_party/WebKit/Source/core/html/HTMLImageElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLImageElement.cpp @@ -269,9 +269,9 @@ void HTMLImageElement::SetBestFitURLAndDPRFromImageCandidate( bool intrinsic_sizing_viewport_dependant = false; if (candidate.GetResourceWidth() > 0) { intrinsic_sizing_viewport_dependant = true; - UseCounter::Count(GetDocument(), UseCounter::kSrcsetWDescriptor); + UseCounter::Count(GetDocument(), WebFeature::kSrcsetWDescriptor); } else if (!candidate.SrcOrigin()) { - UseCounter::Count(GetDocument(), UseCounter::kSrcsetXDescriptor); + UseCounter::Count(GetDocument(), WebFeature::kSrcsetXDescriptor); } if (GetLayoutObject() && GetLayoutObject()->IsImage()) { LayoutImageItem(ToLayoutImage(GetLayoutObject())) @@ -320,7 +320,7 @@ void HTMLImageElement::ParseAttribute( params.new_value, kSupportReferrerPolicyLegacyKeywords, &referrer_policy_); UseCounter::Count(GetDocument(), - UseCounter::kHTMLImageElementReferrerPolicyAttribute); + WebFeature::kHTMLImageElementReferrerPolicyAttribute); } } else { HTMLElement::ParseAttribute(params); @@ -364,7 +364,7 @@ ImageCandidate HTMLImageElement::FindBestFitImageFromPictureParent() { HTMLSourceElement* source = toHTMLSourceElement(child); if (!source->FastGetAttribute(srcAttr).IsNull()) { Deprecation::CountDeprecation(GetDocument(), - UseCounter::kPictureSourceSrc); + WebFeature::kPictureSourceSrc); } String srcset = source->FastGetAttribute(srcsetAttr); if (srcset.IsEmpty()) @@ -727,7 +727,7 @@ static bool SourceSizeValue(Element& element, String sizes = element.FastGetAttribute(sizesAttr); bool exists = !sizes.IsNull(); if (exists) - UseCounter::Count(current_document, UseCounter::kSizes); + UseCounter::Count(current_document, WebFeature::kSizes); source_size = SizesAttributeParser(MediaValuesDynamic::Create(current_document), sizes) .length(); diff --git a/third_party/WebKit/Source/core/html/HTMLInputElement.cpp b/third_party/WebKit/Source/core/html/HTMLInputElement.cpp index 6cce7454360a9c..c9464523fa6694 100644 --- a/third_party/WebKit/Source/core/html/HTMLInputElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLInputElement.cpp @@ -768,29 +768,29 @@ void HTMLInputElement::ParseAttribute( EventTypeNames::search, CreateAttributeEventListener(this, name, value, EventParameterName())); } else if (name == incrementalAttr) { - UseCounter::Count(GetDocument(), UseCounter::kIncrementalAttribute); + UseCounter::Count(GetDocument(), WebFeature::kIncrementalAttribute); } else if (name == minAttr) { input_type_view_->MinOrMaxAttributeChanged(); input_type_->SanitizeValueInResponseToMinOrMaxAttributeChange(); input_type_->InRangeChanged(); SetNeedsValidityCheck(); - UseCounter::Count(GetDocument(), UseCounter::kMinAttribute); + UseCounter::Count(GetDocument(), WebFeature::kMinAttribute); } else if (name == maxAttr) { input_type_view_->MinOrMaxAttributeChanged(); input_type_->SanitizeValueInResponseToMinOrMaxAttributeChange(); input_type_->InRangeChanged(); SetNeedsValidityCheck(); - UseCounter::Count(GetDocument(), UseCounter::kMaxAttribute); + UseCounter::Count(GetDocument(), WebFeature::kMaxAttribute); } else if (name == multipleAttr) { input_type_view_->MultipleAttributeChanged(); SetNeedsValidityCheck(); } else if (name == stepAttr) { input_type_view_->StepAttributeChanged(); SetNeedsValidityCheck(); - UseCounter::Count(GetDocument(), UseCounter::kStepAttribute); + UseCounter::Count(GetDocument(), WebFeature::kStepAttribute); } else if (name == patternAttr) { SetNeedsValidityCheck(); - UseCounter::Count(GetDocument(), UseCounter::kPatternAttribute); + UseCounter::Count(GetDocument(), WebFeature::kPatternAttribute); } else if (name == readonlyAttr) { TextControlElement::ParseAttribute(params); input_type_view_->ReadonlyAttributeChanged(); @@ -800,10 +800,10 @@ void HTMLInputElement::ParseAttribute( ResetListAttributeTargetObserver(); ListAttributeTargetChanged(); } - UseCounter::Count(GetDocument(), UseCounter::kListAttribute); + UseCounter::Count(GetDocument(), WebFeature::kListAttribute); } else if (name == webkitdirectoryAttr) { TextControlElement::ParseAttribute(params); - UseCounter::Count(GetDocument(), UseCounter::kPrefixedDirectoryAttribute); + UseCounter::Count(GetDocument(), WebFeature::kPrefixedDirectoryAttribute); } else { if (name == formactionAttr) LogUpdateAttributeIfIsolatedWorldAndInDocument("input", params); diff --git a/third_party/WebKit/Source/core/html/HTMLLabelElement.cpp b/third_party/WebKit/Source/core/html/HTMLLabelElement.cpp index e80125c6a348c2..df06871d29bde9 100644 --- a/third_party/WebKit/Source/core/html/HTMLLabelElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLLabelElement.cpp @@ -62,7 +62,7 @@ LabelableElement* HTMLLabelElement::control() const { if (!element.IsFormControlElement()) { UseCounter::Count( GetDocument(), - UseCounter::kHTMLLabelElementControlForNonFormAssociatedElement); + WebFeature::kHTMLLabelElementControlForNonFormAssociatedElement); } return &element; } @@ -79,7 +79,7 @@ LabelableElement* HTMLLabelElement::control() const { if (!element->IsFormControlElement()) { UseCounter::Count( GetDocument(), - UseCounter::kHTMLLabelElementControlForNonFormAssociatedElement); + WebFeature::kHTMLLabelElementControlForNonFormAssociatedElement); } return ToLabelableElement(element); } diff --git a/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp b/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp index 7c3d8567cc1e0d..2e459e0a31d9cf 100644 --- a/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp @@ -86,7 +86,7 @@ void HTMLLinkElement::ParseAttribute( SecurityPolicy::ReferrerPolicyFromString( value, kDoNotSupportReferrerPolicyLegacyKeywords, &referrer_policy_); UseCounter::Count(GetDocument(), - UseCounter::kHTMLLinkElementReferrerPolicyAttribute); + WebFeature::kHTMLLinkElementReferrerPolicyAttribute); } } else if (name == sizesAttr) { sizes_->DidUpdateAttributeValue(params.old_value, value); @@ -103,7 +103,7 @@ void HTMLLinkElement::ParseAttribute( scope_ = value; Process(); } else if (name == disabledAttr) { - UseCounter::Count(GetDocument(), UseCounter::kHTMLLinkElementDisabled); + UseCounter::Count(GetDocument(), WebFeature::kHTMLLinkElementDisabled); if (LinkStyle* link = GetLinkStyle()) link->SetDisabledState(!value.IsNull()); } else { @@ -154,7 +154,7 @@ LinkResource* HTMLLinkElement::LinkResourceToProcess() { } else { LinkStyle* link = LinkStyle::Create(this); if (FastHasAttribute(disabledAttr)) { - UseCounter::Count(GetDocument(), UseCounter::kHTMLLinkElementDisabled); + UseCounter::Count(GetDocument(), WebFeature::kHTMLLinkElementDisabled); link->SetDisabledState(true); } link_ = link; diff --git a/third_party/WebKit/Source/core/html/HTMLMapElement.cpp b/third_party/WebKit/Source/core/html/HTMLMapElement.cpp index 672873aea777a2..eac6a12460c067 100644 --- a/third_party/WebKit/Source/core/html/HTMLMapElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLMapElement.cpp @@ -37,7 +37,7 @@ using namespace HTMLNames; inline HTMLMapElement::HTMLMapElement(Document& document) : HTMLElement(mapTag, document) { - UseCounter::Count(document, UseCounter::kMapElement); + UseCounter::Count(document, WebFeature::kMapElement); } DEFINE_NODE_FACTORY(HTMLMapElement) diff --git a/third_party/WebKit/Source/core/html/HTMLMarqueeElement.cpp b/third_party/WebKit/Source/core/html/HTMLMarqueeElement.cpp index bacf86638f80f9..d8cd66d373128e 100644 --- a/third_party/WebKit/Source/core/html/HTMLMarqueeElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLMarqueeElement.cpp @@ -49,7 +49,7 @@ namespace blink { inline HTMLMarqueeElement::HTMLMarqueeElement(Document& document) : HTMLElement(HTMLNames::marqueeTag, document) { - UseCounter::Count(document, UseCounter::kHTMLMarqueeElement); + UseCounter::Count(document, WebFeature::kHTMLMarqueeElement); } HTMLMarqueeElement* HTMLMarqueeElement::Create(Document& document) { diff --git a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp index 661ba469924bd7..02d3af4effb516 100644 --- a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp @@ -518,7 +518,7 @@ HTMLMediaElement::HTMLMediaElement(const QualifiedName& tag_name, SetHasCustomStyleCallbacks(); AddElementToDocumentMap(this, &document); - UseCounter::Count(document, UseCounter::kHTMLMediaElement); + UseCounter::Count(document, WebFeature::kHTMLMediaElement); } HTMLMediaElement::~HTMLMediaElement() { @@ -623,11 +623,11 @@ void HTMLMediaElement::ParseAttribute( } } else if (name == controlsAttr) { UseCounter::Count(GetDocument(), - UseCounter::kHTMLMediaElementControlsAttribute); + WebFeature::kHTMLMediaElementControlsAttribute); UpdateControlsVisibility(); } else if (name == controlslistAttr) { UseCounter::Count(GetDocument(), - UseCounter::kHTMLMediaElementControlsListAttribute); + WebFeature::kHTMLMediaElementControlsListAttribute); if (params.old_value != params.new_value) { controls_list_->DidUpdateAttributeValue(params.old_value, params.new_value); @@ -640,7 +640,7 @@ void HTMLMediaElement::ParseAttribute( // This attribute is an extension described in the Remote Playback API spec. // Please see: https://w3c.github.io/remote-playback UseCounter::Count(GetDocument(), - UseCounter::kDisableRemotePlaybackAttribute); + WebFeature::kDisableRemotePlaybackAttribute); if (params.old_value != params.new_value) { if (web_media_player_) { web_media_player_->RequestRemotePlaybackDisabled( @@ -674,7 +674,7 @@ Node::InsertionNotificationRequest HTMLMediaElement::InsertedInto( HTMLElement::InsertedInto(insertion_point); if (insertion_point->isConnected()) { - UseCounter::Count(GetDocument(), UseCounter::kHTMLMediaElementInDocument); + UseCounter::Count(GetDocument(), WebFeature::kHTMLMediaElementInDocument); if ((!getAttribute(srcAttr).IsEmpty() || src_object_) && network_state_ == kNetworkEmpty) { ignore_preload_none_ = false; @@ -920,7 +920,7 @@ void HTMLMediaElement::InvokeLoadAlgorithm() { // This is where that change would have an effect, and it is measured to // verify the assumption that it's a very rare situation. UseCounter::Count(GetDocument(), - UseCounter::kHTMLMediaElementLoadNetworkEmptyNotPaused); + WebFeature::kHTMLMediaElementLoadNetworkEmptyNotPaused); } // 7 - Set the playbackRate attribute to the value of the defaultPlaybackRate @@ -1779,7 +1779,7 @@ void HTMLMediaElement::SetReadyState(ReadyState state) { if (!jumped && initial_playback_position > 0) { UseCounter::Count(GetDocument(), - UseCounter::kHTMLMediaElementSeekToFragmentStart); + WebFeature::kHTMLMediaElementSeekToFragmentStart); Seek(initial_playback_position); jumped = true; } @@ -2177,7 +2177,7 @@ void HTMLMediaElement::setPreload(const AtomicString& preload) { WebMediaPlayer::Preload HTMLMediaElement::PreloadType() const { const AtomicString& preload = FastGetAttribute(preloadAttr); if (DeprecatedEqualIgnoringCase(preload, "none")) { - UseCounter::Count(GetDocument(), UseCounter::kHTMLMediaElementPreloadNone); + UseCounter::Count(GetDocument(), WebFeature::kHTMLMediaElementPreloadNone); return WebMediaPlayer::kPreloadNone; } @@ -2189,25 +2189,25 @@ WebMediaPlayer::Preload HTMLMediaElement::PreloadType() const { (current_src_.Protocol() != "blob" && current_src_.Protocol() != "data" && current_src_.Protocol() != "file")) { UseCounter::Count(GetDocument(), - UseCounter::kHTMLMediaElementPreloadForcedNone); + WebFeature::kHTMLMediaElementPreloadForcedNone); return WebMediaPlayer::kPreloadNone; } if (DeprecatedEqualIgnoringCase(preload, "metadata")) { UseCounter::Count(GetDocument(), - UseCounter::kHTMLMediaElementPreloadMetadata); + WebFeature::kHTMLMediaElementPreloadMetadata); return WebMediaPlayer::kPreloadMetaData; } // Force preload to 'metadata' on cellular connections. if (GetNetworkStateNotifier().IsCellularConnectionType()) { UseCounter::Count(GetDocument(), - UseCounter::kHTMLMediaElementPreloadForcedMetadata); + WebFeature::kHTMLMediaElementPreloadForcedMetadata); return WebMediaPlayer::kPreloadMetaData; } if (DeprecatedEqualIgnoringCase(preload, "auto")) { - UseCounter::Count(GetDocument(), UseCounter::kHTMLMediaElementPreloadAuto); + UseCounter::Count(GetDocument(), WebFeature::kHTMLMediaElementPreloadAuto); return WebMediaPlayer::kPreloadAuto; } @@ -2220,7 +2220,7 @@ WebMediaPlayer::Preload HTMLMediaElement::PreloadType() const { // TODO(foolip): Try to make "metadata" the default preload state: // https://crbug.com/310450 - UseCounter::Count(GetDocument(), UseCounter::kHTMLMediaElementPreloadDefault); + UseCounter::Count(GetDocument(), WebFeature::kHTMLMediaElementPreloadDefault); return WebMediaPlayer::kPreloadAuto; } @@ -2520,7 +2520,7 @@ void HTMLMediaElement::PlaybackProgressTimerFired(TimerBase*) { fragment_end_time_ = std::numeric_limits::quiet_NaN(); if (!paused_) { UseCounter::Count(GetDocument(), - UseCounter::kHTMLMediaElementPauseAtFragmentEnd); + WebFeature::kHTMLMediaElementPauseAtFragmentEnd); // changes paused to true and fires a simple event named pause at the // media element. PauseInternal(); @@ -3858,7 +3858,7 @@ void HTMLMediaElement::SetNetworkState(NetworkState state) { void HTMLMediaElement::VideoWillBeDrawnToCanvas() const { DCHECK(IsHTMLVideoElement()); - UseCounter::Count(GetDocument(), UseCounter::kVideoInCanvas); + UseCounter::Count(GetDocument(), WebFeature::kVideoInCanvas); autoplay_policy_->VideoWillBeDrawnToCanvas(); } diff --git a/third_party/WebKit/Source/core/html/HTMLMeterElement.cpp b/third_party/WebKit/Source/core/html/HTMLMeterElement.cpp index 3208dcee3b84a4..fd8b57db2ba2f4 100644 --- a/third_party/WebKit/Source/core/html/HTMLMeterElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLMeterElement.cpp @@ -37,7 +37,7 @@ using namespace HTMLNames; HTMLMeterElement::HTMLMeterElement(Document& document) : LabelableElement(meterTag, document) { - UseCounter::Count(document, UseCounter::kMeterElement); + UseCounter::Count(document, WebFeature::kMeterElement); } HTMLMeterElement::~HTMLMeterElement() {} @@ -52,11 +52,11 @@ LayoutObject* HTMLMeterElement::CreateLayoutObject(const ComputedStyle& style) { switch (style.Appearance()) { case kMeterPart: UseCounter::Count(GetDocument(), - UseCounter::kMeterElementWithMeterAppearance); + WebFeature::kMeterElementWithMeterAppearance); break; case kNoControlPart: UseCounter::Count(GetDocument(), - UseCounter::kMeterElementWithNoneAppearance); + WebFeature::kMeterElementWithNoneAppearance); break; default: break; diff --git a/third_party/WebKit/Source/core/html/HTMLOListElement.cpp b/third_party/WebKit/Source/core/html/HTMLOListElement.cpp index 0a0c69d8c5f1b2..abf84ba24f70c4 100644 --- a/third_party/WebKit/Source/core/html/HTMLOListElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLOListElement.cpp @@ -103,7 +103,7 @@ int HTMLOListElement::start() const { if (is_reversed_) { UseCounter::Count( GetDocument(), - UseCounter::kHTMLOListElementStartGetterReversedWithoutStartAttribute); + WebFeature::kHTMLOListElementStartGetterReversedWithoutStartAttribute); return ItemCount(); } diff --git a/third_party/WebKit/Source/core/html/HTMLPictureElement.cpp b/third_party/WebKit/Source/core/html/HTMLPictureElement.cpp index 2fcfdf12ec8517..52c474aae277c0 100644 --- a/third_party/WebKit/Source/core/html/HTMLPictureElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLPictureElement.cpp @@ -51,7 +51,7 @@ void HTMLPictureElement::AddListenerToSourceChildren() { Node::InsertionNotificationRequest HTMLPictureElement::InsertedInto( ContainerNode* insertion_point) { - UseCounter::Count(GetDocument(), UseCounter::kPicture); + UseCounter::Count(GetDocument(), WebFeature::kPicture); return HTMLElement::InsertedInto(insertion_point); } diff --git a/third_party/WebKit/Source/core/html/HTMLProgressElement.cpp b/third_party/WebKit/Source/core/html/HTMLProgressElement.cpp index 6dea51cde73ca6..bf29c2ba792e20 100644 --- a/third_party/WebKit/Source/core/html/HTMLProgressElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLProgressElement.cpp @@ -39,7 +39,7 @@ const double HTMLProgressElement::kInvalidPosition = -2; HTMLProgressElement::HTMLProgressElement(Document& document) : LabelableElement(progressTag, document), value_(nullptr) { - UseCounter::Count(document, UseCounter::kProgressElement); + UseCounter::Count(document, WebFeature::kProgressElement); } HTMLProgressElement::~HTMLProgressElement() {} @@ -54,11 +54,11 @@ LayoutObject* HTMLProgressElement::CreateLayoutObject( const ComputedStyle& style) { if (!style.HasAppearance()) { UseCounter::Count(GetDocument(), - UseCounter::kProgressElementWithNoneAppearance); + WebFeature::kProgressElementWithNoneAppearance); return LayoutObject::CreateObject(this, style); } UseCounter::Count(GetDocument(), - UseCounter::kProgressElementWithProgressBarAppearance); + WebFeature::kProgressElementWithProgressBarAppearance); return new LayoutProgress(this); } diff --git a/third_party/WebKit/Source/core/html/HTMLScriptElement.cpp b/third_party/WebKit/Source/core/html/HTMLScriptElement.cpp index fedf413458a827..48a21ca85a6fb4 100644 --- a/third_party/WebKit/Source/core/html/HTMLScriptElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLScriptElement.cpp @@ -101,7 +101,7 @@ Node::InsertionNotificationRequest HTMLScriptElement::InsertedInto( !Loader()->IsScriptTypeSupported( ScriptLoader::kDisallowLegacyTypeInTypeAttribute, script_type)) { UseCounter::Count(GetDocument(), - UseCounter::kScriptElementWithInvalidTypeHasSrc); + WebFeature::kScriptElementWithInvalidTypeHasSrc); } HTMLElement::InsertedInto(insertion_point); LogAddElementIfIsolatedWorldAndInDocument("script", srcAttr); diff --git a/third_party/WebKit/Source/core/html/HTMLShadowElement.cpp b/third_party/WebKit/Source/core/html/HTMLShadowElement.cpp index 2856c80454b79a..81787afcd831f2 100644 --- a/third_party/WebKit/Source/core/html/HTMLShadowElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLShadowElement.cpp @@ -42,7 +42,7 @@ class Document; inline HTMLShadowElement::HTMLShadowElement(Document& document) : InsertionPoint(HTMLNames::shadowTag, document) { - UseCounter::Count(document, UseCounter::kHTMLShadowElement); + UseCounter::Count(document, WebFeature::kHTMLShadowElement); } DEFINE_NODE_FACTORY(HTMLShadowElement) diff --git a/third_party/WebKit/Source/core/html/HTMLSlotElement.cpp b/third_party/WebKit/Source/core/html/HTMLSlotElement.cpp index 12eec94cb5b617..93039493f6cca3 100644 --- a/third_party/WebKit/Source/core/html/HTMLSlotElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLSlotElement.cpp @@ -49,7 +49,7 @@ using namespace HTMLNames; inline HTMLSlotElement::HTMLSlotElement(Document& document) : HTMLElement(slotTag, document) { - UseCounter::Count(document, UseCounter::kHTMLSlotElement); + UseCounter::Count(document, WebFeature::kHTMLSlotElement); SetHasCustomStyleCallbacks(); } diff --git a/third_party/WebKit/Source/core/html/HTMLTableCellElement.cpp b/third_party/WebKit/Source/core/html/HTMLTableCellElement.cpp index 2f619542e18491..89a91e532f5ad9 100644 --- a/third_party/WebKit/Source/core/html/HTMLTableCellElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLTableCellElement.cpp @@ -50,13 +50,13 @@ unsigned HTMLTableCellElement::colSpan() const { !ParseHTMLNonNegativeInteger(col_span_value, value)) return 1; // Counting for https://github.com/whatwg/html/issues/1198 - UseCounter::Count(GetDocument(), UseCounter::kHTMLTableCellElementColspan); + UseCounter::Count(GetDocument(), WebFeature::kHTMLTableCellElementColspan); if (value > 8190) { UseCounter::Count(GetDocument(), - UseCounter::kHTMLTableCellElementColspanGreaterThan8190); + WebFeature::kHTMLTableCellElementColspanGreaterThan8190); } else if (value > 1000) { UseCounter::Count(GetDocument(), - UseCounter::kHTMLTableCellElementColspanGreaterThan1000); + WebFeature::kHTMLTableCellElementColspanGreaterThan1000); } return std::max(1u, std::min(value, MaxColSpan())); } diff --git a/third_party/WebKit/Source/core/html/HTMLTableElement.cpp b/third_party/WebKit/Source/core/html/HTMLTableElement.cpp index d3853682e521a5..1f1b8df0d71f4a 100644 --- a/third_party/WebKit/Source/core/html/HTMLTableElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLTableElement.cpp @@ -319,7 +319,7 @@ void HTMLTableElement::CollectStyleForPresentationAttribute( if (!url.IsEmpty()) { UseCounter::Count( GetDocument(), - UseCounter::kHTMLTableElementPresentationAttributeBackground); + WebFeature::kHTMLTableElementPresentationAttributeBackground); CSSImageValue* image_value = CSSImageValue::Create(url, GetDocument().CompleteURL(url), Referrer(GetDocument().OutgoingReferrer(), diff --git a/third_party/WebKit/Source/core/html/HTMLTablePartElement.cpp b/third_party/WebKit/Source/core/html/HTMLTablePartElement.cpp index fbd48978bf91e9..eb3bb193cbf5e9 100644 --- a/third_party/WebKit/Source/core/html/HTMLTablePartElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLTablePartElement.cpp @@ -59,7 +59,7 @@ void HTMLTablePartElement::CollectStyleForPresentationAttribute( if (!url.IsEmpty()) { UseCounter::Count( GetDocument(), - UseCounter::kHTMLTableElementPresentationAttributeBackground); + WebFeature::kHTMLTableElementPresentationAttributeBackground); CSSImageValue* image_value = CSSImageValue::Create(url, GetDocument().CompleteURL(url), Referrer(GetDocument().OutgoingReferrer(), diff --git a/third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp b/third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp index e987b6e0e2ba09..7f5a19e926afa8 100644 --- a/third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp @@ -197,10 +197,10 @@ void HTMLTextAreaElement::ParseAttribute( } else if (name == accesskeyAttr) { // ignore for the moment } else if (name == maxlengthAttr) { - UseCounter::Count(GetDocument(), UseCounter::kTextAreaMaxLength); + UseCounter::Count(GetDocument(), WebFeature::kTextAreaMaxLength); SetNeedsValidityCheck(); } else if (name == minlengthAttr) { - UseCounter::Count(GetDocument(), UseCounter::kTextAreaMinLength); + UseCounter::Count(GetDocument(), WebFeature::kTextAreaMinLength); SetNeedsValidityCheck(); } else { TextControlElement::ParseAttribute(params); diff --git a/third_party/WebKit/Source/core/html/HTMLUnknownElement.cpp b/third_party/WebKit/Source/core/html/HTMLUnknownElement.cpp index 2af0d17c328e93..e6a6c4a81c3dc1 100644 --- a/third_party/WebKit/Source/core/html/HTMLUnknownElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLUnknownElement.cpp @@ -12,9 +12,9 @@ HTMLUnknownElement::HTMLUnknownElement(const QualifiedName& tag_name, Document& document) : HTMLElement(tag_name, document) { if (tag_name.LocalName() == "data") - UseCounter::Count(document, UseCounter::kDataElement); + UseCounter::Count(document, WebFeature::kDataElement); else if (tag_name.LocalName() == "time") - UseCounter::Count(document, UseCounter::kTimeElement); + UseCounter::Count(document, WebFeature::kTimeElement); } } // namespace blink diff --git a/third_party/WebKit/Source/core/html/HTMLViewSourceDocument.cpp b/third_party/WebKit/Source/core/html/HTMLViewSourceDocument.cpp index 1509cdec751746..469a3ca9682146 100644 --- a/third_party/WebKit/Source/core/html/HTMLViewSourceDocument.cpp +++ b/third_party/WebKit/Source/core/html/HTMLViewSourceDocument.cpp @@ -58,7 +58,7 @@ HTMLViewSourceDocument::HTMLViewSourceDocument(const DocumentInit& initializer, // FIXME: Why do view-source pages need to load in quirks mode? SetCompatibilityMode(kQuirksMode); LockCompatibilityMode(); - UseCounter::Count(*this, UseCounter::kViewSourceDocument); + UseCounter::Count(*this, WebFeature::kViewSourceDocument); } DocumentParser* HTMLViewSourceDocument::CreateParser() { diff --git a/third_party/WebKit/Source/core/html/ImageDocument.cpp b/third_party/WebKit/Source/core/html/ImageDocument.cpp index d9f766accee45f..b01b94c59eb827 100644 --- a/third_party/WebKit/Source/core/html/ImageDocument.cpp +++ b/third_party/WebKit/Source/core/html/ImageDocument.cpp @@ -212,9 +212,9 @@ ImageDocument::ImageDocument(const DocumentInit& initializer) : kDesktop) { SetCompatibilityMode(kQuirksMode); LockCompatibilityMode(); - UseCounter::Count(*this, UseCounter::kImageDocument); + UseCounter::Count(*this, WebFeature::kImageDocument); if (!IsInMainFrame()) - UseCounter::Count(*this, UseCounter::kImageDocumentInFrame); + UseCounter::Count(*this, WebFeature::kImageDocumentInFrame); } DocumentParser* ImageDocument::CreateParser() { diff --git a/third_party/WebKit/Source/core/html/PluginDocument.cpp b/third_party/WebKit/Source/core/html/PluginDocument.cpp index dc091db2d1ec99..da1de2316c77db 100644 --- a/third_party/WebKit/Source/core/html/PluginDocument.cpp +++ b/third_party/WebKit/Source/core/html/PluginDocument.cpp @@ -166,9 +166,9 @@ PluginDocument::PluginDocument(const DocumentInit& initializer) : HTMLDocument(initializer, kPluginDocumentClass) { SetCompatibilityMode(kQuirksMode); LockCompatibilityMode(); - UseCounter::Count(*this, UseCounter::kPluginDocument); + UseCounter::Count(*this, WebFeature::kPluginDocument); if (!IsInMainFrame()) - UseCounter::Count(*this, UseCounter::kPluginDocumentInFrame); + UseCounter::Count(*this, WebFeature::kPluginDocumentInFrame); } DocumentParser* PluginDocument::CreateParser() { diff --git a/third_party/WebKit/Source/core/html/TextControlElement.cpp b/third_party/WebKit/Source/core/html/TextControlElement.cpp index 082ff0bf6a1d38..a70ced7f90d83a 100644 --- a/third_party/WebKit/Source/core/html/TextControlElement.cpp +++ b/third_party/WebKit/Source/core/html/TextControlElement.cpp @@ -758,12 +758,12 @@ void TextControlElement::ScheduleSelectEvent() { void TextControlElement::ParseAttribute( const AttributeModificationParams& params) { if (params.name == autocapitalizeAttr) - UseCounter::Count(GetDocument(), UseCounter::kAutocapitalizeAttribute); + UseCounter::Count(GetDocument(), WebFeature::kAutocapitalizeAttribute); if (params.name == placeholderAttr) { UpdatePlaceholderText(); UpdatePlaceholderVisibility(); - UseCounter::Count(GetDocument(), UseCounter::kPlaceholderAttribute); + UseCounter::Count(GetDocument(), WebFeature::kPlaceholderAttribute); } else { HTMLFormControlElementWithState::ParseAttribute(params); } diff --git a/third_party/WebKit/Source/core/html/TextDocument.cpp b/third_party/WebKit/Source/core/html/TextDocument.cpp index a52fcd288d4cd6..4be2ce867605fa 100644 --- a/third_party/WebKit/Source/core/html/TextDocument.cpp +++ b/third_party/WebKit/Source/core/html/TextDocument.cpp @@ -32,9 +32,9 @@ TextDocument::TextDocument(const DocumentInit& initializer) : HTMLDocument(initializer) { SetCompatibilityMode(kQuirksMode); LockCompatibilityMode(); - UseCounter::Count(*this, UseCounter::kTextDocument); + UseCounter::Count(*this, WebFeature::kTextDocument); if (!IsInMainFrame()) - UseCounter::Count(*this, UseCounter::kTextDocumentInFrame); + UseCounter::Count(*this, WebFeature::kTextDocumentInFrame); } DocumentParser* TextDocument::CreateParser() { diff --git a/third_party/WebKit/Source/core/html/canvas/ImageElementBase.cpp b/third_party/WebKit/Source/core/html/canvas/ImageElementBase.cpp index 0cd2059c0ccbed..0c5ff9922a21c4 100644 --- a/third_party/WebKit/Source/core/html/canvas/ImageElementBase.cpp +++ b/third_party/WebKit/Source/core/html/canvas/ImageElementBase.cpp @@ -41,7 +41,7 @@ PassRefPtr ImageElementBase::GetSourceImageForCanvas( RefPtr source_image; if (CachedImage()->GetImage()->IsSVGImage()) { - UseCounter::Count(GetElement().GetDocument(), UseCounter::kSVGInCanvas2D); + UseCounter::Count(GetElement().GetDocument(), WebFeature::kSVGInCanvas2D); SVGImage* svg_image = ToSVGImage(CachedImage()->GetImage()); IntSize image_size = RoundedIntSize(svg_image->ConcreteObjectSize(default_object_size)); diff --git a/third_party/WebKit/Source/core/html/forms/BaseCheckableInputType.cpp b/third_party/WebKit/Source/core/html/forms/BaseCheckableInputType.cpp index 613522e5564e7a..30b6a5dd035dda 100644 --- a/third_party/WebKit/Source/core/html/forms/BaseCheckableInputType.cpp +++ b/third_party/WebKit/Source/core/html/forms/BaseCheckableInputType.cpp @@ -112,7 +112,7 @@ void BaseCheckableInputType::SetValue(const String& sanitized_value, void BaseCheckableInputType::ReadingChecked() const { if (is_in_click_handler_) { UseCounter::Count(GetElement().GetDocument(), - UseCounter::kReadingCheckedInClickHandler); + WebFeature::kReadingCheckedInClickHandler); } } diff --git a/third_party/WebKit/Source/core/html/forms/ColorInputType.cpp b/third_party/WebKit/Source/core/html/forms/ColorInputType.cpp index 3d204c9a38e341..ad59b110a9e1d4 100644 --- a/third_party/WebKit/Source/core/html/forms/ColorInputType.cpp +++ b/third_party/WebKit/Source/core/html/forms/ColorInputType.cpp @@ -98,7 +98,7 @@ InputType::ValueMode ColorInputType::GetValueMode() const { } void ColorInputType::CountUsage() { - CountUsageIfVisible(UseCounter::kInputTypeColor); + CountUsageIfVisible(WebFeature::kInputTypeColor); } const AtomicString& ColorInputType::FormControlType() const { diff --git a/third_party/WebKit/Source/core/html/forms/DateInputType.cpp b/third_party/WebKit/Source/core/html/forms/DateInputType.cpp index 96132e4fed330c..c359b3a9347bd7 100644 --- a/third_party/WebKit/Source/core/html/forms/DateInputType.cpp +++ b/third_party/WebKit/Source/core/html/forms/DateInputType.cpp @@ -55,7 +55,7 @@ InputType* DateInputType::Create(HTMLInputElement& element) { } void DateInputType::CountUsage() { - CountUsageIfVisible(UseCounter::kInputTypeDate); + CountUsageIfVisible(WebFeature::kInputTypeDate); } const AtomicString& DateInputType::FormControlType() const { diff --git a/third_party/WebKit/Source/core/html/forms/DateTimeLocalInputType.cpp b/third_party/WebKit/Source/core/html/forms/DateTimeLocalInputType.cpp index 6f678efdaffb37..3aea2fc79453b2 100644 --- a/third_party/WebKit/Source/core/html/forms/DateTimeLocalInputType.cpp +++ b/third_party/WebKit/Source/core/html/forms/DateTimeLocalInputType.cpp @@ -53,7 +53,7 @@ InputType* DateTimeLocalInputType::Create(HTMLInputElement& element) { } void DateTimeLocalInputType::CountUsage() { - CountUsageIfVisible(UseCounter::kInputTypeDateTimeLocal); + CountUsageIfVisible(WebFeature::kInputTypeDateTimeLocal); } const AtomicString& DateTimeLocalInputType::FormControlType() const { diff --git a/third_party/WebKit/Source/core/html/forms/EmailInputType.cpp b/third_party/WebKit/Source/core/html/forms/EmailInputType.cpp index ed6b8b08cfb349..ea60079f373d09 100644 --- a/third_party/WebKit/Source/core/html/forms/EmailInputType.cpp +++ b/third_party/WebKit/Source/core/html/forms/EmailInputType.cpp @@ -163,14 +163,14 @@ InputType* EmailInputType::Create(HTMLInputElement& element) { } void EmailInputType::CountUsage() { - CountUsageIfVisible(UseCounter::kInputTypeEmail); + CountUsageIfVisible(WebFeature::kInputTypeEmail); bool has_max_length = GetElement().FastHasAttribute(HTMLNames::maxlengthAttr); if (has_max_length) - CountUsageIfVisible(UseCounter::kInputTypeEmailMaxLength); + CountUsageIfVisible(WebFeature::kInputTypeEmailMaxLength); if (GetElement().Multiple()) { - CountUsageIfVisible(UseCounter::kInputTypeEmailMultiple); + CountUsageIfVisible(WebFeature::kInputTypeEmailMultiple); if (has_max_length) - CountUsageIfVisible(UseCounter::kInputTypeEmailMultipleMaxLength); + CountUsageIfVisible(WebFeature::kInputTypeEmailMultipleMaxLength); } } diff --git a/third_party/WebKit/Source/core/html/forms/FileInputType.cpp b/third_party/WebKit/Source/core/html/forms/FileInputType.cpp index 9b9f2c5d9640a3..5c8f22481a12c7 100644 --- a/third_party/WebKit/Source/core/html/forms/FileInputType.cpp +++ b/third_party/WebKit/Source/core/html/forms/FileInputType.cpp @@ -252,9 +252,9 @@ FileList* FileInputType::CreateFileList( void FileInputType::CountUsage() { Document* document = &GetElement().GetDocument(); if (document->IsSecureContext()) - UseCounter::Count(*document, UseCounter::kInputTypeFileInsecureOrigin); + UseCounter::Count(*document, WebFeature::kInputTypeFileInsecureOrigin); else - UseCounter::Count(*document, UseCounter::kInputTypeFileSecureOrigin); + UseCounter::Count(*document, WebFeature::kInputTypeFileSecureOrigin); } void FileInputType::CreateShadowSubtree() { diff --git a/third_party/WebKit/Source/core/html/forms/InputType.cpp b/third_party/WebKit/Source/core/html/forms/InputType.cpp index 5f1912e55467fc..f7825322ba5b1a 100644 --- a/third_party/WebKit/Source/core/html/forms/InputType.cpp +++ b/third_party/WebKit/Source/core/html/forms/InputType.cpp @@ -872,7 +872,7 @@ void InputType::StepUpFromLayoutObject(int n) { IGNORE_EXCEPTION_FOR_TESTING); } -void InputType::CountUsageIfVisible(UseCounter::Feature feature) const { +void InputType::CountUsageIfVisible(WebFeature feature) const { if (const ComputedStyle* style = GetElement().GetComputedStyle()) { if (style->Visibility() != EVisibility::kHidden) UseCounter::Count(GetElement().GetDocument(), feature); diff --git a/third_party/WebKit/Source/core/html/forms/InputType.h b/third_party/WebKit/Source/core/html/forms/InputType.h index 8831cfff4c22c3..6e731b2516ca6f 100644 --- a/third_party/WebKit/Source/core/html/forms/InputType.h +++ b/third_party/WebKit/Source/core/html/forms/InputType.h @@ -235,7 +235,7 @@ class CORE_EXPORT InputType : public GarbageCollectedFinalized { ChromeClient* GetChromeClient() const; Locale& GetLocale() const; Decimal ParseToNumberOrNaN(const String&) const; - void CountUsageIfVisible(UseCounter::Feature) const; + void CountUsageIfVisible(WebFeature) const; // Derive the step base, following the HTML algorithm steps. Decimal FindStepBase(const Decimal&) const; diff --git a/third_party/WebKit/Source/core/html/forms/MonthInputType.cpp b/third_party/WebKit/Source/core/html/forms/MonthInputType.cpp index 5966b5001fb5e9..18bd56a55d40ea 100644 --- a/third_party/WebKit/Source/core/html/forms/MonthInputType.cpp +++ b/third_party/WebKit/Source/core/html/forms/MonthInputType.cpp @@ -54,7 +54,7 @@ InputType* MonthInputType::Create(HTMLInputElement& element) { } void MonthInputType::CountUsage() { - CountUsageIfVisible(UseCounter::kInputTypeMonth); + CountUsageIfVisible(WebFeature::kInputTypeMonth); } const AtomicString& MonthInputType::FormControlType() const { diff --git a/third_party/WebKit/Source/core/html/forms/NumberInputType.cpp b/third_party/WebKit/Source/core/html/forms/NumberInputType.cpp index 4c9a12e1991de3..7395a929b0215d 100644 --- a/third_party/WebKit/Source/core/html/forms/NumberInputType.cpp +++ b/third_party/WebKit/Source/core/html/forms/NumberInputType.cpp @@ -98,7 +98,7 @@ InputType* NumberInputType::Create(HTMLInputElement& element) { } void NumberInputType::CountUsage() { - CountUsageIfVisible(UseCounter::kInputTypeNumber); + CountUsageIfVisible(WebFeature::kInputTypeNumber); } const AtomicString& NumberInputType::FormControlType() const { diff --git a/third_party/WebKit/Source/core/html/forms/PasswordInputType.cpp b/third_party/WebKit/Source/core/html/forms/PasswordInputType.cpp index 26936289bbb437..95b85d5a1988e7 100644 --- a/third_party/WebKit/Source/core/html/forms/PasswordInputType.cpp +++ b/third_party/WebKit/Source/core/html/forms/PasswordInputType.cpp @@ -48,9 +48,9 @@ InputType* PasswordInputType::Create(HTMLInputElement& element) { } void PasswordInputType::CountUsage() { - CountUsageIfVisible(UseCounter::kInputTypePassword); + CountUsageIfVisible(WebFeature::kInputTypePassword); if (GetElement().FastHasAttribute(HTMLNames::maxlengthAttr)) - CountUsageIfVisible(UseCounter::kInputTypePasswordMaxLength); + CountUsageIfVisible(WebFeature::kInputTypePasswordMaxLength); } const AtomicString& PasswordInputType::FormControlType() const { diff --git a/third_party/WebKit/Source/core/html/forms/RangeInputType.cpp b/third_party/WebKit/Source/core/html/forms/RangeInputType.cpp index 711e0ad00d22d1..9d531289b6834c 100644 --- a/third_party/WebKit/Source/core/html/forms/RangeInputType.cpp +++ b/third_party/WebKit/Source/core/html/forms/RangeInputType.cpp @@ -92,11 +92,11 @@ InputType::ValueMode RangeInputType::GetValueMode() const { } void RangeInputType::CountUsage() { - CountUsageIfVisible(UseCounter::kInputTypeRange); + CountUsageIfVisible(WebFeature::kInputTypeRange); if (const ComputedStyle* style = GetElement().GetComputedStyle()) { if (style->Appearance() == kSliderVerticalPart) { UseCounter::Count(GetElement().GetDocument(), - UseCounter::kInputTypeRangeVerticalAppearance); + WebFeature::kInputTypeRangeVerticalAppearance); } } } diff --git a/third_party/WebKit/Source/core/html/forms/SearchInputType.cpp b/third_party/WebKit/Source/core/html/forms/SearchInputType.cpp index d382084e11c781..dd33e286991d5e 100644 --- a/third_party/WebKit/Source/core/html/forms/SearchInputType.cpp +++ b/third_party/WebKit/Source/core/html/forms/SearchInputType.cpp @@ -57,7 +57,7 @@ InputType* SearchInputType::Create(HTMLInputElement& element) { } void SearchInputType::CountUsage() { - CountUsageIfVisible(UseCounter::kInputTypeSearch); + CountUsageIfVisible(WebFeature::kInputTypeSearch); } LayoutObject* SearchInputType::CreateLayoutObject(const ComputedStyle&) const { diff --git a/third_party/WebKit/Source/core/html/forms/SubmitInputType.cpp b/third_party/WebKit/Source/core/html/forms/SubmitInputType.cpp index f5e6cb4a99ab38..207bb10e1b6e69 100644 --- a/third_party/WebKit/Source/core/html/forms/SubmitInputType.cpp +++ b/third_party/WebKit/Source/core/html/forms/SubmitInputType.cpp @@ -41,7 +41,7 @@ namespace blink { InputType* SubmitInputType::Create(HTMLInputElement& element) { - UseCounter::Count(element.GetDocument(), UseCounter::kInputTypeSubmit); + UseCounter::Count(element.GetDocument(), WebFeature::kInputTypeSubmit); return new SubmitInputType(element); } @@ -81,7 +81,7 @@ bool SubmitInputType::IsTextButton() const { void SubmitInputType::ValueAttributeChanged() { UseCounter::Count(GetElement().GetDocument(), - UseCounter::kInputTypeSubmitWithValue); + WebFeature::kInputTypeSubmitWithValue); BaseButtonInputType::ValueAttributeChanged(); } diff --git a/third_party/WebKit/Source/core/html/forms/TelephoneInputType.cpp b/third_party/WebKit/Source/core/html/forms/TelephoneInputType.cpp index a8a0dbb881f80a..13e9fdb72d9ff1 100644 --- a/third_party/WebKit/Source/core/html/forms/TelephoneInputType.cpp +++ b/third_party/WebKit/Source/core/html/forms/TelephoneInputType.cpp @@ -39,7 +39,7 @@ InputType* TelephoneInputType::Create(HTMLInputElement& element) { } void TelephoneInputType::CountUsage() { - CountUsageIfVisible(UseCounter::kInputTypeTel); + CountUsageIfVisible(WebFeature::kInputTypeTel); } const AtomicString& TelephoneInputType::FormControlType() const { diff --git a/third_party/WebKit/Source/core/html/forms/TextInputType.cpp b/third_party/WebKit/Source/core/html/forms/TextInputType.cpp index 141837cdec7439..003b27c75a8af4 100644 --- a/third_party/WebKit/Source/core/html/forms/TextInputType.cpp +++ b/third_party/WebKit/Source/core/html/forms/TextInputType.cpp @@ -42,14 +42,14 @@ InputType* TextInputType::Create(HTMLInputElement& element) { } void TextInputType::CountUsage() { - CountUsageIfVisible(UseCounter::kInputTypeText); + CountUsageIfVisible(WebFeature::kInputTypeText); if (GetElement().FastHasAttribute(maxlengthAttr)) - CountUsageIfVisible(UseCounter::kInputTypeTextMaxLength); + CountUsageIfVisible(WebFeature::kInputTypeTextMaxLength); const AtomicString& type = GetElement().FastGetAttribute(typeAttr); if (DeprecatedEqualIgnoringCase(type, InputTypeNames::datetime)) - CountUsageIfVisible(UseCounter::kInputTypeDateTimeFallback); + CountUsageIfVisible(WebFeature::kInputTypeDateTimeFallback); else if (DeprecatedEqualIgnoringCase(type, InputTypeNames::week)) - CountUsageIfVisible(UseCounter::kInputTypeWeekFallback); + CountUsageIfVisible(WebFeature::kInputTypeWeekFallback); } const AtomicString& TextInputType::FormControlType() const { diff --git a/third_party/WebKit/Source/core/html/forms/TimeInputType.cpp b/third_party/WebKit/Source/core/html/forms/TimeInputType.cpp index 68a5484121bf03..0dfb36fdb3d894 100644 --- a/third_party/WebKit/Source/core/html/forms/TimeInputType.cpp +++ b/third_party/WebKit/Source/core/html/forms/TimeInputType.cpp @@ -59,7 +59,7 @@ InputType* TimeInputType::Create(HTMLInputElement& element) { } void TimeInputType::CountUsage() { - CountUsageIfVisible(UseCounter::kInputTypeTime); + CountUsageIfVisible(WebFeature::kInputTypeTime); } const AtomicString& TimeInputType::FormControlType() const { diff --git a/third_party/WebKit/Source/core/html/forms/URLInputType.cpp b/third_party/WebKit/Source/core/html/forms/URLInputType.cpp index 4cd40d05e25a8c..d47e95e95123f2 100644 --- a/third_party/WebKit/Source/core/html/forms/URLInputType.cpp +++ b/third_party/WebKit/Source/core/html/forms/URLInputType.cpp @@ -42,7 +42,7 @@ InputType* URLInputType::Create(HTMLInputElement& element) { } void URLInputType::CountUsage() { - CountUsageIfVisible(UseCounter::kInputTypeURL); + CountUsageIfVisible(WebFeature::kInputTypeURL); } const AtomicString& URLInputType::FormControlType() const { diff --git a/third_party/WebKit/Source/core/html/forms/WeekInputType.cpp b/third_party/WebKit/Source/core/html/forms/WeekInputType.cpp index 7a3a9594796cbe..6b7c211a0b8a87 100644 --- a/third_party/WebKit/Source/core/html/forms/WeekInputType.cpp +++ b/third_party/WebKit/Source/core/html/forms/WeekInputType.cpp @@ -52,7 +52,7 @@ InputType* WeekInputType::Create(HTMLInputElement& element) { } void WeekInputType::CountUsage() { - CountUsageIfVisible(UseCounter::kInputTypeWeek); + CountUsageIfVisible(WebFeature::kInputTypeWeek); } const AtomicString& WeekInputType::FormControlType() const { diff --git a/third_party/WebKit/Source/core/html/imports/HTMLImportChild.cpp b/third_party/WebKit/Source/core/html/imports/HTMLImportChild.cpp index e87afcc4408d34..4e2258efed3ba8 100644 --- a/third_party/WebKit/Source/core/html/imports/HTMLImportChild.cpp +++ b/third_party/WebKit/Source/core/html/imports/HTMLImportChild.cpp @@ -80,7 +80,7 @@ void HTMLImportChild::DidFinishLoading() { StateWillChange(); if (GetDocument() && GetDocument()->GetStyleEngine().HasStyleSheets()) { UseCounter::Count(Root()->GetDocument(), - UseCounter::kHTMLImportsHasStyleSheets); + WebFeature::kHTMLImportsHasStyleSheets); } V0CustomElement::DidFinishLoadingImport(*(Root()->GetDocument())); } diff --git a/third_party/WebKit/Source/core/html/imports/HTMLImportsController.cpp b/third_party/WebKit/Source/core/html/imports/HTMLImportsController.cpp index b57d36bbea4794..0aac3fafeaf6a8 100644 --- a/third_party/WebKit/Source/core/html/imports/HTMLImportsController.cpp +++ b/third_party/WebKit/Source/core/html/imports/HTMLImportsController.cpp @@ -43,7 +43,7 @@ namespace blink { HTMLImportsController::HTMLImportsController(Document& master) : root_(HTMLImportTreeRoot::Create(&master)) { - UseCounter::Count(master, UseCounter::kHTMLImports); + UseCounter::Count(master, WebFeature::kHTMLImports); } void HTMLImportsController::Dispose() { @@ -77,7 +77,7 @@ HTMLImportChild* HTMLImportsController::CreateChild( : HTMLImport::kAsync; if (mode == HTMLImport::kAsync) { UseCounter::Count(Root()->GetDocument(), - UseCounter::kHTMLImportsAsyncAttribute); + WebFeature::kHTMLImportsAsyncAttribute); } HTMLImportChild* child = new HTMLImportChild(url, loader, mode); diff --git a/third_party/WebKit/Source/core/html/media/AutoplayUmaHelper.cpp b/third_party/WebKit/Source/core/html/media/AutoplayUmaHelper.cpp index 9c7197b9df08d9..4bc1ec70c1c298 100644 --- a/third_party/WebKit/Source/core/html/media/AutoplayUmaHelper.cpp +++ b/third_party/WebKit/Source/core/html/media/AutoplayUmaHelper.cpp @@ -262,7 +262,7 @@ void AutoplayUmaHelper::RecordAutoplayUnmuteStatus( void AutoplayUmaHelper::VideoWillBeDrawnToCanvas() { if (HasSource() && !IsVisible()) { UseCounter::Count(element_->GetDocument(), - UseCounter::kHiddenAutoplayedVideoInCanvas); + WebFeature::kHiddenAutoplayedVideoInCanvas); } } diff --git a/third_party/WebKit/Source/core/html/media/MediaDocument.cpp b/third_party/WebKit/Source/core/html/media/MediaDocument.cpp index 4aa5b78c3380b8..3e85538adac9f1 100644 --- a/third_party/WebKit/Source/core/html/media/MediaDocument.cpp +++ b/third_party/WebKit/Source/core/html/media/MediaDocument.cpp @@ -265,9 +265,9 @@ MediaDocument::MediaDocument(const DocumentInit& initializer) : HTMLDocument(initializer, kMediaDocumentClass) { SetCompatibilityMode(kQuirksMode); LockCompatibilityMode(); - UseCounter::Count(*this, UseCounter::kMediaDocument); + UseCounter::Count(*this, WebFeature::kMediaDocument); if (!IsInMainFrame()) - UseCounter::Count(*this, UseCounter::kMediaDocumentInFrame); + UseCounter::Count(*this, WebFeature::kMediaDocumentInFrame); } DocumentParser* MediaDocument::CreateParser() { diff --git a/third_party/WebKit/Source/core/html/parser/HTMLSrcsetParser.cpp b/third_party/WebKit/Source/core/html/parser/HTMLSrcsetParser.cpp index 06e1ccecaa5fb6..9c23c3dee7b30f 100644 --- a/third_party/WebKit/Source/core/html/parser/HTMLSrcsetParser.cpp +++ b/third_party/WebKit/Source/core/html/parser/HTMLSrcsetParser.cpp @@ -322,7 +322,7 @@ static void ParseImageCandidatesFromSrcsetAttribute( // lists for each candidate. if (!ParseDescriptors(attribute, descriptor_tokens, result, document)) { if (document) { - UseCounter::Count(document, UseCounter::kSrcsetDroppedCandidate); + UseCounter::Count(document, WebFeature::kSrcsetDroppedCandidate); if (document->GetFrame()) document->GetFrame()->Console().AddMessage(ConsoleMessage::Create( kOtherMessageSource, kErrorMessageLevel, diff --git a/third_party/WebKit/Source/core/html/parser/HTMLTreeBuilder.cpp b/third_party/WebKit/Source/core/html/parser/HTMLTreeBuilder.cpp index 73eb573da7211e..d4254bd27769f2 100644 --- a/third_party/WebKit/Source/core/html/parser/HTMLTreeBuilder.cpp +++ b/third_party/WebKit/Source/core/html/parser/HTMLTreeBuilder.cpp @@ -619,7 +619,7 @@ void HTMLTreeBuilder::ProcessStartTagForInBody(AtomicHTMLToken* token) { if (tree_.IsFormElementPointerNonNull() && !IsParsingTemplateContents()) { ParseError(token); UseCounter::Count(tree_.CurrentNode()->GetDocument(), - UseCounter::kHTMLParseErrorNestedForm); + WebFeature::kHTMLParseErrorNestedForm); return; } ProcessFakePEndTagIfPInButtonScope(); diff --git a/third_party/WebKit/Source/core/html/parser/XSSAuditor.cpp b/third_party/WebKit/Source/core/html/parser/XSSAuditor.cpp index cc7279125f0693..1348968c72723d 100644 --- a/third_party/WebKit/Source/core/html/parser/XSSAuditor.cpp +++ b/third_party/WebKit/Source/core/html/parser/XSSAuditor.cpp @@ -386,13 +386,13 @@ void XSSAuditor::Init(Document* document, header_value, error_details, error_position, report_url); if (xss_protection_header == kAllowReflectedXSS) - UseCounter::Count(*document, UseCounter::kXSSAuditorDisabled); + UseCounter::Count(*document, WebFeature::kXSSAuditorDisabled); else if (xss_protection_header == kFilterReflectedXSS) - UseCounter::Count(*document, UseCounter::kXSSAuditorEnabledFilter); + UseCounter::Count(*document, WebFeature::kXSSAuditorEnabledFilter); else if (xss_protection_header == kBlockReflectedXSS) - UseCounter::Count(*document, UseCounter::kXSSAuditorEnabledBlock); + UseCounter::Count(*document, WebFeature::kXSSAuditorEnabledBlock); else if (xss_protection_header == kReflectedXSSInvalid) - UseCounter::Count(*document, UseCounter::kXSSAuditorInvalid); + UseCounter::Count(*document, WebFeature::kXSSAuditorInvalid); did_send_valid_xss_protection_header_ = xss_protection_header != kReflectedXSSUnset && diff --git a/third_party/WebKit/Source/core/html/parser/XSSAuditorDelegate.cpp b/third_party/WebKit/Source/core/html/parser/XSSAuditorDelegate.cpp index 8dd4d6f022bcf4..60960ebbc171f4 100644 --- a/third_party/WebKit/Source/core/html/parser/XSSAuditorDelegate.cpp +++ b/third_party/WebKit/Source/core/html/parser/XSSAuditorDelegate.cpp @@ -105,8 +105,8 @@ void XSSAuditorDelegate::DidBlockScript(const XSSInfo& xss_info) { DCHECK(IsMainThread()); UseCounter::Count(document_, xss_info.did_block_entire_page_ - ? UseCounter::kXSSAuditorBlockedEntirePage - : UseCounter::kXSSAuditorBlockedScript); + ? WebFeature::kXSSAuditorBlockedEntirePage + : WebFeature::kXSSAuditorBlockedScript); document_->AddConsoleMessage(ConsoleMessage::Create( kJSMessageSource, kErrorMessageLevel, xss_info.BuildConsoleError())); diff --git a/third_party/WebKit/Source/core/html/track/vtt/VTTCue.cpp b/third_party/WebKit/Source/core/html/track/vtt/VTTCue.cpp index 4142018cd9caa1..de43cd7a6b5a63 100644 --- a/third_party/WebKit/Source/core/html/track/vtt/VTTCue.cpp +++ b/third_party/WebKit/Source/core/html/track/vtt/VTTCue.cpp @@ -244,7 +244,7 @@ VTTCue::VTTCue(Document& document, cue_background_box_(HTMLDivElement::Create(document)), snap_to_lines_(true), display_tree_should_change_(true) { - UseCounter::Count(document, UseCounter::kVTTCue); + UseCounter::Count(document, WebFeature::kVTTCue); cue_background_box_->SetShadowPseudoId(CueShadowPseudoId()); } @@ -636,7 +636,7 @@ VTTDisplayParameters VTTCue::CalculateDisplayParameters() const { display_parameters.direction = DetermineTextDirection(vtt_node_tree_.Get()); if (display_parameters.direction == CSSValueRtl) - UseCounter::Count(GetDocument(), UseCounter::kVTTCueRenderRtl); + UseCounter::Count(GetDocument(), WebFeature::kVTTCueRenderRtl); // Note: The 'text-align' property is also determined here so that // VTTCueBox::applyCSSProperties need not have access to a VTTCue. @@ -842,25 +842,25 @@ void VTTCue::RemoveDisplayTree(RemovalNotification removal_notification) { void VTTCue::UpdateDisplay(HTMLDivElement& container) { DCHECK(track() && track()->IsRendered() && IsActive()); - UseCounter::Count(GetDocument(), UseCounter::kVTTCueRender); + UseCounter::Count(GetDocument(), WebFeature::kVTTCueRender); if (writing_direction_ != kHorizontal) - UseCounter::Count(GetDocument(), UseCounter::kVTTCueRenderVertical); + UseCounter::Count(GetDocument(), WebFeature::kVTTCueRenderVertical); if (!snap_to_lines_) - UseCounter::Count(GetDocument(), UseCounter::kVTTCueRenderSnapToLinesFalse); + UseCounter::Count(GetDocument(), WebFeature::kVTTCueRenderSnapToLinesFalse); if (!LineIsAuto()) - UseCounter::Count(GetDocument(), UseCounter::kVTTCueRenderLineNotAuto); + UseCounter::Count(GetDocument(), WebFeature::kVTTCueRenderLineNotAuto); if (TextPositionIsAuto()) - UseCounter::Count(GetDocument(), UseCounter::kVTTCueRenderPositionNot50); + UseCounter::Count(GetDocument(), WebFeature::kVTTCueRenderPositionNot50); if (cue_size_ != 100) - UseCounter::Count(GetDocument(), UseCounter::kVTTCueRenderSizeNot100); + UseCounter::Count(GetDocument(), WebFeature::kVTTCueRenderSizeNot100); if (cue_alignment_ != kCenter) - UseCounter::Count(GetDocument(), UseCounter::kVTTCueRenderAlignNotCenter); + UseCounter::Count(GetDocument(), WebFeature::kVTTCueRenderAlignNotCenter); VTTCueBox* display_box = GetDisplayTree(); if (!region()) { diff --git a/third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.cpp b/third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.cpp index 5cd50acc8f7166..2acc65590e67c2 100644 --- a/third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.cpp +++ b/third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.cpp @@ -137,7 +137,7 @@ ScriptPromise ImageBitmapFactories::createImageBitmap( const ImageBitmapSourceUnion& bitmap_source, const ImageBitmapOptions& options, ExceptionState& exception_state) { - UseCounter::Feature feature = UseCounter::kCreateImageBitmap; + WebFeature feature = WebFeature::kCreateImageBitmap; UseCounter::Count(ExecutionContext::From(script_state), feature); ImageBitmapSource* bitmap_source_internal = ToImageBitmapSourceInternal( bitmap_source, exception_state, options, false); @@ -157,7 +157,7 @@ ScriptPromise ImageBitmapFactories::createImageBitmap( int sh, const ImageBitmapOptions& options, ExceptionState& exception_state) { - UseCounter::Feature feature = UseCounter::kCreateImageBitmap; + WebFeature feature = WebFeature::kCreateImageBitmap; UseCounter::Count(ExecutionContext::From(script_state), feature); ImageBitmapSource* bitmap_source_internal = ToImageBitmapSourceInternal( bitmap_source, exception_state, options, true); diff --git a/third_party/WebKit/Source/core/input/KeyboardEventManager.cpp b/third_party/WebKit/Source/core/input/KeyboardEventManager.cpp index 8c94ecd4e5c279..72639a80a099dc 100644 --- a/third_party/WebKit/Source/core/input/KeyboardEventManager.cpp +++ b/third_party/WebKit/Source/core/input/KeyboardEventManager.cpp @@ -63,7 +63,7 @@ bool MapKeyCodeForScroll(int key_code, WebInputEvent::Modifiers modifiers, ScrollDirection* scroll_direction, ScrollGranularity* scroll_granularity, - UseCounter::Feature* scroll_use_uma) { + WebFeature* scroll_use_uma) { if (modifiers & WebInputEvent::kShiftKey || modifiers & WebInputEvent::kMetaKey) return false; @@ -90,42 +90,42 @@ bool MapKeyCodeForScroll(int key_code, case VKEY_LEFT: *scroll_direction = kScrollLeftIgnoringWritingMode; *scroll_granularity = kScrollByLine; - *scroll_use_uma = UseCounter::kScrollByKeyboardArrowKeys; + *scroll_use_uma = WebFeature::kScrollByKeyboardArrowKeys; break; case VKEY_RIGHT: *scroll_direction = kScrollRightIgnoringWritingMode; *scroll_granularity = kScrollByLine; - *scroll_use_uma = UseCounter::kScrollByKeyboardArrowKeys; + *scroll_use_uma = WebFeature::kScrollByKeyboardArrowKeys; break; case VKEY_UP: *scroll_direction = kScrollUpIgnoringWritingMode; *scroll_granularity = kScrollByLine; - *scroll_use_uma = UseCounter::kScrollByKeyboardArrowKeys; + *scroll_use_uma = WebFeature::kScrollByKeyboardArrowKeys; break; case VKEY_DOWN: *scroll_direction = kScrollDownIgnoringWritingMode; *scroll_granularity = kScrollByLine; - *scroll_use_uma = UseCounter::kScrollByKeyboardArrowKeys; + *scroll_use_uma = WebFeature::kScrollByKeyboardArrowKeys; break; case VKEY_HOME: *scroll_direction = kScrollUpIgnoringWritingMode; *scroll_granularity = kScrollByDocument; - *scroll_use_uma = UseCounter::kScrollByKeyboardHomeEndKeys; + *scroll_use_uma = WebFeature::kScrollByKeyboardHomeEndKeys; break; case VKEY_END: *scroll_direction = kScrollDownIgnoringWritingMode; *scroll_granularity = kScrollByDocument; - *scroll_use_uma = UseCounter::kScrollByKeyboardHomeEndKeys; + *scroll_use_uma = WebFeature::kScrollByKeyboardHomeEndKeys; break; case VKEY_PRIOR: // page up *scroll_direction = kScrollUpIgnoringWritingMode; *scroll_granularity = kScrollByPage; - *scroll_use_uma = UseCounter::kScrollByKeyboardPageUpDownKeys; + *scroll_use_uma = WebFeature::kScrollByKeyboardPageUpDownKeys; break; case VKEY_NEXT: // page down *scroll_direction = kScrollDownIgnoringWritingMode; *scroll_granularity = kScrollByPage; - *scroll_use_uma = UseCounter::kScrollByKeyboardPageUpDownKeys; + *scroll_use_uma = WebFeature::kScrollByKeyboardPageUpDownKeys; break; default: return false; @@ -332,7 +332,7 @@ void KeyboardEventManager::DefaultSpaceEventHandler( if (scroll_manager_->LogicalScroll(direction, kScrollByPage, nullptr, possible_focused_node)) { UseCounter::Count(frame_->GetDocument(), - UseCounter::kScrollByKeyboardSpacebarKey); + WebFeature::kScrollByKeyboardSpacebarKey); event->SetDefaultHandled(); return; } @@ -349,10 +349,10 @@ void KeyboardEventManager::DefaultBackspaceEventHandler(KeyboardEvent* event) { if (!frame_->GetEditor().Behavior().ShouldNavigateBackOnBackspace()) return; - UseCounter::Count(frame_->GetDocument(), UseCounter::kBackspaceNavigatedBack); + UseCounter::Count(frame_->GetDocument(), WebFeature::kBackspaceNavigatedBack); if (frame_->GetPage()->GetChromeClient().HadFormInteraction()) { UseCounter::Count(frame_->GetDocument(), - UseCounter::kBackspaceNavigatedBackAfterFormInteraction); + WebFeature::kBackspaceNavigatedBackAfterFormInteraction); } bool handled_event = frame_->Loader().Client()->NavigateBackForward( event->shiftKey() ? 1 : -1); @@ -383,7 +383,7 @@ void KeyboardEventManager::DefaultArrowEventHandler( ScrollDirection scroll_direction; ScrollGranularity scroll_granularity; - UseCounter::Feature scroll_use_uma; + WebFeature scroll_use_uma; if (!MapKeyCodeForScroll(event->keyCode(), event->GetModifiers(), &scroll_direction, &scroll_granularity, &scroll_use_uma)) diff --git a/third_party/WebKit/Source/core/input/PointerEventManager.cpp b/third_party/WebKit/Source/core/input/PointerEventManager.cpp index 2a2c776babdd4e..d18abbb46364a8 100644 --- a/third_party/WebKit/Source/core/input/PointerEventManager.cpp +++ b/third_party/WebKit/Source/core/input/PointerEventManager.cpp @@ -169,9 +169,9 @@ WebInputEventResult PointerEventManager::DispatchPointerEvent( return WebInputEventResult::kNotHandled; if (!check_for_listener || target->HasEventListeners(event_type)) { - UseCounter::Count(frame_, UseCounter::kPointerEventDispatch); + UseCounter::Count(frame_, WebFeature::kPointerEventDispatch); if (event_type == EventTypeNames::pointerdown) - UseCounter::Count(frame_, UseCounter::kPointerEventDispatchPointerDown); + UseCounter::Count(frame_, WebFeature::kPointerEventDispatchPointerDown); DCHECK(!dispatching_pointer_id_); AutoReset dispatch_holder(&dispatching_pointer_id_, pointer_id); @@ -674,11 +674,11 @@ void PointerEventManager::ElementRemoved(EventTarget* target) { void PointerEventManager::SetPointerCapture(int pointer_id, EventTarget* target) { - UseCounter::Count(frame_, UseCounter::kPointerEventSetCapture); + UseCounter::Count(frame_, WebFeature::kPointerEventSetCapture); if (pointer_event_factory_.IsActiveButtonsState(pointer_id)) { if (pointer_id != dispatching_pointer_id_) { UseCounter::Count(frame_, - UseCounter::kPointerEventSetCaptureOutsideDispatch); + WebFeature::kPointerEventSetCaptureOutsideDispatch); } pending_pointer_capture_target_.Set(pointer_id, target); } diff --git a/third_party/WebKit/Source/core/input/ScrollManager.cpp b/third_party/WebKit/Source/core/input/ScrollManager.cpp index 4f6ef4d4dcddb4..309d87caa37ee1 100644 --- a/third_party/WebKit/Source/core/input/ScrollManager.cpp +++ b/third_party/WebKit/Source/core/input/ScrollManager.cpp @@ -328,9 +328,9 @@ WebInputEventResult ScrollManager::HandleGestureScrollBegin( CustomizedScroll(*scroll_gesture_handling_node_.Get(), *scroll_state); if (gesture_event.source_device == kWebGestureDeviceTouchscreen) - UseCounter::Count(frame_->GetDocument(), UseCounter::kScrollByTouch); + UseCounter::Count(frame_->GetDocument(), WebFeature::kScrollByTouch); else - UseCounter::Count(frame_->GetDocument(), UseCounter::kScrollByWheel); + UseCounter::Count(frame_->GetDocument(), WebFeature::kScrollByWheel); return WebInputEventResult::kHandledSystem; } diff --git a/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp b/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp index 316c302813b50f..476208fca2f92c 100644 --- a/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp @@ -4392,7 +4392,7 @@ LayoutMultiColumnFlowThread* LayoutBlockFlow::CreateMultiColumnFlowThread( StyleRef()); case kPagedFlowThread: // Paged overflow is currently done using the multicol implementation. - UseCounter::Count(GetDocument(), UseCounter::kCSSOverflowPaged); + UseCounter::Count(GetDocument(), WebFeature::kCSSOverflowPaged); return LayoutPagedFlowThread::CreateAnonymous(GetDocument(), StyleRef()); default: NOTREACHED(); diff --git a/third_party/WebKit/Source/core/layout/LayoutDeprecatedFlexibleBox.cpp b/third_party/WebKit/Source/core/layout/LayoutDeprecatedFlexibleBox.cpp index d187b809724a0b..08dc8f79b9149b 100644 --- a/third_party/WebKit/Source/core/layout/LayoutDeprecatedFlexibleBox.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutDeprecatedFlexibleBox.cpp @@ -270,13 +270,13 @@ LayoutDeprecatedFlexibleBox::LayoutDeprecatedFlexibleBox(Element& element) if (!IsAnonymous()) { const KURL& url = GetDocument().Url(); if (url.ProtocolIs("chrome")) { - UseCounter::Count(GetDocument(), UseCounter::kDeprecatedFlexboxChrome); + UseCounter::Count(GetDocument(), WebFeature::kDeprecatedFlexboxChrome); } else if (url.ProtocolIs("chrome-extension")) { UseCounter::Count(GetDocument(), - UseCounter::kDeprecatedFlexboxChromeExtension); + WebFeature::kDeprecatedFlexboxChromeExtension); } else { UseCounter::Count(GetDocument(), - UseCounter::kDeprecatedFlexboxWebContent); + WebFeature::kDeprecatedFlexboxWebContent); } } } @@ -1089,7 +1089,7 @@ void LayoutDeprecatedFlexibleBox::LayoutVerticalBox(bool relayout_children) { void LayoutDeprecatedFlexibleBox::ApplyLineClamp(FlexBoxIterator& iterator, bool relayout_children) { - UseCounter::Count(GetDocument(), UseCounter::kLineClamp); + UseCounter::Count(GetDocument(), WebFeature::kLineClamp); int max_line_count = 0; for (LayoutBox* child = iterator.First(); child; child = iterator.Next()) { diff --git a/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp b/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp index b433763c01e6c8..5e7869019ee142 100644 --- a/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp @@ -73,7 +73,7 @@ LayoutFlexibleBox::LayoutFlexibleBox(Element* element) in_layout_(false) { DCHECK(!ChildrenInline()); if (!IsAnonymous()) - UseCounter::Count(GetDocument(), UseCounter::kCSSFlexibleBox); + UseCounter::Count(GetDocument(), WebFeature::kCSSFlexibleBox); } LayoutFlexibleBox::~LayoutFlexibleBox() {} @@ -164,7 +164,7 @@ float LayoutFlexibleBox::CountIntrinsicSizeForAlgorithmChange( if (previous_max_content_flex_fraction != -1 && max_content_flex_fraction != previous_max_content_flex_fraction) { UseCounter::Count(GetDocument(), - UseCounter::kFlexboxIntrinsicSizeAlgorithmIsDifferent); + WebFeature::kFlexboxIntrinsicSizeAlgorithmIsDifferent); } return max_content_flex_fraction; } @@ -926,7 +926,7 @@ LayoutUnit LayoutFlexibleBox::ComputeInnerFlexBaseSizeForChild( child.ClearOverrideSize(); if (child.IsImage() || child.IsVideo() || child.IsCanvas()) - UseCounter::Count(GetDocument(), UseCounter::kAspectRatioFlexItem); + UseCounter::Count(GetDocument(), WebFeature::kAspectRatioFlexItem); Length flex_basis = FlexBasisForChild(child); if (MainAxisLengthIsDefinite(child, flex_basis)) diff --git a/third_party/WebKit/Source/core/layout/LayoutGrid.cpp b/third_party/WebKit/Source/core/layout/LayoutGrid.cpp index 99bc7c61467af9..e267e1068b1d7a 100644 --- a/third_party/WebKit/Source/core/layout/LayoutGrid.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutGrid.cpp @@ -58,7 +58,7 @@ LayoutGrid::LayoutGrid(Element* element) : LayoutBlock(element), grid_(this), track_sizing_algorithm_(this, grid_) { DCHECK(!ChildrenInline()); if (!IsAnonymous()) - UseCounter::Count(GetDocument(), UseCounter::kCSSGridLayout); + UseCounter::Count(GetDocument(), WebFeature::kCSSGridLayout); } LayoutGrid::~LayoutGrid() {} diff --git a/third_party/WebKit/Source/core/layout/LayoutImage.cpp b/third_party/WebKit/Source/core/layout/LayoutImage.cpp index 19761d5ce558c7..7a2c66fdcbdc81 100644 --- a/third_party/WebKit/Source/core/layout/LayoutImage.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutImage.cpp @@ -110,7 +110,7 @@ void LayoutImage::ImageChanged(WrappedImagePtr new_image, const IntRect* rect) { if (image_resource_->CachedImage() && image_resource_->CachedImage()->HasDevicePixelRatioHeaderValue()) { UseCounter::Count(&(View()->GetFrameView()->GetFrame()), - UseCounter::kClientHintsContentDPR); + WebFeature::kClientHintsContentDPR); image_device_pixel_ratio_ = 1 / image_resource_->CachedImage()->DevicePixelRatioHeaderValue(); } diff --git a/third_party/WebKit/Source/core/layout/LayoutRuby.cpp b/third_party/WebKit/Source/core/layout/LayoutRuby.cpp index 47baca1fa05423..eeebdab5bc7d58 100644 --- a/third_party/WebKit/Source/core/layout/LayoutRuby.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutRuby.cpp @@ -53,7 +53,7 @@ static inline LayoutRubyRun* FindRubyRunParent(LayoutObject* child) { LayoutRubyAsInline::LayoutRubyAsInline(Element* element) : LayoutInline(element) { - UseCounter::Count(GetDocument(), UseCounter::kRenderRuby); + UseCounter::Count(GetDocument(), WebFeature::kRenderRuby); } LayoutRubyAsInline::~LayoutRubyAsInline() {} @@ -118,7 +118,7 @@ void LayoutRubyAsInline::RemoveChild(LayoutObject* child) { LayoutRubyAsBlock::LayoutRubyAsBlock(Element* element) : LayoutBlockFlow(element) { - UseCounter::Count(GetDocument(), UseCounter::kRenderRuby); + UseCounter::Count(GetDocument(), WebFeature::kRenderRuby); } LayoutRubyAsBlock::~LayoutRubyAsBlock() {} diff --git a/third_party/WebKit/Source/core/layout/LayoutScrollbarPart.cpp b/third_party/WebKit/Source/core/layout/LayoutScrollbarPart.cpp index 9f31edd3609555..baed2fc6088e15 100644 --- a/third_party/WebKit/Source/core/layout/LayoutScrollbarPart.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutScrollbarPart.cpp @@ -59,21 +59,21 @@ static void RecordScrollbarPartStats(Document& document, ScrollbarPart part) { case kBackButtonEndPart: case kForwardButtonEndPart: UseCounter::Count(document, - UseCounter::kCSSSelectorPseudoScrollbarButton); + WebFeature::kCSSSelectorPseudoScrollbarButton); break; case kBackTrackPart: case kForwardTrackPart: UseCounter::Count(document, - UseCounter::kCSSSelectorPseudoScrollbarTrackPiece); + WebFeature::kCSSSelectorPseudoScrollbarTrackPiece); break; case kThumbPart: - UseCounter::Count(document, UseCounter::kCSSSelectorPseudoScrollbarThumb); + UseCounter::Count(document, WebFeature::kCSSSelectorPseudoScrollbarThumb); break; case kTrackBGPart: - UseCounter::Count(document, UseCounter::kCSSSelectorPseudoScrollbarTrack); + UseCounter::Count(document, WebFeature::kCSSSelectorPseudoScrollbarTrack); break; case kScrollbarBGPart: - UseCounter::Count(document, UseCounter::kCSSSelectorPseudoScrollbar); + UseCounter::Count(document, WebFeature::kCSSSelectorPseudoScrollbar); break; case kNoPart: case kAllParts: diff --git a/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp b/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp index 37406594bee3cb..8a1142cdb14577 100644 --- a/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp @@ -969,14 +969,14 @@ void LayoutTableSection::UpdateLayout() { if (!Table()->HasSameDirectionAs(row)) { UseCounter::Count(GetDocument(), - UseCounter::kTableRowDirectionDifferentFromTable); + WebFeature::kTableRowDirectionDifferentFromTable); } } } if (!Table()->HasSameDirectionAs(this)) { UseCounter::Count(GetDocument(), - UseCounter::kTableSectionDirectionDifferentFromTable); + WebFeature::kTableSectionDirectionDifferentFromTable); } ClearNeedsLayout(); diff --git a/third_party/WebKit/Source/core/layout/ScrollAnchor.cpp b/third_party/WebKit/Source/core/layout/ScrollAnchor.cpp index 460e73486f6b71..e37a881a9475b7 100644 --- a/third_party/WebKit/Source/core/layout/ScrollAnchor.cpp +++ b/third_party/WebKit/Source/core/layout/ScrollAnchor.cpp @@ -318,7 +318,7 @@ void ScrollAnchor::Adjust() { ("Layout.ScrollAnchor.AdjustedScrollOffset", 2)); adjusted_offset_histogram.Count(1); UseCounter::Count(ScrollerLayoutBox(scroller_)->GetDocument(), - UseCounter::kScrollAnchored); + WebFeature::kScrollAnchored); } void ScrollAnchor::ClearSelf() { diff --git a/third_party/WebKit/Source/core/layout/TextAutosizer.cpp b/third_party/WebKit/Source/core/layout/TextAutosizer.cpp index 6f0e83dde2e6cb..873eaf3b79237b 100644 --- a/third_party/WebKit/Source/core/layout/TextAutosizer.cpp +++ b/third_party/WebKit/Source/core/layout/TextAutosizer.cpp @@ -474,7 +474,7 @@ float TextAutosizer::Inflate(LayoutObject* parent, } if (page_info_.has_autosized_) - UseCounter::Count(*document_, UseCounter::kTextAutosizing); + UseCounter::Count(*document_, WebFeature::kTextAutosizing); return multiplier; } diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp index 57ae9acccb01a7..1a3d28244c284d 100644 --- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp +++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp @@ -845,7 +845,7 @@ bool CompositedLayerMapping::UpdateGraphicsLayerConfiguration() { if (style.Preserves3D() && style.HasOpacity() && owning_layer_.Has3DTransformedDescendant()) { UseCounter::Count(layout_object.GetDocument(), - UseCounter::kOpacityWithPreserve3DQuirk); + WebFeature::kOpacityWithPreserve3DQuirk); } return layer_config_changed; diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositingInputsUpdater.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositingInputsUpdater.cpp index 5e542159b5cf63..6e67bcdc96d359 100644 --- a/third_party/WebKit/Source/core/layout/compositing/CompositingInputsUpdater.cpp +++ b/third_party/WebKit/Source/core/layout/compositing/CompositingInputsUpdater.cpp @@ -191,7 +191,7 @@ void CompositingInputsUpdater::UpdateRecursive(PaintLayer* layer, if (layer_is_fixed_position && properties.filter_ancestor && layer->FixedToViewport()) { UseCounter::Count(layer->GetLayoutObject().GetDocument(), - UseCounter::kViewportFixedPositionUnderFilter); + WebFeature::kViewportFixedPositionUnderFilter); } properties.nearest_fixed_position_layer = diff --git a/third_party/WebKit/Source/core/loader/BaseFetchContext.cpp b/third_party/WebKit/Source/core/loader/BaseFetchContext.cpp index 88790bb500168a..8c45629f669351 100644 --- a/third_party/WebKit/Source/core/loader/BaseFetchContext.cpp +++ b/third_party/WebKit/Source/core/loader/BaseFetchContext.cpp @@ -252,7 +252,7 @@ ResourceRequestBlockedReason BaseFetchContext::CanRequestInternal( if (SchemeRegistry::ShouldTreatURLSchemeAsLegacy(url.Protocol()) && !SchemeRegistry::ShouldTreatURLSchemeAsLegacy( embedding_origin->Protocol())) { - CountDeprecation(UseCounter::kLegacyProtocolEmbeddedAsSubresource); + CountDeprecation(WebFeature::kLegacyProtocolEmbeddedAsSubresource); // TODO(mkwst): Enabled by default in M59. Drop the runtime-enabled check // in M60: https://www.chromestatus.com/feature/5709390967472128 @@ -264,7 +264,7 @@ ResourceRequestBlockedReason BaseFetchContext::CanRequestInternal( resource_request.GetRequestContext() != WebURLRequest::kRequestContextXMLHttpRequest) { CountDeprecation( - UseCounter::kRequestedSubresourceWithEmbeddedCredentials); + WebFeature::kRequestedSubresourceWithEmbeddedCredentials); // TODO(mkwst): Remove the runtime-enabled check in M59: // https://www.chromestatus.com/feature/5669008342777856 if (RuntimeEnabledFeatures::BlockCredentialedSubresourcesEnabled()) @@ -280,7 +280,7 @@ ResourceRequestBlockedReason BaseFetchContext::CanRequestInternal( return ResourceRequestBlockedReason::kMixedContent; if (url.PotentiallyDanglingMarkup() && url.ProtocolIsInHTTPFamily()) { - CountDeprecation(UseCounter::kCanRequestURLHTTPContainingNewline); + CountDeprecation(WebFeature::kCanRequestURLHTTPContainingNewline); if (RuntimeEnabledFeatures::RestrictCanRequestURLCharacterSetEnabled()) return ResourceRequestBlockedReason::kOther; } diff --git a/third_party/WebKit/Source/core/loader/BaseFetchContext.h b/third_party/WebKit/Source/core/loader/BaseFetchContext.h index 3bd5eeb0a81517..22e820350f264e 100644 --- a/third_party/WebKit/Source/core/loader/BaseFetchContext.h +++ b/third_party/WebKit/Source/core/loader/BaseFetchContext.h @@ -68,8 +68,8 @@ class CORE_EXPORT BaseFetchContext : public FetchContext { ResourceRequestBlockedReason) const = 0; virtual bool ShouldBypassMainWorldCSP() const = 0; virtual bool IsSVGImageChromeClient() const = 0; - virtual void CountUsage(UseCounter::Feature) const = 0; - virtual void CountDeprecation(UseCounter::Feature) const = 0; + virtual void CountUsage(WebFeature) const = 0; + virtual void CountDeprecation(WebFeature) const = 0; virtual bool ShouldBlockFetchByMixedContentCheck( const ResourceRequest&, const KURL&, diff --git a/third_party/WebKit/Source/core/loader/BaseFetchContextTest.cpp b/third_party/WebKit/Source/core/loader/BaseFetchContextTest.cpp index 154fb794e7b588..1dde4469bd98b3 100644 --- a/third_party/WebKit/Source/core/loader/BaseFetchContextTest.cpp +++ b/third_party/WebKit/Source/core/loader/BaseFetchContextTest.cpp @@ -57,8 +57,8 @@ class MockBaseFetchContext final : public BaseFetchContext { ResourceRequestBlockedReason) const override {} bool ShouldBypassMainWorldCSP() const override { return false; } bool IsSVGImageChromeClient() const override { return false; } - void CountUsage(UseCounter::Feature) const override {} - void CountDeprecation(UseCounter::Feature) const override {} + void CountUsage(WebFeature) const override {} + void CountDeprecation(WebFeature) const override {} bool ShouldBlockFetchByMixedContentCheck( const ResourceRequest&, const KURL&, diff --git a/third_party/WebKit/Source/core/loader/DocumentLoader.cpp b/third_party/WebKit/Source/core/loader/DocumentLoader.cpp index 3d67eac736b6a3..09aa0d7ff3862c 100644 --- a/third_party/WebKit/Source/core/loader/DocumentLoader.cpp +++ b/third_party/WebKit/Source/core/loader/DocumentLoader.cpp @@ -614,7 +614,7 @@ void DocumentLoader::ResponseReceived( DCHECK(!frame_->GetPage()->Suspended()); if (response.DidServiceWorkerNavigationPreload()) - UseCounter::Count(frame_, UseCounter::kServiceWorkerNavigationPreload); + UseCounter::Count(frame_, WebFeature::kServiceWorkerNavigationPreload); response_ = response; if (IsArchiveMIMEType(response_.MimeType()) && @@ -942,7 +942,7 @@ void DocumentLoader::DidInstallNewDocument(Document* document) { String referrer_policy_header = response_.HttpHeaderField(HTTPNames::Referrer_Policy); if (!referrer_policy_header.IsNull()) { - UseCounter::Count(*document, UseCounter::kReferrerPolicyHeader); + UseCounter::Count(*document, WebFeature::kReferrerPolicyHeader); document->ParseAndSetReferrerPolicy(referrer_policy_header); } diff --git a/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp b/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp index 9884feea8e06e5..3eafdb78366726 100644 --- a/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp +++ b/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp @@ -821,7 +821,7 @@ void DocumentThreadableLoader::HandleResponse( if (response.WasFetchedViaServiceWorker()) { if (response.WasFetchedViaForeignFetch()) - loading_context_->RecordUseCount(UseCounter::kForeignFetchInterception); + loading_context_->RecordUseCount(WebFeature::kForeignFetchInterception); if (response.WasFallbackRequiredByServiceWorker()) { // At this point we must have m_fallbackRequestForServiceWorker. (For // SharedWorker the request won't be CORS or CORS-with-preflight, diff --git a/third_party/WebKit/Source/core/loader/FormSubmission.cpp b/third_party/WebKit/Source/core/loader/FormSubmission.cpp index e85c2a803e0ee1..b54218b28057c6 100644 --- a/third_party/WebKit/Source/core/loader/FormSubmission.cpp +++ b/third_party/WebKit/Source/core/loader/FormSubmission.cpp @@ -200,7 +200,7 @@ FormSubmission* FormSubmission::Create(HTMLFormElement* form, if (document.GetInsecureRequestPolicy() & kUpgradeInsecureRequests && action_url.ProtocolIs("http")) { UseCounter::Count(document, - UseCounter::kUpgradeInsecureRequestsUpgradedRequest); + WebFeature::kUpgradeInsecureRequestsUpgradedRequest); action_url.SetProtocol("https"); if (action_url.Port() == 80) action_url.SetPort(443); diff --git a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp index 92e76b7a0daddc..1b32305a90057f 100644 --- a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp +++ b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp @@ -780,11 +780,11 @@ bool FrameFetchContext::IsSVGImageChromeClient() const { return GetFrame()->GetChromeClient().IsSVGImageChromeClient(); } -void FrameFetchContext::CountUsage(UseCounter::Feature feature) const { +void FrameFetchContext::CountUsage(WebFeature feature) const { UseCounter::Count(GetFrame(), feature); } -void FrameFetchContext::CountDeprecation(UseCounter::Feature feature) const { +void FrameFetchContext::CountDeprecation(WebFeature feature) const { Deprecation::CountDeprecation(GetFrame(), feature); } diff --git a/third_party/WebKit/Source/core/loader/FrameFetchContext.h b/third_party/WebKit/Source/core/loader/FrameFetchContext.h index 493770d9e29488..3b76424b73d70b 100644 --- a/third_party/WebKit/Source/core/loader/FrameFetchContext.h +++ b/third_party/WebKit/Source/core/loader/FrameFetchContext.h @@ -184,8 +184,8 @@ class CORE_EXPORT FrameFetchContext final : public BaseFetchContext { ResourceRequestBlockedReason) const override; bool ShouldBypassMainWorldCSP() const override; bool IsSVGImageChromeClient() const override; - void CountUsage(UseCounter::Feature) const override; - void CountDeprecation(UseCounter::Feature) const override; + void CountUsage(WebFeature) const override; + void CountDeprecation(WebFeature) const override; bool ShouldBlockFetchByMixedContentCheck( const ResourceRequest&, const KURL&, diff --git a/third_party/WebKit/Source/core/loader/FrameLoader.cpp b/third_party/WebKit/Source/core/loader/FrameLoader.cpp index 1d33f70814e506..aecce715aafa88 100644 --- a/third_party/WebKit/Source/core/loader/FrameLoader.cpp +++ b/third_party/WebKit/Source/core/loader/FrameLoader.cpp @@ -135,7 +135,7 @@ static void CheckForLegacyProtocolInSubresource( return; } Deprecation::CountDeprecation( - document, UseCounter::kLegacyProtocolEmbeddedAsSubresource); + document, WebFeature::kLegacyProtocolEmbeddedAsSubresource); } static NavigationPolicy MaybeCheckCSP( @@ -370,7 +370,7 @@ void FrameLoader::ReplaceDocumentWhileExecutingJavaScriptURL( DocumentLoader* document_loader(frame_->GetDocument()->Loader()); UseCounter::Count(*frame_->GetDocument(), - UseCounter::kReplaceDocumentViaJavaScriptURL); + WebFeature::kReplaceDocumentViaJavaScriptURL); // Prepare a DocumentInit before clearing the frame, because it may need to // inherit an aliased security context. @@ -1273,7 +1273,7 @@ NavigationPolicy FrameLoader::ShouldContinueForNavigationPolicy( if (request.Url().PotentiallyDanglingMarkup() && request.Url().ProtocolIsInHTTPFamily()) { Deprecation::CountDeprecation( - frame_, UseCounter::kCanRequestURLHTTPContainingNewline); + frame_, WebFeature::kCanRequestURLHTTPContainingNewline); if (RuntimeEnabledFeatures::RestrictCanRequestURLCharacterSetEnabled()) return kNavigationPolicyIgnore; } @@ -1625,7 +1625,7 @@ void FrameLoader::UpgradeInsecureRequest(ResourceRequest& resource_request, (!url.Host().IsNull() && relevant_navigation_set->Contains(url.Host().Impl()->GetHash()))) { UseCounter::Count(document, - UseCounter::kUpgradeInsecureRequestsUpgradedRequest); + WebFeature::kUpgradeInsecureRequestsUpgradedRequest); url.SetProtocol("https"); if (url.Port() == 80) url.SetPort(443); diff --git a/third_party/WebKit/Source/core/loader/HttpEquiv.cpp b/third_party/WebKit/Source/core/loader/HttpEquiv.cpp index bb43aaf3482579..fbecc31d93f27d 100644 --- a/third_party/WebKit/Source/core/loader/HttpEquiv.cpp +++ b/third_party/WebKit/Source/core/loader/HttpEquiv.cpp @@ -91,7 +91,7 @@ void HttpEquiv::ProcessHttpEquivAcceptCH(Document& document, if (!document.GetFrame()) return; - UseCounter::Count(document, UseCounter::kClientHintsMetaAcceptCH); + UseCounter::Count(document, WebFeature::kClientHintsMetaAcceptCH); FrameClientHintsPreferencesContext hints_context(document.GetFrame()); document.GetClientHintsPreferences().UpdateFromAcceptClientHintsHeader( content, &hints_context); @@ -105,12 +105,12 @@ void HttpEquiv::ProcessHttpEquivDefaultStyle(Document& document, void HttpEquiv::ProcessHttpEquivRefresh(Document& document, const AtomicString& content, Element* element) { - UseCounter::Count(document, UseCounter::kMetaRefresh); + UseCounter::Count(document, WebFeature::kMetaRefresh); if (!document.GetContentSecurityPolicy()->AllowInlineScript( element, KURL(), "", OrdinalNumber(), "", SecurityViolationReportingPolicy::kSuppressReporting)) { UseCounter::Count(document, - UseCounter::kMetaRefreshWhenCSPBlocksInlineScript); + WebFeature::kMetaRefreshWhenCSPBlocksInlineScript); } document.MaybeHandleHttpRefresh(content, Document::kHttpRefreshFromMetaTag); @@ -124,12 +124,12 @@ void HttpEquiv::ProcessHttpEquivSetCookie(Document& document, if (!document.IsHTMLDocument()) return; - UseCounter::Count(document, UseCounter::kMetaSetCookie); + UseCounter::Count(document, WebFeature::kMetaSetCookie); if (!document.GetContentSecurityPolicy()->AllowInlineScript( element, KURL(), "", OrdinalNumber(), "", SecurityViolationReportingPolicy::kSuppressReporting)) { UseCounter::Count(document, - UseCounter::kMetaSetCookieWhenCSPBlocksInlineScript); + WebFeature::kMetaSetCookieWhenCSPBlocksInlineScript); } // Exception (for sandboxed documents) ignored. diff --git a/third_party/WebKit/Source/core/loader/LinkLoader.cpp b/third_party/WebKit/Source/core/loader/LinkLoader.cpp index f76101db597fd7..8843652db1b377 100644 --- a/third_party/WebKit/Source/core/loader/LinkLoader.cpp +++ b/third_party/WebKit/Source/core/loader/LinkLoader.cpp @@ -64,11 +64,11 @@ static unsigned PrerenderRelTypesFromRelAttribute( unsigned result = 0; if (rel_attribute.IsLinkPrerender()) { result |= kPrerenderRelTypePrerender; - UseCounter::Count(document, UseCounter::kLinkRelPrerender); + UseCounter::Count(document, WebFeature::kLinkRelPrerender); } if (rel_attribute.IsLinkNext()) { result |= kPrerenderRelTypeNext; - UseCounter::Count(document, UseCounter::kLinkRelNext); + UseCounter::Count(document, WebFeature::kLinkRelNext); } return result; @@ -154,9 +154,9 @@ static void DnsPrefetchIfNeeded( const NetworkHintsInterface& network_hints_interface, LinkCaller caller) { if (rel_attribute.IsDNSPrefetch()) { - UseCounter::Count(frame, UseCounter::kLinkRelDnsPrefetch); + UseCounter::Count(frame, WebFeature::kLinkRelDnsPrefetch); if (caller == kLinkCalledFromHeader) - UseCounter::Count(frame, UseCounter::kLinkHeaderDnsPrefetch); + UseCounter::Count(frame, WebFeature::kLinkHeaderDnsPrefetch); Settings* settings = frame ? frame->GetSettings() : nullptr; // FIXME: The href attribute of the link element can be in "//hostname" // form, and we shouldn't attempt to complete that as URL @@ -185,9 +185,9 @@ static void PreconnectIfNeeded( LinkCaller caller) { if (rel_attribute.IsPreconnect() && href.IsValid() && href.ProtocolIsInHTTPFamily()) { - UseCounter::Count(frame, UseCounter::kLinkRelPreconnect); + UseCounter::Count(frame, WebFeature::kLinkRelPreconnect); if (caller == kLinkCalledFromHeader) - UseCounter::Count(frame, UseCounter::kLinkHeaderPreconnect); + UseCounter::Count(frame, WebFeature::kLinkHeaderPreconnect); Settings* settings = frame ? frame->GetSettings() : nullptr; if (settings && settings->GetLogDnsPrefetchAndPreconnect()) { SendMessageToConsoleForPossiblyNullDocument( @@ -308,7 +308,7 @@ static Resource* PreloadIfNeeded(const LinkRelAttribute& rel_attribute, if (!document.Loader() || !rel_attribute.IsLinkPreload()) return nullptr; - UseCounter::Count(document, UseCounter::kLinkRelPreload); + UseCounter::Count(document, WebFeature::kLinkRelPreload); if (!href.IsValid() || href.IsEmpty()) { document.AddConsoleMessage(ConsoleMessage::Create( kOtherMessageSource, kWarningMessageLevel, @@ -332,7 +332,7 @@ static Resource* PreloadIfNeeded(const LinkRelAttribute& rel_attribute, return nullptr; } if (caller == kLinkCalledFromHeader) - UseCounter::Count(document, UseCounter::kLinkHeaderPreload); + UseCounter::Count(document, WebFeature::kLinkHeaderPreload); Optional resource_type = LinkLoader::GetResourceTypeFromAsAttribute(as); if (resource_type == WTF::nullopt) { @@ -384,7 +384,7 @@ static Resource* PrefetchIfNeeded(Document& document, CrossOriginAttributeValue cross_origin, ReferrerPolicy referrer_policy) { if (rel_attribute.IsLinkPrefetch() && href.IsValid() && document.GetFrame()) { - UseCounter::Count(document, UseCounter::kLinkRelPrefetch); + UseCounter::Count(document, WebFeature::kLinkRelPrefetch); ResourceRequest resource_request(document.CompleteURL(href)); if (referrer_policy != kReferrerPolicyDefault) { @@ -457,7 +457,7 @@ void LinkLoader::LoadLinksFromHeader( kReferrerPolicyDefault); } if (rel_attribute.IsServiceWorker()) { - UseCounter::Count(&frame, UseCounter::kLinkHeaderServiceWorker); + UseCounter::Count(&frame, WebFeature::kLinkHeaderServiceWorker); } // TODO(yoav): Add more supported headers as needed. } diff --git a/third_party/WebKit/Source/core/loader/MixedContentChecker.cpp b/third_party/WebKit/Source/core/loader/MixedContentChecker.cpp index 4cfa88c3cc98d7..00601ff8e6e46e 100644 --- a/third_party/WebKit/Source/core/loader/MixedContentChecker.cpp +++ b/third_party/WebKit/Source/core/loader/MixedContentChecker.cpp @@ -152,13 +152,13 @@ static void MeasureStricterVersionOfIsMixedContent(Frame& frame, if (origin->Protocol() != "https") { UseCounter::Count( source, - UseCounter::kMixedContentInNonHTTPSFrameThatRestrictsMixedContent); + WebFeature::kMixedContentInNonHTTPSFrameThatRestrictsMixedContent); } } else if (!SecurityOrigin::IsSecure(url) && SchemeRegistry::ShouldTreatURLSchemeAsSecure(origin->Protocol())) { UseCounter::Count( source, - UseCounter::kMixedContentInSecureFrameThatDoesNotRestrictMixedContent); + WebFeature::kMixedContentInSecureFrameThatDoesNotRestrictMixedContent); } } @@ -249,7 +249,7 @@ void MixedContentChecker::LogToConsoleAboutFetch( void MixedContentChecker::Count(Frame* frame, WebURLRequest::RequestContext request_context, const LocalFrame* source) { - UseCounter::Count(source, UseCounter::kMixedContentPresent); + UseCounter::Count(source, WebFeature::kMixedContentPresent); // Roll blockable content up into a single counter, count unblocked types // individually so we can determine when they can be safely moved to the @@ -259,35 +259,35 @@ void MixedContentChecker::Count(Frame* frame, request_context, frame->GetSettings()->GetStrictMixedContentCheckingForPlugin()); if (context_type == WebMixedContentContextType::kBlockable) { - UseCounter::Count(source, UseCounter::kMixedContentBlockable); + UseCounter::Count(source, WebFeature::kMixedContentBlockable); return; } - UseCounter::Feature feature; + WebFeature feature; switch (request_context) { case WebURLRequest::kRequestContextAudio: - feature = UseCounter::kMixedContentAudio; + feature = WebFeature::kMixedContentAudio; break; case WebURLRequest::kRequestContextDownload: - feature = UseCounter::kMixedContentDownload; + feature = WebFeature::kMixedContentDownload; break; case WebURLRequest::kRequestContextFavicon: - feature = UseCounter::kMixedContentFavicon; + feature = WebFeature::kMixedContentFavicon; break; case WebURLRequest::kRequestContextImage: - feature = UseCounter::kMixedContentImage; + feature = WebFeature::kMixedContentImage; break; case WebURLRequest::kRequestContextInternal: - feature = UseCounter::kMixedContentInternal; + feature = WebFeature::kMixedContentInternal; break; case WebURLRequest::kRequestContextPlugin: - feature = UseCounter::kMixedContentPlugin; + feature = WebFeature::kMixedContentPlugin; break; case WebURLRequest::kRequestContextPrefetch: - feature = UseCounter::kMixedContentPrefetch; + feature = WebFeature::kMixedContentPrefetch; break; case WebURLRequest::kRequestContextVideo: - feature = UseCounter::kMixedContentVideo; + feature = WebFeature::kMixedContentVideo; break; default: @@ -379,7 +379,7 @@ bool MixedContentChecker::ShouldBlockFetch( IsMixedContent(frame->GetSecurityContext()->GetSecurityOrigin(), url)) { UseCounter::Count(frame, - UseCounter::kBlockableMixedContentInSubframeBlocked); + WebFeature::kBlockableMixedContentInSubframeBlocked); allowed = false; break; } @@ -394,7 +394,7 @@ bool MixedContentChecker::ShouldBlockFetch( security_origin, url); if (allowed) { client->DidRunInsecureContent(security_origin, url); - UseCounter::Count(frame, UseCounter::kMixedContentBlockableAllowed); + UseCounter::Count(frame, WebFeature::kMixedContentBlockableAllowed); } break; } @@ -447,8 +447,8 @@ bool MixedContentChecker::ShouldBlockWebSocket( if (!mixed_frame) return false; - UseCounter::Count(frame, UseCounter::kMixedContentPresent); - UseCounter::Count(frame, UseCounter::kMixedContentWebSocket); + UseCounter::Count(frame, WebFeature::kMixedContentPresent); + UseCounter::Count(frame, WebFeature::kMixedContentWebSocket); if (ContentSecurityPolicy* policy = frame->GetSecurityContext()->GetContentSecurityPolicy()) { policy->ReportMixedContent(url, @@ -505,7 +505,7 @@ bool MixedContentChecker::IsMixedFormAction( if (!mixed_frame) return false; - UseCounter::Count(frame, UseCounter::kMixedContentPresent); + UseCounter::Count(frame, WebFeature::kMixedContentPresent); // Use the current local frame's client; the embedder doesn't distinguish // mixed content signals from different frames on the same page. @@ -535,7 +535,7 @@ void MixedContentChecker::CheckMixedPrivatePublic( if (NetworkUtils::IsReservedIPAddress(resource_ip_address) && frame->GetDocument()->AddressSpace() == kWebAddressSpacePublic) { UseCounter::Count(frame->GetDocument(), - UseCounter::kMixedContentPrivateHostnameInPublicHostname); + WebFeature::kMixedContentPrivateHostnameInPublicHostname); // We can simplify the IP checks here, as we've already verified that // |resourceIPAddress| is a reserved IP address, which means it's also a // valid IP address in a normalized form. @@ -543,8 +543,8 @@ void MixedContentChecker::CheckMixedPrivatePublic( resource_ip_address == "[::1]") { UseCounter::Count(frame->GetDocument(), frame->GetDocument()->IsSecureContext() - ? UseCounter::kLoopbackEmbeddedInSecureContext - : UseCounter::kLoopbackEmbeddedInNonSecureContext); + ? WebFeature::kLoopbackEmbeddedInSecureContext + : WebFeature::kLoopbackEmbeddedInNonSecureContext); } } } diff --git a/third_party/WebKit/Source/core/loader/ThreadableLoadingContext.cpp b/third_party/WebKit/Source/core/loader/ThreadableLoadingContext.cpp index 1f38c934a7826c..5b0f225cb1121f 100644 --- a/third_party/WebKit/Source/core/loader/ThreadableLoadingContext.cpp +++ b/third_party/WebKit/Source/core/loader/ThreadableLoadingContext.cpp @@ -56,7 +56,7 @@ class DocumentThreadableLoadingContext final : public ThreadableLoadingContext { return TaskRunnerHelper::Get(type, document_.Get()); } - void RecordUseCount(UseCounter::Feature feature) override { + void RecordUseCount(WebFeature feature) override { UseCounter::Count(document_.Get(), feature); } @@ -117,7 +117,7 @@ class WorkerThreadableLoadingContext : public ThreadableLoadingContext { return fetch_context_->GetTaskRunner(); } - void RecordUseCount(UseCounter::Feature feature) override { + void RecordUseCount(WebFeature feature) override { UseCounter::Count(worker_global_scope_, feature); } diff --git a/third_party/WebKit/Source/core/loader/ThreadableLoadingContext.h b/third_party/WebKit/Source/core/loader/ThreadableLoadingContext.h index 35549a90062bec..8ed27e921dc1aa 100644 --- a/third_party/WebKit/Source/core/loader/ThreadableLoadingContext.h +++ b/third_party/WebKit/Source/core/loader/ThreadableLoadingContext.h @@ -43,7 +43,7 @@ class CORE_EXPORT ThreadableLoadingContext virtual KURL FirstPartyForCookies() const = 0; virtual String UserAgent() const = 0; virtual RefPtr GetTaskRunner(TaskType) = 0; - virtual void RecordUseCount(UseCounter::Feature) = 0; + virtual void RecordUseCount(WebFeature) = 0; // TODO(kinuko): Try getting rid of dependency to Document. virtual Document* GetLoadingDocument() { return nullptr; } diff --git a/third_party/WebKit/Source/core/loader/WorkerFetchContext.cpp b/third_party/WebKit/Source/core/loader/WorkerFetchContext.cpp index 76deee5af9b6c7..9b8a99fea12ac0 100644 --- a/third_party/WebKit/Source/core/loader/WorkerFetchContext.cpp +++ b/third_party/WebKit/Source/core/loader/WorkerFetchContext.cpp @@ -134,11 +134,11 @@ bool WorkerFetchContext::IsSVGImageChromeClient() const { return false; } -void WorkerFetchContext::CountUsage(UseCounter::Feature feature) const { +void WorkerFetchContext::CountUsage(WebFeature feature) const { UseCounter::Count(global_scope_, feature); } -void WorkerFetchContext::CountDeprecation(UseCounter::Feature feature) const { +void WorkerFetchContext::CountDeprecation(WebFeature feature) const { Deprecation::CountDeprecation(global_scope_, feature); } diff --git a/third_party/WebKit/Source/core/loader/WorkerFetchContext.h b/third_party/WebKit/Source/core/loader/WorkerFetchContext.h index 54f5cb3891a5f5..1c29244f64e713 100644 --- a/third_party/WebKit/Source/core/loader/WorkerFetchContext.h +++ b/third_party/WebKit/Source/core/loader/WorkerFetchContext.h @@ -47,8 +47,8 @@ class WorkerFetchContext final : public BaseFetchContext { ResourceRequestBlockedReason) const override; bool ShouldBypassMainWorldCSP() const override; bool IsSVGImageChromeClient() const override; - void CountUsage(UseCounter::Feature) const override; - void CountDeprecation(UseCounter::Feature) const override; + void CountUsage(WebFeature) const override; + void CountDeprecation(WebFeature) const override; bool ShouldBlockFetchByMixedContentCheck( const ResourceRequest&, const KURL&, diff --git a/third_party/WebKit/Source/core/loader/appcache/ApplicationCache.cpp b/third_party/WebKit/Source/core/loader/appcache/ApplicationCache.cpp index ada5b3d7cffb00..d7252edb501cfe 100644 --- a/third_party/WebKit/Source/core/loader/appcache/ApplicationCache.cpp +++ b/third_party/WebKit/Source/core/loader/appcache/ApplicationCache.cpp @@ -129,10 +129,10 @@ void ApplicationCache::RecordAPIUseType() const { return; if (document->IsSecureContext()) { - UseCounter::Count(document, UseCounter::kApplicationCacheAPISecureOrigin); + UseCounter::Count(document, WebFeature::kApplicationCacheAPISecureOrigin); } else { Deprecation::CountDeprecation( - document, UseCounter::kApplicationCacheAPIInsecureOrigin); + document, WebFeature::kApplicationCacheAPIInsecureOrigin); HostsUsingFeatures::CountAnyWorld( *document, HostsUsingFeatures::Feature::kApplicationCacheAPIInsecureHost); diff --git a/third_party/WebKit/Source/core/loader/appcache/ApplicationCacheHost.cpp b/third_party/WebKit/Source/core/loader/appcache/ApplicationCacheHost.cpp index 54aa2d77664fc6..32577c3cbc55b8 100644 --- a/third_party/WebKit/Source/core/loader/appcache/ApplicationCacheHost.cpp +++ b/third_party/WebKit/Source/core/loader/appcache/ApplicationCacheHost.cpp @@ -142,14 +142,14 @@ void ApplicationCacheHost::SelectCacheWithManifest(const KURL& manifest_url) { } if (document->IsSecureContext()) { UseCounter::Count(document, - UseCounter::kApplicationCacheManifestSelectSecureOrigin); + WebFeature::kApplicationCacheManifestSelectSecureOrigin); UseCounter::CountCrossOriginIframe( - *document, UseCounter::kApplicationCacheManifestSelectSecureOrigin); + *document, WebFeature::kApplicationCacheManifestSelectSecureOrigin); } else { Deprecation::CountDeprecation( - document, UseCounter::kApplicationCacheManifestSelectInsecureOrigin); + document, WebFeature::kApplicationCacheManifestSelectInsecureOrigin); Deprecation::CountDeprecationCrossOriginIframe( - *document, UseCounter::kApplicationCacheManifestSelectInsecureOrigin); + *document, WebFeature::kApplicationCacheManifestSelectInsecureOrigin); HostsUsingFeatures::CountAnyWorld( *document, HostsUsingFeatures::Feature:: kApplicationCacheManifestSelectInsecureHost); diff --git a/third_party/WebKit/Source/core/loader/private/FrameClientHintsPreferencesContext.cpp b/third_party/WebKit/Source/core/loader/private/FrameClientHintsPreferencesContext.cpp index cca8ec2c09d099..1dbc12ceb9c17b 100644 --- a/third_party/WebKit/Source/core/loader/private/FrameClientHintsPreferencesContext.cpp +++ b/third_party/WebKit/Source/core/loader/private/FrameClientHintsPreferencesContext.cpp @@ -13,19 +13,19 @@ FrameClientHintsPreferencesContext::FrameClientHintsPreferencesContext( : frame_(frame) {} void FrameClientHintsPreferencesContext::CountClientHintsDeviceRAM() { - UseCounter::Count(frame_, UseCounter::kClientHintsDeviceRAM); + UseCounter::Count(frame_, WebFeature::kClientHintsDeviceRAM); } void FrameClientHintsPreferencesContext::CountClientHintsDPR() { - UseCounter::Count(frame_, UseCounter::kClientHintsDPR); + UseCounter::Count(frame_, WebFeature::kClientHintsDPR); } void FrameClientHintsPreferencesContext::CountClientHintsResourceWidth() { - UseCounter::Count(frame_, UseCounter::kClientHintsResourceWidth); + UseCounter::Count(frame_, WebFeature::kClientHintsResourceWidth); } void FrameClientHintsPreferencesContext::CountClientHintsViewportWidth() { - UseCounter::Count(frame_, UseCounter::kClientHintsViewportWidth); + UseCounter::Count(frame_, WebFeature::kClientHintsViewportWidth); } } // namespace blink diff --git a/third_party/WebKit/Source/core/page/AutoscrollController.cpp b/third_party/WebKit/Source/core/page/AutoscrollController.cpp index b3e6cdfc09345a..b0c6af1a9b17ad 100644 --- a/third_party/WebKit/Source/core/page/AutoscrollController.cpp +++ b/third_party/WebKit/Source/core/page/AutoscrollController.cpp @@ -193,7 +193,7 @@ void AutoscrollController::UpdateDragAndDrop(Node* drop_target_node, autoscroll_layout_object_ = scrollable; drag_and_drop_autoscroll_start_time_ = event_time; UseCounter::Count(autoscroll_layout_object_->GetFrame(), - UseCounter::kDragAndDropScrollStart); + WebFeature::kDragAndDropScrollStart); StartAutoscroll(); } else if (autoscroll_layout_object_ != scrollable) { drag_and_drop_autoscroll_start_time_ = event_time; @@ -243,7 +243,7 @@ void AutoscrollController::StartMiddleClickAutoscroll( did_latch_for_middle_click_autoscroll_ = false; UseCounter::Count(autoscroll_layout_object_->GetFrame(), - UseCounter::kMiddleClickAutoscrollStart); + WebFeature::kMiddleClickAutoscrollStart); StartAutoscroll(); } diff --git a/third_party/WebKit/Source/core/page/ChromeClient.cpp b/third_party/WebKit/Source/core/page/ChromeClient.cpp index 4b08bd771e7422..5cdc4a9428ed62 100644 --- a/third_party/WebKit/Source/core/page/ChromeClient.cpp +++ b/third_party/WebKit/Source/core/page/ChromeClient.cpp @@ -219,7 +219,7 @@ bool ChromeClient::Print(LocalFrame* frame) { } if (frame->GetDocument()->IsSandboxed(kSandboxModals)) { - UseCounter::Count(frame, UseCounter::kDialogInSandboxedContext); + UseCounter::Count(frame, WebFeature::kDialogInSandboxedContext); frame->Console().AddMessage(ConsoleMessage::Create( kSecurityMessageSource, kErrorMessageLevel, "Ignored call to 'print()'. The document is sandboxed, and the " diff --git a/third_party/WebKit/Source/core/page/CreateWindow.cpp b/third_party/WebKit/Source/core/page/CreateWindow.cpp index 88aa2ad87b0c61..6d027e75518e27 100644 --- a/third_party/WebKit/Source/core/page/CreateWindow.cpp +++ b/third_party/WebKit/Source/core/page/CreateWindow.cpp @@ -403,7 +403,7 @@ DOMWindow* CreateWindow(const String& url_string, ? KURL(kParsedURLString, g_empty_string) : first_frame.GetDocument()->CompleteURL(url_string); if (!completed_url.IsEmpty() && !completed_url.IsValid()) { - UseCounter::Count(active_frame, UseCounter::kWindowOpenWithInvalidURL); + UseCounter::Count(active_frame, WebFeature::kWindowOpenWithInvalidURL); exception_state.ThrowDOMException( kSyntaxError, "Unable to open a window with invalid URL '" + completed_url.GetString() + "'.\n"); diff --git a/third_party/WebKit/Source/core/page/FrameTree.cpp b/third_party/WebKit/Source/core/page/FrameTree.cpp index da809e9b0feb0c..d12d5c443e8b24 100644 --- a/third_party/WebKit/Source/core/page/FrameTree.cpp +++ b/third_party/WebKit/Source/core/page/FrameTree.cpp @@ -57,10 +57,10 @@ const AtomicString& FrameTree::GetName() const { : (Top().IsLocalFrame() ? ToLocalFrame(&Top()) : nullptr); if (frame) { UseCounter::Count(frame, - UseCounter::kCrossOriginMainFrameNulledNameAccessed); + WebFeature::kCrossOriginMainFrameNulledNameAccessed); if (!name_.IsEmpty()) { UseCounter::Count( - frame, UseCounter::kCrossOriginMainFrameNulledNonEmptyNameAccessed); + frame, WebFeature::kCrossOriginMainFrameNulledNonEmptyNameAccessed); } } } diff --git a/third_party/WebKit/Source/core/page/PointerLockController.cpp b/third_party/WebKit/Source/core/page/PointerLockController.cpp index 16a10efe1f38a6..a0667839778d3e 100644 --- a/third_party/WebKit/Source/core/page/PointerLockController.cpp +++ b/third_party/WebKit/Source/core/page/PointerLockController.cpp @@ -50,10 +50,10 @@ void PointerLockController::RequestPointerLock(Element* target) { } UseCounter::CountCrossOriginIframe( - target->GetDocument(), UseCounter::kElementRequestPointerLockIframe); + target->GetDocument(), WebFeature::kElementRequestPointerLockIframe); if (target->IsInShadowTree()) { UseCounter::Count(target->GetDocument(), - UseCounter::kElementRequestPointerLockInShadow); + WebFeature::kElementRequestPointerLockInShadow); } if (target->GetDocument().IsSandboxed(kSandboxPointerLock)) { diff --git a/third_party/WebKit/Source/core/paint/PaintInvalidationCapableScrollableArea.cpp b/third_party/WebKit/Source/core/paint/PaintInvalidationCapableScrollableArea.cpp index f226ccaec0c273..8eceda934950d9 100644 --- a/third_party/WebKit/Source/core/paint/PaintInvalidationCapableScrollableArea.cpp +++ b/third_party/WebKit/Source/core/paint/PaintInvalidationCapableScrollableArea.cpp @@ -241,7 +241,7 @@ void PaintInvalidationCapableScrollableArea:: void PaintInvalidationCapableScrollableArea::DidScrollWithScrollbar( ScrollbarPart part, ScrollbarOrientation orientation) { - UseCounter::Feature scrollbar_use_uma; + WebFeature scrollbar_use_uma; switch (part) { case kBackButtonStartPart: case kForwardButtonStartPart: @@ -249,21 +249,21 @@ void PaintInvalidationCapableScrollableArea::DidScrollWithScrollbar( case kForwardButtonEndPart: scrollbar_use_uma = (orientation == kVerticalScrollbar - ? UseCounter::kScrollbarUseVerticalScrollbarButton - : UseCounter::kScrollbarUseHorizontalScrollbarButton); + ? WebFeature::kScrollbarUseVerticalScrollbarButton + : WebFeature::kScrollbarUseHorizontalScrollbarButton); break; case kThumbPart: scrollbar_use_uma = (orientation == kVerticalScrollbar - ? UseCounter::kScrollbarUseVerticalScrollbarThumb - : UseCounter::kScrollbarUseHorizontalScrollbarThumb); + ? WebFeature::kScrollbarUseVerticalScrollbarThumb + : WebFeature::kScrollbarUseHorizontalScrollbarThumb); break; case kBackTrackPart: case kForwardTrackPart: scrollbar_use_uma = (orientation == kVerticalScrollbar - ? UseCounter::kScrollbarUseVerticalScrollbarTrack - : UseCounter::kScrollbarUseHorizontalScrollbarTrack); + ? WebFeature::kScrollbarUseVerticalScrollbarTrack + : WebFeature::kScrollbarUseHorizontalScrollbarTrack); break; default: return; diff --git a/third_party/WebKit/Source/core/paint/ThemePainter.cpp b/third_party/WebKit/Source/core/paint/ThemePainter.cpp index 40ba4fce4a51e8..84f85624012c39 100644 --- a/third_party/WebKit/Source/core/paint/ThemePainter.cpp +++ b/third_party/WebKit/Source/core/paint/ThemePainter.cpp @@ -70,19 +70,19 @@ bool ThemePainter::Paint(const LayoutObject& o, if (part == kButtonPart && o.GetNode()) { UseCounter::Count(o.GetDocument(), - UseCounter::kCSSValueAppearanceButtonRendered); + WebFeature::kCSSValueAppearanceButtonRendered); if (isHTMLAnchorElement(o.GetNode())) { UseCounter::Count(o.GetDocument(), - UseCounter::kCSSValueAppearanceButtonForAnchor); + WebFeature::kCSSValueAppearanceButtonForAnchor); } else if (isHTMLButtonElement(o.GetNode())) { UseCounter::Count(o.GetDocument(), - UseCounter::kCSSValueAppearanceButtonForButton); + WebFeature::kCSSValueAppearanceButtonForButton); } else if (isHTMLInputElement(o.GetNode()) && toHTMLInputElement(o.GetNode())->IsTextButton()) { // Text buttons (type=button, reset, submit) has // -webkit-appearance:push-button by default. UseCounter::Count(o.GetNode()->GetDocument(), - UseCounter::kCSSValueAppearanceButtonForOtherButtons); + WebFeature::kCSSValueAppearanceButtonForOtherButtons); } } @@ -178,16 +178,16 @@ bool ThemePainter::PaintBorderOnly(const LayoutObject& o, switch (o.StyleRef().Appearance()) { case kTextFieldPart: UseCounter::Count(o.GetDocument(), - UseCounter::kCSSValueAppearanceTextFieldRendered); + WebFeature::kCSSValueAppearanceTextFieldRendered); if (isHTMLInputElement(o.GetNode())) { HTMLInputElement* input = toHTMLInputElement(o.GetNode()); if (input->type() == InputTypeNames::search) { UseCounter::Count(o.GetDocument(), - UseCounter::kCSSValueAppearanceTextFieldForSearch); + WebFeature::kCSSValueAppearanceTextFieldForSearch); } else if (input->IsTextField()) { UseCounter::Count( o.GetDocument(), - UseCounter::kCSSValueAppearanceTextFieldForTextField); + WebFeature::kCSSValueAppearanceTextFieldForTextField); } } return PaintTextField(o, paint_info, r); diff --git a/third_party/WebKit/Source/core/svg/SVGAnimatedHref.cpp b/third_party/WebKit/Source/core/svg/SVGAnimatedHref.cpp index 03362131a1c33c..416baf68a01cbc 100644 --- a/third_party/WebKit/Source/core/svg/SVGAnimatedHref.cpp +++ b/third_party/WebKit/Source/core/svg/SVGAnimatedHref.cpp @@ -45,20 +45,20 @@ const SVGString* SVGAnimatedHref::CurrentValue() const { String SVGAnimatedHref::baseVal() { UseCounter::Count(contextElement()->GetDocument(), - UseCounter::kSVGHrefBaseVal); + WebFeature::kSVGHrefBaseVal); return BackingString()->SVGAnimatedString::baseVal(); } void SVGAnimatedHref::setBaseVal(const String& value, ExceptionState& exception_state) { UseCounter::Count(contextElement()->GetDocument(), - UseCounter::kSVGHrefBaseVal); + WebFeature::kSVGHrefBaseVal); return BackingString()->SVGAnimatedString::setBaseVal(value, exception_state); } String SVGAnimatedHref::animVal() { UseCounter::Count(contextElement()->GetDocument(), - UseCounter::kSVGHrefAnimVal); + WebFeature::kSVGHrefAnimVal); return BackingString()->SVGAnimatedString::animVal(); } diff --git a/third_party/WebKit/Source/core/svg/SVGAnimationElement.cpp b/third_party/WebKit/Source/core/svg/SVGAnimationElement.cpp index 972c96030a59f0..88889ea6b5c3d8 100644 --- a/third_party/WebKit/Source/core/svg/SVGAnimationElement.cpp +++ b/third_party/WebKit/Source/core/svg/SVGAnimationElement.cpp @@ -40,7 +40,7 @@ SVGAnimationElement::SVGAnimationElement(const QualifiedName& tag_name, calc_mode_(kCalcModeLinear), animation_mode_(kNoAnimation) { DCHECK(RuntimeEnabledFeatures::SMILEnabled()); - UseCounter::Count(document, UseCounter::kSVGAnimationElement); + UseCounter::Count(document, WebFeature::kSVGAnimationElement); } bool SVGAnimationElement::ParseValues(const String& value, @@ -287,20 +287,20 @@ void SVGAnimationElement::SetCalcMode(const AtomicString& calc_mode) { DEFINE_STATIC_LOCAL(const AtomicString, paced, ("paced")); DEFINE_STATIC_LOCAL(const AtomicString, spline, ("spline")); if (calc_mode == discrete) { - UseCounter::Count(GetDocument(), UseCounter::kSVGCalcModeDiscrete); + UseCounter::Count(GetDocument(), WebFeature::kSVGCalcModeDiscrete); SetCalcMode(kCalcModeDiscrete); } else if (calc_mode == linear) { if (isSVGAnimateMotionElement(*this)) - UseCounter::Count(GetDocument(), UseCounter::kSVGCalcModeLinear); + UseCounter::Count(GetDocument(), WebFeature::kSVGCalcModeLinear); // else linear is the default. SetCalcMode(kCalcModeLinear); } else if (calc_mode == paced) { if (!isSVGAnimateMotionElement(*this)) - UseCounter::Count(GetDocument(), UseCounter::kSVGCalcModePaced); + UseCounter::Count(GetDocument(), WebFeature::kSVGCalcModePaced); // else paced is the default. SetCalcMode(kCalcModePaced); } else if (calc_mode == spline) { - UseCounter::Count(GetDocument(), UseCounter::kSVGCalcModeSpline); + UseCounter::Count(GetDocument(), WebFeature::kSVGCalcModeSpline); SetCalcMode(kCalcModeSpline); } else SetCalcMode(isSVGAnimateMotionElement(*this) ? kCalcModePaced @@ -590,7 +590,7 @@ void SVGAnimationElement::StartedActiveInterval() { } if (animation_valid_ && (IsAdditive() || IsAccumulated())) - UseCounter::Count(&GetDocument(), UseCounter::kSVGSMILAdditiveAnimation); + UseCounter::Count(&GetDocument(), WebFeature::kSVGSMILAdditiveAnimation); } void SVGAnimationElement::UpdateAnimation(float percent, diff --git a/third_party/WebKit/Source/core/svg/SVGElement.cpp b/third_party/WebKit/Source/core/svg/SVGElement.cpp index e39c477d82a0f7..9f1c5fe8462deb 100644 --- a/third_party/WebKit/Source/core/svg/SVGElement.cpp +++ b/third_party/WebKit/Source/core/svg/SVGElement.cpp @@ -363,7 +363,7 @@ AffineTransform SVGElement::CalculateTransform( } if (TransformUsesBoxSize(*style, apply_transform_origin)) - UseCounter::Count(GetDocument(), UseCounter::kTransformUsesBoxSizeOnSVG); + UseCounter::Count(GetDocument(), WebFeature::kTransformUsesBoxSizeOnSVG); // CSS transforms operate with pre-scaled lengths. To make this work with // SVG (which applies the zoom factor globally, at the root level) we diff --git a/third_party/WebKit/Source/core/svg/SVGForeignObjectElement.cpp b/third_party/WebKit/Source/core/svg/SVGForeignObjectElement.cpp index 67d55d0b56d05f..f5d42ba065b36f 100644 --- a/third_party/WebKit/Source/core/svg/SVGForeignObjectElement.cpp +++ b/third_party/WebKit/Source/core/svg/SVGForeignObjectElement.cpp @@ -52,7 +52,7 @@ inline SVGForeignObjectElement::SVGForeignObjectElement(Document& document) AddToPropertyMap(width_); AddToPropertyMap(height_); - UseCounter::Count(document, UseCounter::kSVGForeignObjectElement); + UseCounter::Count(document, WebFeature::kSVGForeignObjectElement); } DEFINE_TRACE(SVGForeignObjectElement) { diff --git a/third_party/WebKit/Source/core/svg/SVGSVGElement.cpp b/third_party/WebKit/Source/core/svg/SVGSVGElement.cpp index 1f325469ce9b0e..35b568dad5aba9 100644 --- a/third_party/WebKit/Source/core/svg/SVGSVGElement.cpp +++ b/third_party/WebKit/Source/core/svg/SVGSVGElement.cpp @@ -92,7 +92,7 @@ inline SVGSVGElement::SVGSVGElement(Document& doc) AddToPropertyMap(width_); AddToPropertyMap(height_); - UseCounter::Count(doc, UseCounter::kSVGSVGElement); + UseCounter::Count(doc, WebFeature::kSVGSVGElement); } DEFINE_NODE_FACTORY(SVGSVGElement) @@ -523,9 +523,9 @@ LayoutObject* SVGSVGElement::CreateLayoutObject(const ComputedStyle&) { Node::InsertionNotificationRequest SVGSVGElement::InsertedInto( ContainerNode* root_parent) { if (root_parent->isConnected()) { - UseCounter::Count(GetDocument(), UseCounter::kSVGSVGElementInDocument); + UseCounter::Count(GetDocument(), WebFeature::kSVGSVGElementInDocument); if (root_parent->GetDocument().IsXMLDocument()) - UseCounter::Count(GetDocument(), UseCounter::kSVGSVGElementInXMLDocument); + UseCounter::Count(GetDocument(), WebFeature::kSVGSVGElementInXMLDocument); if (RuntimeEnabledFeatures::SMILEnabled()) { GetDocument().AccessSVGExtensions().AddTimeContainer(this); @@ -708,7 +708,7 @@ void SVGSVGElement::SetupInitialView(const String& fragment_identifier, SVGViewSpec* view_spec = SVGViewSpec::CreateForElement(*this); if (view_spec->ParseViewSpec(fragment_identifier)) { UseCounter::Count(GetDocument(), - UseCounter::kSVGSVGElementFragmentSVGView); + WebFeature::kSVGSVGElementFragmentSVGView); SetViewSpec(view_spec); return; } @@ -738,7 +738,7 @@ void SVGSVGElement::SetupInitialView(const String& fragment_identifier, SVGViewSpec* view_spec = SVGViewSpec::CreateForElement(*svg); view_spec->InheritViewAttributesFromElement(view_element); UseCounter::Count(svg->GetDocument(), - UseCounter::kSVGSVGElementFragmentSVGViewElement); + WebFeature::kSVGSVGElementFragmentSVGViewElement); svg->SetViewSpec(view_spec); } diff --git a/third_party/WebKit/Source/core/svg/SVGSwitchElement.cpp b/third_party/WebKit/Source/core/svg/SVGSwitchElement.cpp index 8b9dceb308e07f..6221fc29c8b1b3 100644 --- a/third_party/WebKit/Source/core/svg/SVGSwitchElement.cpp +++ b/third_party/WebKit/Source/core/svg/SVGSwitchElement.cpp @@ -28,7 +28,7 @@ namespace blink { inline SVGSwitchElement::SVGSwitchElement(Document& document) : SVGGraphicsElement(SVGNames::switchTag, document) { - UseCounter::Count(document, UseCounter::kSVGSwitchElement); + UseCounter::Count(document, WebFeature::kSVGSwitchElement); } DEFINE_NODE_FACTORY(SVGSwitchElement) diff --git a/third_party/WebKit/Source/core/svg/SVGTextContentElement.cpp b/third_party/WebKit/Source/core/svg/SVGTextContentElement.cpp index d5e31801419555..9a1ea04b7e228c 100644 --- a/third_party/WebKit/Source/core/svg/SVGTextContentElement.cpp +++ b/third_party/WebKit/Source/core/svg/SVGTextContentElement.cpp @@ -249,12 +249,12 @@ void SVGTextContentElement::CollectStyleForPresentationAttribute( DEFINE_STATIC_LOCAL(const AtomicString, preserve_string, ("preserve")); if (value == preserve_string) { - UseCounter::Count(GetDocument(), UseCounter::kWhiteSpacePreFromXMLSpace); + UseCounter::Count(GetDocument(), WebFeature::kWhiteSpacePreFromXMLSpace); AddPropertyToPresentationAttributeStyle(style, CSSPropertyWhiteSpace, CSSValuePre); } else { UseCounter::Count(GetDocument(), - UseCounter::kWhiteSpaceNowrapFromXMLSpace); + WebFeature::kWhiteSpaceNowrapFromXMLSpace); AddPropertyToPresentationAttributeStyle(style, CSSPropertyWhiteSpace, CSSValueNowrap); } diff --git a/third_party/WebKit/Source/core/svg/SVGViewElement.cpp b/third_party/WebKit/Source/core/svg/SVGViewElement.cpp index 97089031f0e11b..62a027b1e0e5c2 100644 --- a/third_party/WebKit/Source/core/svg/SVGViewElement.cpp +++ b/third_party/WebKit/Source/core/svg/SVGViewElement.cpp @@ -27,7 +27,7 @@ namespace blink { inline SVGViewElement::SVGViewElement(Document& document) : SVGElement(SVGNames::viewTag, document), SVGFitToViewBox(this) { - UseCounter::Count(document, UseCounter::kSVGViewElement); + UseCounter::Count(document, WebFeature::kSVGViewElement); } DEFINE_NODE_FACTORY(SVGViewElement) diff --git a/third_party/WebKit/Source/core/svg/animation/SMILTimeContainer.cpp b/third_party/WebKit/Source/core/svg/animation/SMILTimeContainer.cpp index 28d71c3470fa0b..e441f72838a4c9 100644 --- a/third_party/WebKit/Source/core/svg/animation/SMILTimeContainer.cpp +++ b/third_party/WebKit/Source/core/svg/animation/SMILTimeContainer.cpp @@ -499,7 +499,7 @@ SMILTime SMILTimeContainer::UpdateAnimations(double elapsed, return earliest_fire_time; } - UseCounter::Count(&GetDocument(), UseCounter::kSVGSMILAnimationAppliedEffect); + UseCounter::Count(&GetDocument(), WebFeature::kSVGSMILAnimationAppliedEffect); std::sort(animations_to_apply.begin(), animations_to_apply.end(), PriorityCompare(elapsed)); diff --git a/third_party/WebKit/Source/core/svg/animation/SVGSMILElement.cpp b/third_party/WebKit/Source/core/svg/animation/SVGSMILElement.cpp index 1e6c961da3d841..150a0de9234f5b 100644 --- a/third_party/WebKit/Source/core/svg/animation/SVGSMILElement.cpp +++ b/third_party/WebKit/Source/core/svg/animation/SVGSMILElement.cpp @@ -305,10 +305,10 @@ Node::InsertionNotificationRequest SVGSMILElement::InsertedInto( if (!root_parent->isConnected()) return kInsertionDone; - UseCounter::Count(GetDocument(), UseCounter::kSVGSMILElementInDocument); + UseCounter::Count(GetDocument(), WebFeature::kSVGSMILElementInDocument); if (GetDocument().IsLoadCompleted()) { UseCounter::Count(&GetDocument(), - UseCounter::kSVGSMILElementInsertedAfterLoad); + WebFeature::kSVGSMILElementInsertedAfterLoad); } SVGSVGElement* owner = ownerSVGElement(); @@ -458,13 +458,13 @@ bool SVGSMILElement::ParseCondition(const String& value, if (base_id.IsEmpty()) return false; UseCounter::Count(&GetDocument(), - UseCounter::kSVGSMILBeginOrEndSyncbaseValue); + WebFeature::kSVGSMILBeginOrEndSyncbaseValue); type = Condition::kSyncbase; } else if (name_string.StartsWith("accesskey(")) { // FIXME: accesskey() support. type = Condition::kAccessKey; } else { - UseCounter::Count(&GetDocument(), UseCounter::kSVGSMILBeginOrEndEventValue); + UseCounter::Count(&GetDocument(), WebFeature::kSVGSMILBeginOrEndEventValue); type = Condition::kEventBase; } diff --git a/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp b/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp index 6199c5b55cf596..26aa2caec75506 100644 --- a/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp +++ b/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp @@ -640,7 +640,7 @@ void SVGImage::UpdateUseCounters(const Document& document) const { if (SVGSVGElement* root_element = SvgRootElement(page_.Get())) { if (root_element->TimeContainer()->HasAnimations()) { UseCounter::Count(document, - UseCounter::kSVGSMILAnimationInImageRegardlessOfCache); + WebFeature::kSVGSMILAnimationInImageRegardlessOfCache); } } } diff --git a/third_party/WebKit/Source/core/testing/Internals.cpp b/third_party/WebKit/Source/core/testing/Internals.cpp index 0eb0e411f9da35..f49dca0b4fc278 100644 --- a/third_party/WebKit/Source/core/testing/Internals.cpp +++ b/third_party/WebKit/Source/core/testing/Internals.cpp @@ -3276,10 +3276,9 @@ float Internals::visualViewportScrollY() { } bool Internals::isUseCounted(Document* document, uint32_t feature) { - if (feature >= UseCounter::kNumberOfFeatures) + if (feature >= static_cast(WebFeature::kNumberOfFeatures)) return false; - return UseCounter::IsCounted(*document, - static_cast(feature)); + return UseCounter::IsCounted(*document, static_cast(feature)); } bool Internals::isCSSPropertyUseCounted(Document* document, @@ -3297,13 +3296,12 @@ ScriptPromise Internals::observeUseCounter(ScriptState* script_state, uint32_t feature) { ScriptPromiseResolver* resolver = ScriptPromiseResolver::Create(script_state); ScriptPromise promise = resolver->Promise(); - if (feature >= UseCounter::kNumberOfFeatures) { + if (feature >= static_cast(WebFeature::kNumberOfFeatures)) { resolver->Reject(); return promise; } - UseCounter::Feature use_counter_feature = - static_cast(feature); + WebFeature use_counter_feature = static_cast(feature); if (UseCounter::IsCounted(*document, use_counter_feature)) { resolver->Resolve(); return promise; diff --git a/third_party/WebKit/Source/core/testing/Internals.h b/third_party/WebKit/Source/core/testing/Internals.h index e997305bfa4dc6..d31c67aa5dbd6b 100644 --- a/third_party/WebKit/Source/core/testing/Internals.h +++ b/third_party/WebKit/Source/core/testing/Internals.h @@ -517,7 +517,7 @@ class Internals final : public GarbageCollected, float visualViewportScrollY(); // Return true if the given use counter exists for the given document. - // |feature| must be one of the values from the UseCounter::Feature enum. + // |feature| must be one of the values from the WebFeature enum. bool isUseCounted(Document*, uint32_t feature); bool isCSSPropertyUseCounted(Document*, const String&); bool isAnimatedCSSPropertyUseCounted(Document*, const String&); diff --git a/third_party/WebKit/Source/core/testing/WorkerInternals.cpp b/third_party/WebKit/Source/core/testing/WorkerInternals.cpp index a0cf2de9b6d5f3..04ca57507ef46b 100644 --- a/third_party/WebKit/Source/core/testing/WorkerInternals.cpp +++ b/third_party/WebKit/Source/core/testing/WorkerInternals.cpp @@ -24,25 +24,25 @@ OriginTrialsTest* WorkerInternals::originTrialsTest() const { void WorkerInternals::countFeature(ScriptState* script_state, uint32_t feature, ExceptionState& exception_state) { - if (UseCounter::kNumberOfFeatures <= feature) { + if (static_cast(WebFeature::kNumberOfFeatures) <= feature) { exception_state.ThrowTypeError( - "The given feature does not exist in UseCounter::Feature."); + "The given feature does not exist in WebFeature."); return; } UseCounter::Count(ExecutionContext::From(script_state), - static_cast(feature)); + static_cast(feature)); } void WorkerInternals::countDeprecation(ScriptState* script_state, uint32_t feature, ExceptionState& exception_state) { - if (UseCounter::kNumberOfFeatures <= feature) { + if (static_cast(WebFeature::kNumberOfFeatures) <= feature) { exception_state.ThrowTypeError( - "The given feature does not exist in UseCounter::Feature."); + "The given feature does not exist in WebFeature."); return; } Deprecation::CountDeprecation(ExecutionContext::From(script_state), - static_cast(feature)); + static_cast(feature)); } void WorkerInternals::collectGarbage(ScriptState* script_state) { diff --git a/third_party/WebKit/Source/core/timing/Performance.cpp b/third_party/WebKit/Source/core/timing/Performance.cpp index 97edfa909d2204..a60c520b94f94b 100644 --- a/third_party/WebKit/Source/core/timing/Performance.cpp +++ b/third_party/WebKit/Source/core/timing/Performance.cpp @@ -156,7 +156,7 @@ void Performance::UpdateLongTaskInstrumentation() { if (HasObserverFor(PerformanceEntry::kLongTask)) { UseCounter::Count(&GetFrame()->LocalFrameRoot(), - UseCounter::kLongTaskObserver); + WebFeature::kLongTaskObserver); GetFrame()->GetPerformanceMonitor()->Subscribe( PerformanceMonitor::kLongTask, kLongTaskThreshold, this); } else { diff --git a/third_party/WebKit/Source/core/timing/PerformanceBase.cpp b/third_party/WebKit/Source/core/timing/PerformanceBase.cpp index 6484bdf35644c2..904e27f9a98dc3 100644 --- a/third_party/WebKit/Source/core/timing/PerformanceBase.cpp +++ b/third_party/WebKit/Source/core/timing/PerformanceBase.cpp @@ -269,7 +269,7 @@ bool PerformanceBase::PassesTimingAllowCheck( return false; if (timing_allow_origin_string == "*") { - UseCounter::Count(context, UseCounter::kStarInTimingAllowOrigin); + UseCounter::Count(context, WebFeature::kStarInTimingAllowOrigin); return true; } @@ -277,9 +277,9 @@ bool PerformanceBase::PassesTimingAllowCheck( Vector timing_allow_origins; timing_allow_origin_string.GetString().Split(' ', timing_allow_origins); if (timing_allow_origins.size() > 1) - UseCounter::Count(context, UseCounter::kMultipleOriginsInTimingAllowOrigin); + UseCounter::Count(context, WebFeature::kMultipleOriginsInTimingAllowOrigin); else if (timing_allow_origins.size() == 1) - UseCounter::Count(context, UseCounter::kSingleOriginInTimingAllowOrigin); + UseCounter::Count(context, WebFeature::kSingleOriginInTimingAllowOrigin); for (const String& allow_origin : timing_allow_origins) { if (allow_origin == security_origin) return true; diff --git a/third_party/WebKit/Source/core/xml/DocumentXSLT.cpp b/third_party/WebKit/Source/core/xml/DocumentXSLT.cpp index e7f9cb0ed098b8..b06620fb9d2bf3 100644 --- a/third_party/WebKit/Source/core/xml/DocumentXSLT.cpp +++ b/third_party/WebKit/Source/core/xml/DocumentXSLT.cpp @@ -91,7 +91,7 @@ DocumentXSLT::DocumentXSLT(Document& document) void DocumentXSLT::ApplyXSLTransform(Document& document, ProcessingInstruction* pi) { DCHECK(!pi->IsLoading()); - UseCounter::Count(document, UseCounter::kXSLProcessingInstruction); + UseCounter::Count(document, WebFeature::kXSLProcessingInstruction); XSLTProcessor* processor = XSLTProcessor::Create(document); processor->SetXSLStyleSheet(ToXSLStyleSheet(pi->sheet())); String result_mime_type; diff --git a/third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp b/third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp index d5ab79d0e19037..3de3229aad95d8 100644 --- a/third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp +++ b/third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp @@ -666,7 +666,7 @@ static void* OpenFunc(const char* uri) { return &g_global_descriptor; UseCounter::Count(XMLDocumentParserScope::current_document_, - UseCounter::kXMLExternalResourceLoad); + WebFeature::kXMLExternalResourceLoad); return new SharedBufferReader(data); } @@ -783,7 +783,7 @@ XMLDocumentParser::XMLDocumentParser(Document& document, parsing_fragment_(false) { // This is XML being used as a document resource. if (frame_view && document.IsXMLDocument()) - UseCounter::Count(document, UseCounter::kXMLDocument); + UseCounter::Count(document, WebFeature::kXMLDocument); } XMLDocumentParser::XMLDocumentParser(DocumentFragment* fragment, diff --git a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp index c111956863b697..1ed4058d949e17 100644 --- a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp +++ b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp @@ -648,7 +648,7 @@ void XMLHttpRequest::open(const AtomicString& method, if (!GetDocument()->ProcessingBeforeUnload()) { Deprecation::CountDeprecation( GetExecutionContext(), - UseCounter::kXMLHttpRequestSynchronousInNonWorkerOutsideBeforeUnload); + WebFeature::kXMLHttpRequestSynchronousInNonWorkerOutsideBeforeUnload); } } @@ -687,7 +687,7 @@ bool XMLHttpRequest::InitSend(ExceptionState& exception_state) { v8::Isolate* isolate = v8::Isolate::GetCurrent(); if (isolate && v8::MicrotasksScope::IsRunningMicrotasks(isolate)) { UseCounter::Count(GetExecutionContext(), - UseCounter::kDuring_Microtask_SyncXHR); + WebFeature::kDuring_Microtask_SyncXHR); } } @@ -979,7 +979,7 @@ void XMLHttpRequest::CreateRequest(PassRefPtr http_body, if (!same_origin_request_ && include_credentials) { UseCounter::Count(&execution_context, - UseCounter::kXMLHttpRequestCrossOriginWithCredentials); + WebFeature::kXMLHttpRequestCrossOriginWithCredentials); } // We also remember whether upload events should be allowed for this request @@ -1053,7 +1053,7 @@ void XMLHttpRequest::CreateRequest(PassRefPtr http_body, if (async_) { UseCounter::Count(&execution_context, - UseCounter::kXMLHttpRequestAsynchronous); + WebFeature::kXMLHttpRequestAsynchronous); if (upload_) request.SetReportUploadProgress(true); @@ -1067,7 +1067,7 @@ void XMLHttpRequest::CreateRequest(PassRefPtr http_body, } // Use count for XHR synchronous requests. - UseCounter::Count(&execution_context, UseCounter::kXMLHttpRequestSynchronous); + UseCounter::Count(&execution_context, WebFeature::kXMLHttpRequestSynchronous); ThreadableLoader::LoadResourceSynchronously(execution_context, request, *this, options, resource_loader_options); diff --git a/third_party/WebKit/Source/modules/app_banner/BeforeInstallPromptEvent.cpp b/third_party/WebKit/Source/modules/app_banner/BeforeInstallPromptEvent.cpp index 83f42f34ab7c3e..229ebf76fa470d 100644 --- a/third_party/WebKit/Source/modules/app_banner/BeforeInstallPromptEvent.cpp +++ b/third_party/WebKit/Source/modules/app_banner/BeforeInstallPromptEvent.cpp @@ -31,7 +31,7 @@ BeforeInstallPromptEvent::BeforeInstallPromptEvent( prompt_called_(false) { DCHECK(banner_service_); DCHECK(binding_.is_bound()); - UseCounter::Count(&frame, UseCounter::kBeforeInstallPromptEvent); + UseCounter::Count(&frame, WebFeature::kBeforeInstallPromptEvent); } BeforeInstallPromptEvent::BeforeInstallPromptEvent( @@ -59,7 +59,7 @@ Vector BeforeInstallPromptEvent::platforms() const { ScriptPromise BeforeInstallPromptEvent::userChoice(ScriptState* script_state) { UseCounter::Count(ExecutionContext::From(script_state), - UseCounter::kBeforeInstallPromptEventUserChoice); + WebFeature::kBeforeInstallPromptEventUserChoice); // |m_binding| must be bound to allow the AppBannerService to resolve the // userChoice promise. if (user_choice_ && binding_.is_bound()) @@ -82,7 +82,7 @@ ScriptPromise BeforeInstallPromptEvent::prompt(ScriptState* script_state) { } UseCounter::Count(ExecutionContext::From(script_state), - UseCounter::kBeforeInstallPromptEventPrompt); + WebFeature::kBeforeInstallPromptEventPrompt); prompt_called_ = true; banner_service_->DisplayAppBanner( @@ -98,7 +98,7 @@ void BeforeInstallPromptEvent::preventDefault() { Event::preventDefault(); if (target()) { UseCounter::Count(target()->GetExecutionContext(), - UseCounter::kBeforeInstallPromptEventPreventDefault); + WebFeature::kBeforeInstallPromptEventPreventDefault); } } diff --git a/third_party/WebKit/Source/modules/beacon/NavigatorBeacon.cpp b/third_party/WebKit/Source/modules/beacon/NavigatorBeacon.cpp index abf1dc0e9370d4..308cf0a0def132 100644 --- a/third_party/WebKit/Source/modules/beacon/NavigatorBeacon.cpp +++ b/third_party/WebKit/Source/modules/beacon/NavigatorBeacon.cpp @@ -122,7 +122,7 @@ bool NavigatorBeacon::SendBeaconImpl( Blob* blob = data.getAsBlob(); if (!FetchUtils::IsSimpleContentType(AtomicString(blob->type()))) { UseCounter::Count(context, - UseCounter::kSendBeaconWithNonSimpleContentType); + WebFeature::kSendBeaconWithNonSimpleContentType); if (RuntimeEnabledFeatures:: SendBeaconThrowForBlobWithNonSimpleTypeEnabled()) { exception_state.ThrowSecurityError( @@ -146,7 +146,7 @@ bool NavigatorBeacon::SendBeaconImpl( } if (!allowed) { - UseCounter::Count(context, UseCounter::kSendBeaconQuotaExceeded); + UseCounter::Count(context, WebFeature::kSendBeaconQuotaExceeded); return false; } diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.cpp b/third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.cpp index d59d491d850597..2c0f7182b7296d 100644 --- a/third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.cpp +++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.cpp @@ -105,7 +105,7 @@ void BluetoothDevice::AddedEventListener( registered_listener); if (event_type == EventTypeNames::gattserverdisconnected) { UseCounter::Count(GetExecutionContext(), - UseCounter::kGATTServerDisconnectedEvent); + WebFeature::kGATTServerDisconnectedEvent); } } diff --git a/third_party/WebKit/Source/modules/credentialmanager/CredentialsContainer.cpp b/third_party/WebKit/Source/modules/credentialmanager/CredentialsContainer.cpp index 5572d7f75d9c12..04fdaf161cc64c 100644 --- a/third_party/WebKit/Source/modules/credentialmanager/CredentialsContainer.cpp +++ b/third_party/WebKit/Source/modules/credentialmanager/CredentialsContainer.cpp @@ -111,7 +111,7 @@ class RequestCallbacks : public WebCredentialManagerClient::RequestCallbacks { DCHECK(credential->IsPasswordCredential() || credential->IsFederatedCredential()); UseCounter::Count(ExecutionContext::From(resolver_->GetScriptState()), - UseCounter::kCredentialManagerGetReturnedCredential); + WebFeature::kCredentialManagerGetReturnedCredential); if (credential->IsPasswordCredential()) resolver_->Resolve(PasswordCredential::Create( static_cast(credential.get()))); @@ -183,7 +183,7 @@ ScriptPromise CredentialsContainer::get( mediation = options.unmediated() ? "silent" : "optional"; UseCounter::Count( context, - UseCounter::kCredentialManagerCredentialRequestOptionsOnlyUnmediated); + WebFeature::kCredentialManagerCredentialRequestOptionsOnlyUnmediated); } else if (options.hasMediation()) { mediation = options.mediation(); if (options.hasUnmediated() && @@ -209,16 +209,16 @@ ScriptPromise CredentialsContainer::get( if (mediation == "silent") { UseCounter::Count(context, - UseCounter::kCredentialManagerGetMediationSilent); + WebFeature::kCredentialManagerGetMediationSilent); requirement = WebCredentialMediationRequirement::kSilent; } else if (mediation == "optional") { UseCounter::Count(context, - UseCounter::kCredentialManagerGetMediationOptional); + WebFeature::kCredentialManagerGetMediationOptional); requirement = WebCredentialMediationRequirement::kOptional; } else { DCHECK_EQ("required", mediation); UseCounter::Count(context, - UseCounter::kCredentialManagerGetMediationRequired); + WebFeature::kCredentialManagerGetMediationRequired); requirement = WebCredentialMediationRequirement::kRequired; } diff --git a/third_party/WebKit/Source/modules/crypto/CryptoHistograms.cpp b/third_party/WebKit/Source/modules/crypto/CryptoHistograms.cpp index a7f40b34e06515..63a56ed00c7ca9 100644 --- a/third_party/WebKit/Source/modules/crypto/CryptoHistograms.cpp +++ b/third_party/WebKit/Source/modules/crypto/CryptoHistograms.cpp @@ -12,50 +12,50 @@ namespace blink { -static UseCounter::Feature AlgorithmIdToFeature(WebCryptoAlgorithmId id) { +static WebFeature AlgorithmIdToFeature(WebCryptoAlgorithmId id) { switch (id) { case kWebCryptoAlgorithmIdAesCbc: - return UseCounter::kCryptoAlgorithmAesCbc; + return WebFeature::kCryptoAlgorithmAesCbc; case kWebCryptoAlgorithmIdHmac: - return UseCounter::kCryptoAlgorithmHmac; + return WebFeature::kCryptoAlgorithmHmac; case kWebCryptoAlgorithmIdRsaSsaPkcs1v1_5: - return UseCounter::kCryptoAlgorithmRsaSsaPkcs1v1_5; + return WebFeature::kCryptoAlgorithmRsaSsaPkcs1v1_5; case kWebCryptoAlgorithmIdSha1: - return UseCounter::kCryptoAlgorithmSha1; + return WebFeature::kCryptoAlgorithmSha1; case kWebCryptoAlgorithmIdSha256: - return UseCounter::kCryptoAlgorithmSha256; + return WebFeature::kCryptoAlgorithmSha256; case kWebCryptoAlgorithmIdSha384: - return UseCounter::kCryptoAlgorithmSha384; + return WebFeature::kCryptoAlgorithmSha384; case kWebCryptoAlgorithmIdSha512: - return UseCounter::kCryptoAlgorithmSha512; + return WebFeature::kCryptoAlgorithmSha512; case kWebCryptoAlgorithmIdAesGcm: - return UseCounter::kCryptoAlgorithmAesGcm; + return WebFeature::kCryptoAlgorithmAesGcm; case kWebCryptoAlgorithmIdRsaOaep: - return UseCounter::kCryptoAlgorithmRsaOaep; + return WebFeature::kCryptoAlgorithmRsaOaep; case kWebCryptoAlgorithmIdAesCtr: - return UseCounter::kCryptoAlgorithmAesCtr; + return WebFeature::kCryptoAlgorithmAesCtr; case kWebCryptoAlgorithmIdAesKw: - return UseCounter::kCryptoAlgorithmAesKw; + return WebFeature::kCryptoAlgorithmAesKw; case kWebCryptoAlgorithmIdRsaPss: - return UseCounter::kCryptoAlgorithmRsaPss; + return WebFeature::kCryptoAlgorithmRsaPss; case kWebCryptoAlgorithmIdEcdsa: - return UseCounter::kCryptoAlgorithmEcdsa; + return WebFeature::kCryptoAlgorithmEcdsa; case kWebCryptoAlgorithmIdEcdh: - return UseCounter::kCryptoAlgorithmEcdh; + return WebFeature::kCryptoAlgorithmEcdh; case kWebCryptoAlgorithmIdHkdf: - return UseCounter::kCryptoAlgorithmHkdf; + return WebFeature::kCryptoAlgorithmHkdf; case kWebCryptoAlgorithmIdPbkdf2: - return UseCounter::kCryptoAlgorithmPbkdf2; + return WebFeature::kCryptoAlgorithmPbkdf2; } NOTREACHED(); - return static_cast(0); + return static_cast(0); } static void HistogramAlgorithmId(ExecutionContext* context, WebCryptoAlgorithmId algorithm_id) { - UseCounter::Feature feature = AlgorithmIdToFeature(algorithm_id); - if (feature) + WebFeature feature = AlgorithmIdToFeature(algorithm_id); + if (static_cast(feature)) UseCounter::Count(context, feature); } diff --git a/third_party/WebKit/Source/modules/device_orientation/DeviceMotionController.cpp b/third_party/WebKit/Source/modules/device_orientation/DeviceMotionController.cpp index 8372dc8756f84b..8543af51ccf385 100644 --- a/third_party/WebKit/Source/modules/device_orientation/DeviceMotionController.cpp +++ b/third_party/WebKit/Source/modules/device_orientation/DeviceMotionController.cpp @@ -46,10 +46,10 @@ void DeviceMotionController::DidAddEventListener( if (GetDocument().GetFrame()) { if (GetDocument().IsSecureContext()) { UseCounter::Count(GetDocument().GetFrame(), - UseCounter::kDeviceMotionSecureOrigin); + WebFeature::kDeviceMotionSecureOrigin); } else { Deprecation::CountDeprecation(GetDocument().GetFrame(), - UseCounter::kDeviceMotionInsecureOrigin); + WebFeature::kDeviceMotionInsecureOrigin); HostsUsingFeatures::CountAnyWorld( GetDocument(), HostsUsingFeatures::Feature::kDeviceMotionInsecureHost); diff --git a/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationAbsoluteController.cpp b/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationAbsoluteController.cpp index 46c72673564ebd..0c7e43c38eca8c 100644 --- a/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationAbsoluteController.cpp +++ b/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationAbsoluteController.cpp @@ -44,11 +44,11 @@ void DeviceOrientationAbsoluteController::DidAddEventListener( if (GetDocument().GetFrame()) { if (GetDocument().IsSecureContext()) { UseCounter::Count(GetDocument().GetFrame(), - UseCounter::kDeviceOrientationAbsoluteSecureOrigin); + WebFeature::kDeviceOrientationAbsoluteSecureOrigin); } else { Deprecation::CountDeprecation( GetDocument().GetFrame(), - UseCounter::kDeviceOrientationAbsoluteInsecureOrigin); + WebFeature::kDeviceOrientationAbsoluteInsecureOrigin); // TODO: add rappor logging of insecure origins as in // DeviceOrientationController. if (GetDocument() diff --git a/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationController.cpp b/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationController.cpp index 10eac3e6368b7a..3e47f8c042b2aa 100644 --- a/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationController.cpp +++ b/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationController.cpp @@ -55,11 +55,11 @@ void DeviceOrientationController::DidAddEventListener( if (GetDocument().GetFrame()) { if (GetDocument().IsSecureContext()) { UseCounter::Count(GetDocument().GetFrame(), - UseCounter::kDeviceOrientationSecureOrigin); + WebFeature::kDeviceOrientationSecureOrigin); } else { Deprecation::CountDeprecation( GetDocument().GetFrame(), - UseCounter::kDeviceOrientationInsecureOrigin); + WebFeature::kDeviceOrientationInsecureOrigin); HostsUsingFeatures::CountAnyWorld( GetDocument(), HostsUsingFeatures::Feature::kDeviceOrientationInsecureHost); diff --git a/third_party/WebKit/Source/modules/eventsource/EventSource.cpp b/third_party/WebKit/Source/modules/eventsource/EventSource.cpp index 1aa304401ddabf..e1a76073106547 100644 --- a/third_party/WebKit/Source/modules/eventsource/EventSource.cpp +++ b/third_party/WebKit/Source/modules/eventsource/EventSource.cpp @@ -82,9 +82,9 @@ EventSource* EventSource::Create(ExecutionContext* context, const EventSourceInit& event_source_init, ExceptionState& exception_state) { if (context->IsDocument()) - UseCounter::Count(ToDocument(context), UseCounter::kEventSourceDocument); + UseCounter::Count(ToDocument(context), WebFeature::kEventSourceDocument); else - UseCounter::Count(context, UseCounter::kEventSourceWorker); + UseCounter::Count(context, WebFeature::kEventSourceWorker); if (url.IsEmpty()) { exception_state.ThrowDOMException( diff --git a/third_party/WebKit/Source/modules/fetch/GlobalFetch.cpp b/third_party/WebKit/Source/modules/fetch/GlobalFetch.cpp index 0d3f7f74ffdde5..644c036c8b0f41 100644 --- a/third_party/WebKit/Source/modules/fetch/GlobalFetch.cpp +++ b/third_party/WebKit/Source/modules/fetch/GlobalFetch.cpp @@ -97,7 +97,7 @@ ScriptPromise GlobalFetch::fetch(ScriptState* script_state, const RequestInfo& input, const Dictionary& init, ExceptionState& exception_state) { - UseCounter::Count(window.GetExecutionContext(), UseCounter::kFetch); + UseCounter::Count(window.GetExecutionContext(), WebFeature::kFetch); if (!window.GetFrame()) { exception_state.ThrowTypeError("The global scope is shutting down."); return ScriptPromise(); @@ -111,7 +111,7 @@ ScriptPromise GlobalFetch::fetch(ScriptState* script_state, const RequestInfo& input, const Dictionary& init, ExceptionState& exception_state) { - UseCounter::Count(worker.GetExecutionContext(), UseCounter::kFetch); + UseCounter::Count(worker.GetExecutionContext(), WebFeature::kFetch); return ScopedFetcher::From(worker)->Fetch(script_state, input, init, exception_state); } diff --git a/third_party/WebKit/Source/modules/fetch/RequestInit.cpp b/third_party/WebKit/Source/modules/fetch/RequestInit.cpp index bf3c8d0e2478fa..ea5cd44448fd6a 100644 --- a/third_party/WebKit/Source/modules/fetch/RequestInit.cpp +++ b/third_party/WebKit/Source/modules/fetch/RequestInit.cpp @@ -118,7 +118,7 @@ RequestInit::RequestInit(ExecutionContext* context, if (is_credential_set) { if (V8PasswordCredential::hasInstance(v8_credential, isolate)) { Deprecation::CountDeprecation(context, - UseCounter::kCredentialManagerCustomFetch); + WebFeature::kCredentialManagerCustomFetch); // TODO(mkwst): According to the spec, we'd serialize this once we touch // the network. We're serializing it here, ahead of time, because lifetime // issues around ResourceRequest make it pretty difficult to pass a diff --git a/third_party/WebKit/Source/modules/fetch/Response.cpp b/third_party/WebKit/Source/modules/fetch/Response.cpp index 75c1b4d67ef668..28755f8c69620f 100644 --- a/third_party/WebKit/Source/modules/fetch/Response.cpp +++ b/third_party/WebKit/Source/modules/fetch/Response.cpp @@ -180,7 +180,7 @@ Response* Response::Create(ScriptState* script_state, } else if (ReadableStreamOperations::IsReadableStream(script_state, body_value)) { UseCounter::Count(execution_context, - UseCounter::kFetchResponseConstructionWithStream); + WebFeature::kFetchResponseConstructionWithStream); body_buffer = new BodyStreamBuffer(script_state, body_value); } else { String string = ToUSVString(isolate, body, exception_state); diff --git a/third_party/WebKit/Source/modules/filesystem/DOMWindowFileSystem.cpp b/third_party/WebKit/Source/modules/filesystem/DOMWindowFileSystem.cpp index 9fb5afa38e4429..cedc8a7112f453 100644 --- a/third_party/WebKit/Source/modules/filesystem/DOMWindowFileSystem.cpp +++ b/third_party/WebKit/Source/modules/filesystem/DOMWindowFileSystem.cpp @@ -56,7 +56,7 @@ void DOMWindowFileSystem::webkitRequestFileSystem( if (SchemeRegistry::SchemeShouldBypassContentSecurityPolicy( document->GetSecurityOrigin()->Protocol())) - UseCounter::Count(document, UseCounter::kRequestFileSystemNonWebbyOrigin); + UseCounter::Count(document, WebFeature::kRequestFileSystemNonWebbyOrigin); if (!document->GetSecurityOrigin()->CanAccessFileSystem()) { DOMFileSystem::ReportError(document, diff --git a/third_party/WebKit/Source/modules/filesystem/Entry.cpp b/third_party/WebKit/Source/modules/filesystem/Entry.cpp index 6dd24e589899a8..7cbfffadd336b4 100644 --- a/third_party/WebKit/Source/modules/filesystem/Entry.cpp +++ b/third_party/WebKit/Source/modules/filesystem/Entry.cpp @@ -51,7 +51,7 @@ DOMFileSystem* Entry::filesystem(ScriptState* script_state) const { if (file_system_->GetType() == kFileSystemTypeIsolated) { UseCounter::Count( ExecutionContext::From(script_state), - UseCounter::kEntry_Filesystem_AttributeGetter_IsolatedFileSystem); + WebFeature::kEntry_Filesystem_AttributeGetter_IsolatedFileSystem); } return filesystem(); } @@ -61,7 +61,7 @@ void Entry::getMetadata(ScriptState* script_state, ErrorCallback* error_callback) { if (file_system_->GetType() == kFileSystemTypeIsolated) { UseCounter::Count(ExecutionContext::From(script_state), - UseCounter::kEntry_GetMetadata_Method_IsolatedFileSystem); + WebFeature::kEntry_GetMetadata_Method_IsolatedFileSystem); } file_system_->GetMetadata(this, success_callback, ScriptErrorCallback::Wrap(error_callback)); @@ -74,7 +74,7 @@ void Entry::moveTo(ScriptState* script_state, ErrorCallback* error_callback) const { if (file_system_->GetType() == kFileSystemTypeIsolated) { UseCounter::Count(ExecutionContext::From(script_state), - UseCounter::kEntry_MoveTo_Method_IsolatedFileSystem); + WebFeature::kEntry_MoveTo_Method_IsolatedFileSystem); } file_system_->Move(this, parent, name, success_callback, ScriptErrorCallback::Wrap(error_callback)); @@ -87,7 +87,7 @@ void Entry::copyTo(ScriptState* script_state, ErrorCallback* error_callback) const { if (file_system_->GetType() == kFileSystemTypeIsolated) { UseCounter::Count(ExecutionContext::From(script_state), - UseCounter::kEntry_CopyTo_Method_IsolatedFileSystem); + WebFeature::kEntry_CopyTo_Method_IsolatedFileSystem); } file_system_->Copy(this, parent, name, success_callback, ScriptErrorCallback::Wrap(error_callback)); @@ -98,7 +98,7 @@ void Entry::remove(ScriptState* script_state, ErrorCallback* error_callback) const { if (file_system_->GetType() == kFileSystemTypeIsolated) { UseCounter::Count(ExecutionContext::From(script_state), - UseCounter::kEntry_Remove_Method_IsolatedFileSystem); + WebFeature::kEntry_Remove_Method_IsolatedFileSystem); } file_system_->Remove(this, success_callback, ScriptErrorCallback::Wrap(error_callback)); @@ -109,7 +109,7 @@ void Entry::getParent(ScriptState* script_state, ErrorCallback* error_callback) const { if (file_system_->GetType() == kFileSystemTypeIsolated) { UseCounter::Count(ExecutionContext::From(script_state), - UseCounter::kEntry_GetParent_Method_IsolatedFileSystem); + WebFeature::kEntry_GetParent_Method_IsolatedFileSystem); } file_system_->GetParent(this, success_callback, ScriptErrorCallback::Wrap(error_callback)); @@ -118,7 +118,7 @@ void Entry::getParent(ScriptState* script_state, String Entry::toURL(ScriptState* script_state) const { if (file_system_->GetType() == kFileSystemTypeIsolated) { UseCounter::Count(ExecutionContext::From(script_state), - UseCounter::kEntry_ToURL_Method_IsolatedFileSystem); + WebFeature::kEntry_ToURL_Method_IsolatedFileSystem); } return static_cast(this)->toURL(); } diff --git a/third_party/WebKit/Source/modules/geolocation/Geolocation.cpp b/third_party/WebKit/Source/modules/geolocation/Geolocation.cpp index 1a25b452585d2e..a49fea97e47e7b 100644 --- a/third_party/WebKit/Source/modules/geolocation/Geolocation.cpp +++ b/third_party/WebKit/Source/modules/geolocation/Geolocation.cpp @@ -148,9 +148,9 @@ void Geolocation::RecordOriginTypeAccess() const { // developer console. String insecure_origin_msg; if (document->IsSecureContext(insecure_origin_msg)) { - UseCounter::Count(document, UseCounter::kGeolocationSecureOrigin); + UseCounter::Count(document, WebFeature::kGeolocationSecureOrigin); UseCounter::CountCrossOriginIframe( - *document, UseCounter::kGeolocationSecureOriginIframe); + *document, WebFeature::kGeolocationSecureOriginIframe); } else if (GetFrame() ->GetSettings() ->GetAllowGeolocationOnInsecureOrigins()) { @@ -159,17 +159,17 @@ void Geolocation::RecordOriginTypeAccess() const { // // See https://crbug.com/603574. Deprecation::CountDeprecation( - document, UseCounter::kGeolocationInsecureOriginDeprecatedNotRemoved); + document, WebFeature::kGeolocationInsecureOriginDeprecatedNotRemoved); Deprecation::CountDeprecationCrossOriginIframe( *document, - UseCounter::kGeolocationInsecureOriginIframeDeprecatedNotRemoved); + WebFeature::kGeolocationInsecureOriginIframeDeprecatedNotRemoved); HostsUsingFeatures::CountAnyWorld( *document, HostsUsingFeatures::Feature::kGeolocationInsecureHost); } else { Deprecation::CountDeprecation(document, - UseCounter::kGeolocationInsecureOrigin); + WebFeature::kGeolocationInsecureOrigin); Deprecation::CountDeprecationCrossOriginIframe( - *document, UseCounter::kGeolocationInsecureOriginIframe); + *document, WebFeature::kGeolocationInsecureOriginIframe); HostsUsingFeatures::CountAnyWorld( *document, HostsUsingFeatures::Feature::kGeolocationInsecureHost); } diff --git a/third_party/WebKit/Source/modules/media_controls/MediaControlsImpl.cpp b/third_party/WebKit/Source/modules/media_controls/MediaControlsImpl.cpp index f893eb1944fbfe..c9f52b307ee247 100644 --- a/third_party/WebKit/Source/modules/media_controls/MediaControlsImpl.cpp +++ b/third_party/WebKit/Source/modules/media_controls/MediaControlsImpl.cpp @@ -115,7 +115,7 @@ bool ShouldShowFullscreenButton(const HTMLMediaElement& media_element) { if (media_element.ControlsListInternal()->ShouldHideFullscreen()) { UseCounter::Count(media_element.GetDocument(), - UseCounter::kHTMLMediaElementControlsListNoFullscreen); + WebFeature::kHTMLMediaElementControlsListNoFullscreen); return false; } @@ -137,7 +137,7 @@ bool ShouldShowCastButton(HTMLMediaElement& media_element) { if (media_element.ControlsListInternal()->ShouldHideRemotePlayback()) { UseCounter::Count( media_element.GetDocument(), - UseCounter::kHTMLMediaElementControlsListNoRemotePlayback); + WebFeature::kHTMLMediaElementControlsListNoRemotePlayback); return false; } diff --git a/third_party/WebKit/Source/modules/media_controls/elements/MediaControlDownloadButtonElement.cpp b/third_party/WebKit/Source/modules/media_controls/elements/MediaControlDownloadButtonElement.cpp index b9759b9c1d2ca4..2007c5d81496f0 100644 --- a/third_party/WebKit/Source/modules/media_controls/elements/MediaControlDownloadButtonElement.cpp +++ b/third_party/WebKit/Source/modules/media_controls/elements/MediaControlDownloadButtonElement.cpp @@ -69,7 +69,7 @@ bool MediaControlDownloadButtonElement::ShouldDisplayDownloadButton() { // The attribute disables the download button. if (MediaElement().ControlsListInternal()->ShouldHideDownload()) { UseCounter::Count(MediaElement().GetDocument(), - UseCounter::kHTMLMediaElementControlsListNoDownload); + WebFeature::kHTMLMediaElementControlsListNoDownload); return false; } diff --git a/third_party/WebKit/Source/modules/mediasource/MediaSource.cpp b/third_party/WebKit/Source/modules/mediasource/MediaSource.cpp index 2e1a75eda33ff1..e492df5aebd3c1 100644 --- a/third_party/WebKit/Source/modules/mediasource/MediaSource.cpp +++ b/third_party/WebKit/Source/modules/mediasource/MediaSource.cpp @@ -545,7 +545,7 @@ void MediaSource::DurationChangeAlgorithm(double new_duration, Deprecation::CountDeprecation( attached_element_->GetDocument(), - UseCounter::kMediaSourceDurationTruncatingBuffered); + WebFeature::kMediaSourceDurationTruncatingBuffered); // See also deprecated remove(new duration, old duration) behavior below. } diff --git a/third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp b/third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp index fdb4fadef3c4a2..f3fad6409a1328 100644 --- a/third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp +++ b/third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp @@ -412,7 +412,7 @@ void SourceBuffer::abort(ExceptionState& exception_state) { } Deprecation::CountDeprecation(source_->MediaElement()->GetDocument(), - UseCounter::kMediaSourceAbortRemove); + WebFeature::kMediaSourceAbortRemove); CancelRemove(); } diff --git a/third_party/WebKit/Source/modules/mediasource/URLMediaSource.cpp b/third_party/WebKit/Source/modules/mediasource/URLMediaSource.cpp index 556d4546424516..2e28dbf9417d20 100644 --- a/third_party/WebKit/Source/modules/mediasource/URLMediaSource.cpp +++ b/third_party/WebKit/Source/modules/mediasource/URLMediaSource.cpp @@ -47,7 +47,7 @@ String URLMediaSource::createObjectURL(ScriptState* script_state, DCHECK(execution_context); DCHECK(source); - UseCounter::Count(execution_context, UseCounter::kCreateObjectURLMediaSource); + UseCounter::Count(execution_context, WebFeature::kCreateObjectURLMediaSource); return DOMURL::CreatePublicURL(execution_context, source); } diff --git a/third_party/WebKit/Source/modules/mediastream/MediaConstraintsImpl.cpp b/third_party/WebKit/Source/modules/mediastream/MediaConstraintsImpl.cpp index 4ed02614fcbf7f..29cbdf45bece89 100644 --- a/third_party/WebKit/Source/modules/mediastream/MediaConstraintsImpl.cpp +++ b/third_party/WebKit/Source/modules/mediastream/MediaConstraintsImpl.cpp @@ -499,7 +499,7 @@ WebMediaConstraints Create(ExecutionContext* context, error_state.ThrowTypeError("Malformed constraints object."); return WebMediaConstraints(); } - UseCounter::Count(context, UseCounter::kMediaStreamConstraintsFromDictionary); + UseCounter::Count(context, WebFeature::kMediaStreamConstraintsFromDictionary); return CreateFromNamedConstraints(context, mandatory, optional, error_state); } @@ -732,7 +732,7 @@ WebMediaConstraints Create(ExecutionContext* context, WebMediaConstraints standard_form = ConvertConstraintsToWeb(constraints_in); if (constraints_in.hasOptional() || constraints_in.hasMandatory()) { if (!standard_form.IsEmpty()) { - UseCounter::Count(context, UseCounter::kMediaStreamConstraintsOldAndNew); + UseCounter::Count(context, WebFeature::kMediaStreamConstraintsOldAndNew); error_state.ThrowTypeError( "Malformed constraint: Cannot use both optional/mandatory and " "specific or advanced constraints."); @@ -744,11 +744,11 @@ WebMediaConstraints Create(ExecutionContext* context, error_state.ThrowTypeError("Malformed constraints object."); return WebMediaConstraints(); } - UseCounter::Count(context, UseCounter::kMediaStreamConstraintsNameValue); + UseCounter::Count(context, WebFeature::kMediaStreamConstraintsNameValue); return CreateFromNamedConstraints(context, mandatory, optional, error_state); } - UseCounter::Count(context, UseCounter::kMediaStreamConstraintsConformant); + UseCounter::Count(context, WebFeature::kMediaStreamConstraintsConformant); return standard_form; } diff --git a/third_party/WebKit/Source/modules/mediastream/MediaStream.cpp b/third_party/WebKit/Source/modules/mediastream/MediaStream.cpp index b232cf7f97f97a..d22178f91ce9ae 100644 --- a/third_party/WebKit/Source/modules/mediastream/MediaStream.cpp +++ b/third_party/WebKit/Source/modules/mediastream/MediaStream.cpp @@ -319,10 +319,10 @@ bool MediaStream::AddEventListenerInternal( EventListener* listener, const AddEventListenerOptionsResolved& options) { if (event_type == EventTypeNames::active) { - UseCounter::Count(GetExecutionContext(), UseCounter::kMediaStreamOnActive); + UseCounter::Count(GetExecutionContext(), WebFeature::kMediaStreamOnActive); } else if (event_type == EventTypeNames::inactive) { UseCounter::Count(GetExecutionContext(), - UseCounter::kMediaStreamOnInactive); + WebFeature::kMediaStreamOnInactive); } return EventTargetWithInlineData::AddEventListenerInternal(event_type, diff --git a/third_party/WebKit/Source/modules/mediastream/URLMediaStream.cpp b/third_party/WebKit/Source/modules/mediastream/URLMediaStream.cpp index 48a9f927bb764a..e50ebcb9eeedad 100644 --- a/third_party/WebKit/Source/modules/mediastream/URLMediaStream.cpp +++ b/third_party/WebKit/Source/modules/mediastream/URLMediaStream.cpp @@ -47,7 +47,7 @@ String URLMediaStream::createObjectURL(ScriptState* script_state, DCHECK(execution_context); DCHECK(stream); - UseCounter::Count(execution_context, UseCounter::kCreateObjectURLMediaStream); + UseCounter::Count(execution_context, WebFeature::kCreateObjectURLMediaStream); return DOMURL::CreatePublicURL(execution_context, stream); } diff --git a/third_party/WebKit/Source/modules/mediastream/UserMediaRequest.cpp b/third_party/WebKit/Source/modules/mediastream/UserMediaRequest.cpp index 503dd846091b7b..a69f4f25438bd9 100644 --- a/third_party/WebKit/Source/modules/mediastream/UserMediaRequest.cpp +++ b/third_party/WebKit/Source/modules/mediastream/UserMediaRequest.cpp @@ -106,7 +106,7 @@ class FeatureCounter { public: FeatureCounter(ExecutionContext* context) : context_(context), is_unconstrained_(true) {} - void Count(UseCounter::Feature feature) { + void Count(WebFeature feature) { UseCounter::Count(context_, feature); is_unconstrained_ = false; } @@ -122,110 +122,110 @@ void CountAudioConstraintUses(ExecutionContext* context, FeatureCounter counter(context); if (RequestUsesNumericConstraint(constraints, &WebMediaTrackConstraintSet::sample_rate)) { - counter.Count(UseCounter::kMediaStreamConstraintsSampleRate); + counter.Count(WebFeature::kMediaStreamConstraintsSampleRate); } if (RequestUsesNumericConstraint(constraints, &WebMediaTrackConstraintSet::sample_size)) { - counter.Count(UseCounter::kMediaStreamConstraintsSampleSize); + counter.Count(WebFeature::kMediaStreamConstraintsSampleSize); } if (RequestUsesDiscreteConstraint( constraints, &WebMediaTrackConstraintSet::echo_cancellation)) { - counter.Count(UseCounter::kMediaStreamConstraintsEchoCancellation); + counter.Count(WebFeature::kMediaStreamConstraintsEchoCancellation); } if (RequestUsesNumericConstraint(constraints, &WebMediaTrackConstraintSet::latency)) { - counter.Count(UseCounter::kMediaStreamConstraintsLatency); + counter.Count(WebFeature::kMediaStreamConstraintsLatency); } if (RequestUsesNumericConstraint( constraints, &WebMediaTrackConstraintSet::channel_count)) { - counter.Count(UseCounter::kMediaStreamConstraintsChannelCount); + counter.Count(WebFeature::kMediaStreamConstraintsChannelCount); } if (RequestUsesDiscreteConstraint(constraints, &WebMediaTrackConstraintSet::device_id)) { - counter.Count(UseCounter::kMediaStreamConstraintsDeviceIdAudio); + counter.Count(WebFeature::kMediaStreamConstraintsDeviceIdAudio); } if (RequestUsesDiscreteConstraint( constraints, &WebMediaTrackConstraintSet::disable_local_echo)) { - counter.Count(UseCounter::kMediaStreamConstraintsDisableLocalEcho); + counter.Count(WebFeature::kMediaStreamConstraintsDisableLocalEcho); } if (RequestUsesDiscreteConstraint(constraints, &WebMediaTrackConstraintSet::group_id)) { - counter.Count(UseCounter::kMediaStreamConstraintsGroupIdAudio); + counter.Count(WebFeature::kMediaStreamConstraintsGroupIdAudio); } if (RequestUsesDiscreteConstraint( constraints, &WebMediaTrackConstraintSet::media_stream_source)) { - counter.Count(UseCounter::kMediaStreamConstraintsMediaStreamSourceAudio); + counter.Count(WebFeature::kMediaStreamConstraintsMediaStreamSourceAudio); } if (RequestUsesDiscreteConstraint( constraints, &WebMediaTrackConstraintSet::render_to_associated_sink)) { - counter.Count(UseCounter::kMediaStreamConstraintsRenderToAssociatedSink); + counter.Count(WebFeature::kMediaStreamConstraintsRenderToAssociatedSink); } if (RequestUsesDiscreteConstraint( constraints, &WebMediaTrackConstraintSet::hotword_enabled)) { - counter.Count(UseCounter::kMediaStreamConstraintsHotwordEnabled); + counter.Count(WebFeature::kMediaStreamConstraintsHotwordEnabled); } if (RequestUsesDiscreteConstraint( constraints, &WebMediaTrackConstraintSet::goog_echo_cancellation)) { - counter.Count(UseCounter::kMediaStreamConstraintsGoogEchoCancellation); + counter.Count(WebFeature::kMediaStreamConstraintsGoogEchoCancellation); } if (RequestUsesDiscreteConstraint( constraints, &WebMediaTrackConstraintSet::goog_experimental_echo_cancellation)) { counter.Count( - UseCounter::kMediaStreamConstraintsGoogExperimentalEchoCancellation); + WebFeature::kMediaStreamConstraintsGoogExperimentalEchoCancellation); } if (RequestUsesDiscreteConstraint( constraints, &WebMediaTrackConstraintSet::goog_auto_gain_control)) { - counter.Count(UseCounter::kMediaStreamConstraintsGoogAutoGainControl); + counter.Count(WebFeature::kMediaStreamConstraintsGoogAutoGainControl); } if (RequestUsesDiscreteConstraint( constraints, &WebMediaTrackConstraintSet::goog_experimental_auto_gain_control)) { counter.Count( - UseCounter::kMediaStreamConstraintsGoogExperimentalAutoGainControl); + WebFeature::kMediaStreamConstraintsGoogExperimentalAutoGainControl); } if (RequestUsesDiscreteConstraint( constraints, &WebMediaTrackConstraintSet::goog_noise_suppression)) { - counter.Count(UseCounter::kMediaStreamConstraintsGoogNoiseSuppression); + counter.Count(WebFeature::kMediaStreamConstraintsGoogNoiseSuppression); } if (RequestUsesDiscreteConstraint( constraints, &WebMediaTrackConstraintSet::goog_highpass_filter)) { - counter.Count(UseCounter::kMediaStreamConstraintsGoogHighpassFilter); + counter.Count(WebFeature::kMediaStreamConstraintsGoogHighpassFilter); } if (RequestUsesDiscreteConstraint( constraints, &WebMediaTrackConstraintSet::goog_typing_noise_detection)) { - counter.Count(UseCounter::kMediaStreamConstraintsGoogTypingNoiseDetection); + counter.Count(WebFeature::kMediaStreamConstraintsGoogTypingNoiseDetection); } if (RequestUsesDiscreteConstraint( constraints, &WebMediaTrackConstraintSet::goog_experimental_noise_suppression)) { counter.Count( - UseCounter::kMediaStreamConstraintsGoogExperimentalNoiseSuppression); + WebFeature::kMediaStreamConstraintsGoogExperimentalNoiseSuppression); } if (RequestUsesDiscreteConstraint( constraints, &WebMediaTrackConstraintSet::goog_beamforming)) { - counter.Count(UseCounter::kMediaStreamConstraintsGoogBeamforming); + counter.Count(WebFeature::kMediaStreamConstraintsGoogBeamforming); } if (RequestUsesDiscreteConstraint( constraints, &WebMediaTrackConstraintSet::goog_array_geometry)) { - counter.Count(UseCounter::kMediaStreamConstraintsGoogArrayGeometry); + counter.Count(WebFeature::kMediaStreamConstraintsGoogArrayGeometry); } if (RequestUsesDiscreteConstraint( constraints, &WebMediaTrackConstraintSet::goog_audio_mirroring)) { - counter.Count(UseCounter::kMediaStreamConstraintsGoogAudioMirroring); + counter.Count(WebFeature::kMediaStreamConstraintsGoogAudioMirroring); } if (RequestUsesDiscreteConstraint( constraints, &WebMediaTrackConstraintSet::goog_da_echo_cancellation)) { - counter.Count(UseCounter::kMediaStreamConstraintsGoogDAEchoCancellation); + counter.Count(WebFeature::kMediaStreamConstraintsGoogDAEchoCancellation); } - UseCounter::Count(context, UseCounter::kMediaStreamConstraintsAudio); + UseCounter::Count(context, WebFeature::kMediaStreamConstraintsAudio); if (counter.IsUnconstrained()) { UseCounter::Count(context, - UseCounter::kMediaStreamConstraintsAudioUnconstrained); + WebFeature::kMediaStreamConstraintsAudioUnconstrained); } } @@ -234,70 +234,70 @@ void CountVideoConstraintUses(ExecutionContext* context, FeatureCounter counter(context); if (RequestUsesNumericConstraint(constraints, &WebMediaTrackConstraintSet::width)) { - counter.Count(UseCounter::kMediaStreamConstraintsWidth); + counter.Count(WebFeature::kMediaStreamConstraintsWidth); } if (RequestUsesNumericConstraint(constraints, &WebMediaTrackConstraintSet::height)) { - counter.Count(UseCounter::kMediaStreamConstraintsHeight); + counter.Count(WebFeature::kMediaStreamConstraintsHeight); } if (RequestUsesNumericConstraint(constraints, &WebMediaTrackConstraintSet::aspect_ratio)) { - counter.Count(UseCounter::kMediaStreamConstraintsAspectRatio); + counter.Count(WebFeature::kMediaStreamConstraintsAspectRatio); } if (RequestUsesNumericConstraint(constraints, &WebMediaTrackConstraintSet::frame_rate)) { - counter.Count(UseCounter::kMediaStreamConstraintsFrameRate); + counter.Count(WebFeature::kMediaStreamConstraintsFrameRate); } if (RequestUsesDiscreteConstraint(constraints, &WebMediaTrackConstraintSet::facing_mode)) { - counter.Count(UseCounter::kMediaStreamConstraintsFacingMode); + counter.Count(WebFeature::kMediaStreamConstraintsFacingMode); } if (RequestUsesDiscreteConstraint(constraints, &WebMediaTrackConstraintSet::device_id)) { - counter.Count(UseCounter::kMediaStreamConstraintsDeviceIdVideo); + counter.Count(WebFeature::kMediaStreamConstraintsDeviceIdVideo); } if (RequestUsesDiscreteConstraint(constraints, &WebMediaTrackConstraintSet::group_id)) { - counter.Count(UseCounter::kMediaStreamConstraintsGroupIdVideo); + counter.Count(WebFeature::kMediaStreamConstraintsGroupIdVideo); } if (RequestUsesDiscreteConstraint(constraints, &WebMediaTrackConstraintSet::video_kind)) { - counter.Count(UseCounter::kMediaStreamConstraintsVideoKind); + counter.Count(WebFeature::kMediaStreamConstraintsVideoKind); } if (RequestUsesNumericConstraint(constraints, &WebMediaTrackConstraintSet::depth_near)) { - counter.Count(UseCounter::kMediaStreamConstraintsDepthNear); + counter.Count(WebFeature::kMediaStreamConstraintsDepthNear); } if (RequestUsesNumericConstraint(constraints, &WebMediaTrackConstraintSet::depth_far)) { - counter.Count(UseCounter::kMediaStreamConstraintsDepthFar); + counter.Count(WebFeature::kMediaStreamConstraintsDepthFar); } if (RequestUsesNumericConstraint( constraints, &WebMediaTrackConstraintSet::focal_length_x)) { - counter.Count(UseCounter::kMediaStreamConstraintsFocalLengthX); + counter.Count(WebFeature::kMediaStreamConstraintsFocalLengthX); } if (RequestUsesNumericConstraint( constraints, &WebMediaTrackConstraintSet::focal_length_y)) { - counter.Count(UseCounter::kMediaStreamConstraintsFocalLengthY); + counter.Count(WebFeature::kMediaStreamConstraintsFocalLengthY); } if (RequestUsesDiscreteConstraint( constraints, &WebMediaTrackConstraintSet::media_stream_source)) { - counter.Count(UseCounter::kMediaStreamConstraintsMediaStreamSourceVideo); + counter.Count(WebFeature::kMediaStreamConstraintsMediaStreamSourceVideo); } if (RequestUsesDiscreteConstraint( constraints, &WebMediaTrackConstraintSet::goog_noise_reduction)) { - counter.Count(UseCounter::kMediaStreamConstraintsGoogNoiseReduction); + counter.Count(WebFeature::kMediaStreamConstraintsGoogNoiseReduction); } if (RequestUsesNumericConstraint( constraints, &WebMediaTrackConstraintSet::goog_power_line_frequency)) { - counter.Count(UseCounter::kMediaStreamConstraintsGoogPowerLineFrequency); + counter.Count(WebFeature::kMediaStreamConstraintsGoogPowerLineFrequency); } - UseCounter::Count(context, UseCounter::kMediaStreamConstraintsVideo); + UseCounter::Count(context, WebFeature::kMediaStreamConstraintsVideo); if (counter.IsUnconstrained()) { UseCounter::Count(context, - UseCounter::kMediaStreamConstraintsVideoUnconstrained); + WebFeature::kMediaStreamConstraintsVideoUnconstrained); } } @@ -399,9 +399,9 @@ bool UserMediaRequest::IsSecureContextUse(String& error_message) { if (document->IsSecureContext(error_message)) { UseCounter::Count(document->GetFrame(), - UseCounter::kGetUserMediaSecureOrigin); + WebFeature::kGetUserMediaSecureOrigin); UseCounter::CountCrossOriginIframe( - *document, UseCounter::kGetUserMediaSecureOriginIframe); + *document, WebFeature::kGetUserMediaSecureOriginIframe); HostsUsingFeatures::CountAnyWorld( *document, HostsUsingFeatures::Feature::kGetUserMediaSecureHost); return true; @@ -410,9 +410,9 @@ bool UserMediaRequest::IsSecureContextUse(String& error_message) { // While getUserMedia is blocked on insecure origins, we still want to // count attempts to use it. Deprecation::CountDeprecation(document->GetFrame(), - UseCounter::kGetUserMediaInsecureOrigin); + WebFeature::kGetUserMediaInsecureOrigin); Deprecation::CountDeprecationCrossOriginIframe( - *document, UseCounter::kGetUserMediaInsecureOriginIframe); + *document, WebFeature::kGetUserMediaInsecureOriginIframe); HostsUsingFeatures::CountAnyWorld( *document, HostsUsingFeatures::Feature::kGetUserMediaInsecureHost); return false; diff --git a/third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp b/third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp index 384e7fbeafcf13..9c184c33f1f431 100644 --- a/third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp +++ b/third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp @@ -158,8 +158,8 @@ void NavigatorContentUtils::registerProtocolHandler( // Count usage; perhaps we can lock this to secure contexts. UseCounter::Count(*document, document->IsSecureContext() - ? UseCounter::kRegisterProtocolHandlerSecureOrigin - : UseCounter::kRegisterProtocolHandlerInsecureOrigin); + ? WebFeature::kRegisterProtocolHandlerSecureOrigin + : WebFeature::kRegisterProtocolHandlerInsecureOrigin); NavigatorContentUtils::From(navigator)->Client()->RegisterProtocolHandler( scheme, document->CompleteURL(url), title); diff --git a/third_party/WebKit/Source/modules/notifications/Notification.cpp b/third_party/WebKit/Source/modules/notifications/Notification.cpp index a6bc3b4cd644cf..85455f6876f492 100644 --- a/third_party/WebKit/Source/modules/notifications/Notification.cpp +++ b/third_party/WebKit/Source/modules/notifications/Notification.cpp @@ -95,18 +95,18 @@ Notification* Notification::Create(ExecutionContext* context, } if (context->IsSecureContext()) { - UseCounter::Count(context, UseCounter::kNotificationSecureOrigin); + UseCounter::Count(context, WebFeature::kNotificationSecureOrigin); if (context->IsDocument()) { UseCounter::CountCrossOriginIframe( - *ToDocument(context), UseCounter::kNotificationAPISecureOriginIframe); + *ToDocument(context), WebFeature::kNotificationAPISecureOriginIframe); } } else { Deprecation::CountDeprecation(context, - UseCounter::kNotificationInsecureOrigin); + WebFeature::kNotificationInsecureOrigin); if (context->IsDocument()) { Deprecation::CountDeprecationCrossOriginIframe( *ToDocument(context), - UseCounter::kNotificationAPIInsecureOriginIframe); + WebFeature::kNotificationAPIInsecureOriginIframe); } } @@ -367,14 +367,14 @@ ScriptPromise Notification::requestPermission( ExecutionContext* context = ExecutionContext::From(script_state); if (!context->IsSecureContext()) { Deprecation::CountDeprecation( - context, UseCounter::kNotificationPermissionRequestedInsecureOrigin); + context, WebFeature::kNotificationPermissionRequestedInsecureOrigin); } if (context->IsDocument()) { LocalFrame* frame = ToDocument(context)->GetFrame(); if (frame && !frame->IsMainFrame()) { Deprecation::CountDeprecation( - context, UseCounter::kNotificationPermissionRequestedIframe); + context, WebFeature::kNotificationPermissionRequestedIframe); } } diff --git a/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp b/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp index 2d6f0e274419c8..6cfb6ec065b084 100644 --- a/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp +++ b/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp @@ -47,7 +47,7 @@ DEFINE_TRACE(OffscreenCanvasRenderingContext2D) { ScriptPromise OffscreenCanvasRenderingContext2D::commit( ScriptState* script_state, ExceptionState& exception_state) { - UseCounter::Feature feature = UseCounter::kOffscreenCanvasCommit2D; + WebFeature feature = WebFeature::kOffscreenCanvasCommit2D; UseCounter::Count(ExecutionContext::From(script_state), feature); bool is_web_gl_software_rendering = false; SkIRect damage_rect(dirty_rect_for_commit_); @@ -116,8 +116,7 @@ OffscreenCanvasRenderingContext2D::TransferToStaticBitmapImage() { ImageBitmap* OffscreenCanvasRenderingContext2D::TransferToImageBitmap( ScriptState* script_state) { - UseCounter::Feature feature = - UseCounter::kOffscreenCanvasTransferToImageBitmap2D; + WebFeature feature = WebFeature::kOffscreenCanvasTransferToImageBitmap2D; UseCounter::Count(ExecutionContext::From(script_state), feature); RefPtr image = TransferToStaticBitmapImage(); if (!image) diff --git a/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp b/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp index 6eb14f07aea9c1..e1fd1593ce9290 100644 --- a/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp +++ b/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp @@ -534,7 +534,7 @@ void StringifyAndParseMethodSpecificData( if (supported_methods.Contains(kBasicCardNetworks[i].name)) { Deprecation::CountDeprecation( &execution_context, - UseCounter::kPaymentRequestNetworkNameInSupportedMethods); + WebFeature::kPaymentRequestNetworkNameInSupportedMethods); break; } } diff --git a/third_party/WebKit/Source/modules/peerconnection/RTCIceCandidate.cpp b/third_party/WebKit/Source/modules/peerconnection/RTCIceCandidate.cpp index caa1526bec9a28..86c6c118195fac 100644 --- a/third_party/WebKit/Source/modules/peerconnection/RTCIceCandidate.cpp +++ b/third_party/WebKit/Source/modules/peerconnection/RTCIceCandidate.cpp @@ -62,7 +62,7 @@ RTCIceCandidate* RTCIceCandidate::Create( sdp_m_line_index = candidate_init.sdpMLineIndex(); } else { UseCounter::Count(context, - UseCounter::kRTCIceCandidateDefaultSdpMLineIndex); + WebFeature::kRTCIceCandidateDefaultSdpMLineIndex); } return new RTCIceCandidate(WebRTCICECandidate(candidate_init.candidate(), diff --git a/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp b/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp index 32f99046dab023..97b35c5735e3ea 100644 --- a/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp +++ b/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp @@ -192,7 +192,7 @@ WebRTCICECandidate ConvertToWebRTCIceCandidate( sdp_m_line_index = ice_candidate_init.sdpMLineIndex(); } else { UseCounter::Count(context, - UseCounter::kRTCIceCandidateDefaultSdpMLineIndex); + WebFeature::kRTCIceCandidateDefaultSdpMLineIndex); } return WebRTCICECandidate(ice_candidate_init.candidate(), ice_candidate_init.sdpMid(), sdp_m_line_index); @@ -240,11 +240,11 @@ WebRTCConfiguration ParseConfiguration(ExecutionContext* context, WebRTCIceTransportPolicy ice_transport_policy = WebRTCIceTransportPolicy::kAll; if (configuration.hasIceTransportPolicy()) { - UseCounter::Count(context, UseCounter::kRTCConfigurationIceTransportPolicy); + UseCounter::Count(context, WebFeature::kRTCConfigurationIceTransportPolicy); ice_transport_policy = IceTransportPolicyFromString(configuration.iceTransportPolicy()); } else if (configuration.hasIceTransports()) { - UseCounter::Count(context, UseCounter::kRTCConfigurationIceTransports); + UseCounter::Count(context, WebFeature::kRTCConfigurationIceTransports); ice_transport_policy = IceTransportPolicyFromString(configuration.iceTransports()); } @@ -263,7 +263,7 @@ WebRTCConfiguration ParseConfiguration(ExecutionContext* context, String rtcp_mux_policy_string = configuration.rtcpMuxPolicy(); if (rtcp_mux_policy_string == "negotiate") { rtcp_mux_policy = WebRTCRtcpMuxPolicy::kNegotiate; - Deprecation::CountDeprecation(context, UseCounter::kRtcpMuxPolicyNegotiate); + Deprecation::CountDeprecation(context, WebFeature::kRtcpMuxPolicyNegotiate); } else { DCHECK_EQ(rtcp_mux_policy_string, "require"); } @@ -277,7 +277,7 @@ WebRTCConfiguration ParseConfiguration(ExecutionContext* context, for (const RTCIceServer& ice_server : configuration.iceServers()) { Vector url_strings; if (ice_server.hasURLs()) { - UseCounter::Count(context, UseCounter::kRTCIceServerURLs); + UseCounter::Count(context, WebFeature::kRTCIceServerURLs); const StringOrStringSequence& urls = ice_server.urls(); if (urls.isString()) { url_strings.push_back(urls.getAsString()); @@ -286,7 +286,7 @@ WebRTCConfiguration ParseConfiguration(ExecutionContext* context, url_strings = urls.getAsStringSequence(); } } else if (ice_server.hasURL()) { - UseCounter::Count(context, UseCounter::kRTCIceServerURL); + UseCounter::Count(context, WebFeature::kRTCIceServerURL); url_strings.push_back(ice_server.url()); } else { exception_state.ThrowTypeError("Malformed RTCIceServer"); @@ -435,10 +435,10 @@ RTCPeerConnection* RTCPeerConnection::Create( ExceptionState& exception_state) { if (media_constraints.IsObject()) { UseCounter::Count(context, - UseCounter::kRTCPeerConnectionConstructorConstraints); + WebFeature::kRTCPeerConnectionConstructorConstraints); } else { UseCounter::Count(context, - UseCounter::kRTCPeerConnectionConstructorCompliant); + WebFeature::kRTCPeerConnectionConstructorCompliant); } WebRTCConfiguration configuration = @@ -561,7 +561,7 @@ ScriptPromise RTCPeerConnection::createOffer(ScriptState* script_state, ExecutionContext* context = ExecutionContext::From(script_state); UseCounter::Count( context, - UseCounter::kRTCPeerConnectionCreateOfferOptionsOfferToReceive); + WebFeature::kRTCPeerConnectionCreateOfferOptionsOfferToReceive); } peer_handler_->CreateOffer(request, ConvertToWebRTCOfferOptions(options)); return promise; @@ -577,7 +577,7 @@ ScriptPromise RTCPeerConnection::createOffer( DCHECK(error_callback); ExecutionContext* context = ExecutionContext::From(script_state); UseCounter::Count( - context, UseCounter::kRTCPeerConnectionCreateOfferLegacyFailureCallback); + context, WebFeature::kRTCPeerConnectionCreateOfferLegacyFailureCallback); if (CallErrorCallbackIfSignalingStateClosed(signaling_state_, error_callback)) return ScriptPromise::CastUndefined(script_state); @@ -593,10 +593,10 @@ ScriptPromise RTCPeerConnection::createOffer( if (offer_options->OfferToReceiveAudio() != -1 || offer_options->OfferToReceiveVideo() != -1) { UseCounter::Count( - context, UseCounter::kRTCPeerConnectionCreateOfferLegacyOfferOptions); + context, WebFeature::kRTCPeerConnectionCreateOfferLegacyOfferOptions); } else { UseCounter::Count( - context, UseCounter::kRTCPeerConnectionCreateOfferLegacyCompliant); + context, WebFeature::kRTCPeerConnectionCreateOfferLegacyCompliant); } peer_handler_->CreateOffer(request, WebRTCOfferOptions(offer_options)); @@ -616,10 +616,10 @@ ScriptPromise RTCPeerConnection::createOffer( if (!constraints.IsEmpty()) { UseCounter::Count( - context, UseCounter::kRTCPeerConnectionCreateOfferLegacyConstraints); + context, WebFeature::kRTCPeerConnectionCreateOfferLegacyConstraints); } else { UseCounter::Count( - context, UseCounter::kRTCPeerConnectionCreateOfferLegacyCompliant); + context, WebFeature::kRTCPeerConnectionCreateOfferLegacyCompliant); } peer_handler_->CreateOffer(request, constraints); @@ -652,13 +652,13 @@ ScriptPromise RTCPeerConnection::createAnswer( DCHECK(error_callback); ExecutionContext* context = ExecutionContext::From(script_state); UseCounter::Count( - context, UseCounter::kRTCPeerConnectionCreateAnswerLegacyFailureCallback); + context, WebFeature::kRTCPeerConnectionCreateAnswerLegacyFailureCallback); if (media_constraints.IsObject()) { UseCounter::Count( - context, UseCounter::kRTCPeerConnectionCreateAnswerLegacyConstraints); + context, WebFeature::kRTCPeerConnectionCreateAnswerLegacyConstraints); } else { UseCounter::Count( - context, UseCounter::kRTCPeerConnectionCreateAnswerLegacyCompliant); + context, WebFeature::kRTCPeerConnectionCreateAnswerLegacyCompliant); } if (CallErrorCallbackIfSignalingStateClosed(signaling_state_, error_callback)) @@ -710,17 +710,17 @@ ScriptPromise RTCPeerConnection::setLocalDescription( if (success_callback && error_callback) { UseCounter::Count( context, - UseCounter::kRTCPeerConnectionSetLocalDescriptionLegacyCompliant); + WebFeature::kRTCPeerConnectionSetLocalDescriptionLegacyCompliant); } else { if (!success_callback) UseCounter::Count( context, - UseCounter:: + WebFeature:: kRTCPeerConnectionSetLocalDescriptionLegacyNoSuccessCallback); if (!error_callback) UseCounter::Count( context, - UseCounter:: + WebFeature:: kRTCPeerConnectionSetLocalDescriptionLegacyNoFailureCallback); } @@ -770,17 +770,17 @@ ScriptPromise RTCPeerConnection::setRemoteDescription( if (success_callback && error_callback) { UseCounter::Count( context, - UseCounter::kRTCPeerConnectionSetRemoteDescriptionLegacyCompliant); + WebFeature::kRTCPeerConnectionSetRemoteDescriptionLegacyCompliant); } else { if (!success_callback) UseCounter::Count( context, - UseCounter:: + WebFeature:: kRTCPeerConnectionSetRemoteDescriptionLegacyNoSuccessCallback); if (!error_callback) UseCounter::Count( context, - UseCounter:: + WebFeature:: kRTCPeerConnectionSetRemoteDescriptionLegacyNoFailureCallback); } @@ -1166,7 +1166,7 @@ ScriptPromise RTCPeerConnection::getStats(ScriptState* script_state, ScriptPromise promise = resolver->Promise(); UseCounter::Count(context, - UseCounter::kRTCPeerConnectionGetStatsLegacyNonCompliant); + WebFeature::kRTCPeerConnectionGetStatsLegacyNonCompliant); RTCStatsRequest* stats_request = RTCStatsRequestImpl::Create( GetExecutionContext(), this, success_callback, selector); // FIXME: Add passing selector as part of the statsRequest. @@ -1178,7 +1178,7 @@ ScriptPromise RTCPeerConnection::getStats(ScriptState* script_state, ScriptPromise RTCPeerConnection::getStats(ScriptState* script_state) { ExecutionContext* context = ExecutionContext::From(script_state); - UseCounter::Count(context, UseCounter::kRTCPeerConnectionGetStats); + UseCounter::Count(context, WebFeature::kRTCPeerConnectionGetStats); ScriptPromiseResolver* resolver = ScriptPromiseResolver::Create(script_state); ScriptPromise promise = resolver->Promise(); @@ -1251,12 +1251,12 @@ RTCDataChannel* RTCPeerConnection::createDataChannel( if (data_channel_dict.hasMaxRetransmitTime()) { UseCounter::Count( context, - UseCounter::kRTCPeerConnectionCreateDataChannelMaxRetransmitTime); + WebFeature::kRTCPeerConnectionCreateDataChannelMaxRetransmitTime); init.max_retransmit_time = data_channel_dict.maxRetransmitTime(); } if (data_channel_dict.hasMaxRetransmits()) { UseCounter::Count( - context, UseCounter::kRTCPeerConnectionCreateDataChannelMaxRetransmits); + context, WebFeature::kRTCPeerConnectionCreateDataChannelMaxRetransmits); init.max_retransmits = data_channel_dict.maxRetransmits(); } init.protocol = data_channel_dict.protocol(); diff --git a/third_party/WebKit/Source/modules/peerconnection/RTCSessionDescription.cpp b/third_party/WebKit/Source/modules/peerconnection/RTCSessionDescription.cpp index 9986c688223cff..b9e3d05f05f4f3 100644 --- a/third_party/WebKit/Source/modules/peerconnection/RTCSessionDescription.cpp +++ b/third_party/WebKit/Source/modules/peerconnection/RTCSessionDescription.cpp @@ -45,13 +45,13 @@ RTCSessionDescription* RTCSessionDescription::Create( if (description_init_dict.hasType()) type = description_init_dict.type(); else - UseCounter::Count(context, UseCounter::kRTCSessionDescriptionInitNoType); + UseCounter::Count(context, WebFeature::kRTCSessionDescriptionInitNoType); String sdp; if (description_init_dict.hasSdp()) sdp = description_init_dict.sdp(); else - UseCounter::Count(context, UseCounter::kRTCSessionDescriptionInitNoSdp); + UseCounter::Count(context, WebFeature::kRTCSessionDescriptionInitNoSdp); return new RTCSessionDescription(WebRTCSessionDescription(type, sdp)); } diff --git a/third_party/WebKit/Source/modules/presentation/PresentationAvailability.cpp b/third_party/WebKit/Source/modules/presentation/PresentationAvailability.cpp index ec418b1c651a39..81e0c2879de82b 100644 --- a/third_party/WebKit/Source/modules/presentation/PresentationAvailability.cpp +++ b/third_party/WebKit/Source/modules/presentation/PresentationAvailability.cpp @@ -63,7 +63,7 @@ void PresentationAvailability::AddedEventListener( registered_listener); if (event_type == EventTypeNames::change) { UseCounter::Count(GetExecutionContext(), - UseCounter::kPresentationAvailabilityChangeEventListener); + WebFeature::kPresentationAvailabilityChangeEventListener); } } diff --git a/third_party/WebKit/Source/modules/presentation/PresentationConnection.cpp b/third_party/WebKit/Source/modules/presentation/PresentationConnection.cpp index 66fd5d25c36e0c..6a8a8aae222c9a 100644 --- a/third_party/WebKit/Source/modules/presentation/PresentationConnection.cpp +++ b/third_party/WebKit/Source/modules/presentation/PresentationConnection.cpp @@ -227,17 +227,17 @@ void PresentationConnection::AddedEventListener( registered_listener); if (event_type == EventTypeNames::connect) { UseCounter::Count(GetExecutionContext(), - UseCounter::kPresentationConnectionConnectEventListener); + WebFeature::kPresentationConnectionConnectEventListener); } else if (event_type == EventTypeNames::close) { UseCounter::Count(GetExecutionContext(), - UseCounter::kPresentationConnectionCloseEventListener); + WebFeature::kPresentationConnectionCloseEventListener); } else if (event_type == EventTypeNames::terminate) { UseCounter::Count( GetExecutionContext(), - UseCounter::kPresentationConnectionTerminateEventListener); + WebFeature::kPresentationConnectionTerminateEventListener); } else if (event_type == EventTypeNames::message) { UseCounter::Count(GetExecutionContext(), - UseCounter::kPresentationConnectionMessageEventListener); + WebFeature::kPresentationConnectionMessageEventListener); } } diff --git a/third_party/WebKit/Source/modules/presentation/PresentationConnectionList.cpp b/third_party/WebKit/Source/modules/presentation/PresentationConnectionList.cpp index ff37b72420f4f8..996668177fd097 100644 --- a/third_party/WebKit/Source/modules/presentation/PresentationConnectionList.cpp +++ b/third_party/WebKit/Source/modules/presentation/PresentationConnectionList.cpp @@ -32,7 +32,7 @@ void PresentationConnectionList::AddedEventListener( if (event_type == EventTypeNames::connectionavailable) { UseCounter::Count( GetExecutionContext(), - UseCounter::kPresentationRequestConnectionAvailableEventListener); + WebFeature::kPresentationRequestConnectionAvailableEventListener); } } diff --git a/third_party/WebKit/Source/modules/presentation/PresentationReceiver.cpp b/third_party/WebKit/Source/modules/presentation/PresentationReceiver.cpp index 487cffeb85d43e..766753bb9cf41d 100644 --- a/third_party/WebKit/Source/modules/presentation/PresentationReceiver.cpp +++ b/third_party/WebKit/Source/modules/presentation/PresentationReceiver.cpp @@ -116,10 +116,10 @@ void PresentationReceiver::RegisterConnection( void PresentationReceiver::RecordOriginTypeAccess(Document* document) const { DCHECK(document); if (document->IsSecureContext()) { - UseCounter::Count(document, UseCounter::kPresentationReceiverSecureOrigin); + UseCounter::Count(document, WebFeature::kPresentationReceiverSecureOrigin); } else { UseCounter::Count(document, - UseCounter::kPresentationReceiverInsecureOrigin); + WebFeature::kPresentationReceiverInsecureOrigin); } } diff --git a/third_party/WebKit/Source/modules/presentation/PresentationRequest.cpp b/third_party/WebKit/Source/modules/presentation/PresentationRequest.cpp index 06ae662676ec27..aa5cbbd8a2f2c4 100644 --- a/third_party/WebKit/Source/modules/presentation/PresentationRequest.cpp +++ b/third_party/WebKit/Source/modules/presentation/PresentationRequest.cpp @@ -103,7 +103,7 @@ void PresentationRequest::AddedEventListener( if (event_type == EventTypeNames::connectionavailable) { UseCounter::Count( GetExecutionContext(), - UseCounter::kPresentationRequestConnectionAvailableEventListener); + WebFeature::kPresentationRequestConnectionAvailableEventListener); } } @@ -224,10 +224,10 @@ void PresentationRequest::RecordOriginTypeAccess( DCHECK(execution_context); if (execution_context->IsSecureContext()) { UseCounter::Count(execution_context, - UseCounter::kPresentationRequestSecureOrigin); + WebFeature::kPresentationRequestSecureOrigin); } else { UseCounter::Count(execution_context, - UseCounter::kPresentationRequestInsecureOrigin); + WebFeature::kPresentationRequestInsecureOrigin); } } diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.cpp b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.cpp index c1565e73f4cff3..fd07fda91eed53 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.cpp +++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.cpp @@ -438,7 +438,7 @@ void ServiceWorkerContainer::SetController( WTF::WrapUnique(handle.release())); if (controller_) { UseCounter::Count(GetExecutionContext(), - UseCounter::kServiceWorkerControlledPage); + WebFeature::kServiceWorkerControlledPage); } if (should_notify_controller_change) DispatchEvent(Event::Create(EventTypeNames::controllerchange)); @@ -464,8 +464,7 @@ void ServiceWorkerContainer::DispatchMessageEvent( void ServiceWorkerContainer::CountFeature(uint32_t feature) { if (!GetExecutionContext()) return; - UseCounter::Feature use_counter_feature = - static_cast(feature); + WebFeature use_counter_feature = static_cast(feature); if (Deprecation::DeprecationMessage(use_counter_feature).IsEmpty()) UseCounter::Count(GetExecutionContext(), use_counter_feature); else diff --git a/third_party/WebKit/Source/modules/vibration/NavigatorVibration.cpp b/third_party/WebKit/Source/modules/vibration/NavigatorVibration.cpp index 51bb7110b34fc9..ac818832e98bd9 100644 --- a/third_party/WebKit/Source/modules/vibration/NavigatorVibration.cpp +++ b/third_party/WebKit/Source/modules/vibration/NavigatorVibration.cpp @@ -107,7 +107,7 @@ bool NavigatorVibration::vibrate(Navigator& navigator, } else { // Just shows the deprecation message in M59. level = kWarningMessageLevel; Deprecation::CountDeprecation(frame, - UseCounter::kVibrateWithoutUserGesture); + WebFeature::kVibrateWithoutUserGesture); } if (level == kErrorMessageLevel) { @@ -125,9 +125,9 @@ bool NavigatorVibration::vibrate(Navigator& navigator, void NavigatorVibration::CollectHistogramMetrics(const LocalFrame& frame) { NavigatorVibrationType type; bool user_gesture = frame.HasReceivedUserGesture(); - UseCounter::Count(&frame, UseCounter::kNavigatorVibrate); + UseCounter::Count(&frame, WebFeature::kNavigatorVibrate); if (!frame.IsMainFrame()) { - UseCounter::Count(&frame, UseCounter::kNavigatorVibrateSubFrame); + UseCounter::Count(&frame, WebFeature::kNavigatorVibrateSubFrame); if (frame.IsCrossOriginSubframe()) { if (user_gesture) type = NavigatorVibrationType::kCrossOriginSubFrameWithUserGesture; @@ -151,22 +151,22 @@ void NavigatorVibration::CollectHistogramMetrics(const LocalFrame& frame) { switch (frame.GetDocument()->GetEngagementLevel()) { case mojom::blink::EngagementLevel::NONE: - UseCounter::Count(&frame, UseCounter::kNavigatorVibrateEngagementNone); + UseCounter::Count(&frame, WebFeature::kNavigatorVibrateEngagementNone); break; case mojom::blink::EngagementLevel::MINIMAL: - UseCounter::Count(&frame, UseCounter::kNavigatorVibrateEngagementMinimal); + UseCounter::Count(&frame, WebFeature::kNavigatorVibrateEngagementMinimal); break; case mojom::blink::EngagementLevel::LOW: - UseCounter::Count(&frame, UseCounter::kNavigatorVibrateEngagementLow); + UseCounter::Count(&frame, WebFeature::kNavigatorVibrateEngagementLow); break; case mojom::blink::EngagementLevel::MEDIUM: - UseCounter::Count(&frame, UseCounter::kNavigatorVibrateEngagementMedium); + UseCounter::Count(&frame, WebFeature::kNavigatorVibrateEngagementMedium); break; case mojom::blink::EngagementLevel::HIGH: - UseCounter::Count(&frame, UseCounter::kNavigatorVibrateEngagementHigh); + UseCounter::Count(&frame, WebFeature::kNavigatorVibrateEngagementHigh); break; case mojom::blink::EngagementLevel::MAX: - UseCounter::Count(&frame, UseCounter::kNavigatorVibrateEngagementMax); + UseCounter::Count(&frame, WebFeature::kNavigatorVibrateEngagementMax); break; } } diff --git a/third_party/WebKit/Source/modules/vr/NavigatorVR.cpp b/third_party/WebKit/Source/modules/vr/NavigatorVR.cpp index 6de2c23a948de4..f6baae6e9f01bf 100644 --- a/third_party/WebKit/Source/modules/vr/NavigatorVR.cpp +++ b/third_party/WebKit/Source/modules/vr/NavigatorVR.cpp @@ -73,10 +73,10 @@ ScriptPromise NavigatorVR::getVRDisplays(ScriptState* script_state) { return promise; } - UseCounter::Count(*GetDocument(), UseCounter::kVRGetDisplays); + UseCounter::Count(*GetDocument(), WebFeature::kVRGetDisplays); ExecutionContext* execution_context = ExecutionContext::From(script_state); if (!execution_context->IsSecureContext()) - UseCounter::Count(*GetDocument(), UseCounter::kVRGetDisplaysInsecureOrigin); + UseCounter::Count(*GetDocument(), WebFeature::kVRGetDisplaysInsecureOrigin); Platform::Current()->RecordRapporURL("VR.WebVR.GetDisplays", GetDocument()->Url()); diff --git a/third_party/WebKit/Source/modules/vr/VRDisplay.cpp b/third_party/WebKit/Source/modules/vr/VRDisplay.cpp index 88c0b5c41412c1..1a53ff5eac9e38 100644 --- a/third_party/WebKit/Source/modules/vr/VRDisplay.cpp +++ b/third_party/WebKit/Source/modules/vr/VRDisplay.cpp @@ -226,10 +226,10 @@ ScriptPromise VRDisplay::requestPresent(ScriptState* script_state, const HeapVector& layers) { DVLOG(1) << __FUNCTION__; ExecutionContext* execution_context = ExecutionContext::From(script_state); - UseCounter::Count(execution_context, UseCounter::kVRRequestPresent); + UseCounter::Count(execution_context, WebFeature::kVRRequestPresent); if (!execution_context->IsSecureContext()) { UseCounter::Count(execution_context, - UseCounter::kVRRequestPresentInsecureOrigin); + WebFeature::kVRRequestPresentInsecureOrigin); } ReportPresentationResult(PresentationResult::kRequested); diff --git a/third_party/WebKit/Source/modules/webaudio/AudioContext.cpp b/third_party/WebKit/Source/modules/webaudio/AudioContext.cpp index f0a5e2f03d36e2..a30318d085da1f 100644 --- a/third_party/WebKit/Source/modules/webaudio/AudioContext.cpp +++ b/third_party/WebKit/Source/modules/webaudio/AudioContext.cpp @@ -38,7 +38,7 @@ AudioContext* AudioContext::Create(Document& document, DCHECK(IsMainThread()); UseCounter::CountCrossOriginIframe( - document, UseCounter::kAudioContextCrossOriginIframe); + document, WebFeature::kAudioContextCrossOriginIframe); if (g_hardware_context_count >= kMaxHardwareContexts) { exception_state.ThrowDOMException( diff --git a/third_party/WebKit/Source/modules/webdatabase/DatabaseAuthorizer.cpp b/third_party/WebKit/Source/modules/webdatabase/DatabaseAuthorizer.cpp index 4ca06059200d2f..f9e5d18cc9c0b5 100644 --- a/third_party/WebKit/Source/modules/webdatabase/DatabaseAuthorizer.cpp +++ b/third_party/WebKit/Source/modules/webdatabase/DatabaseAuthorizer.cpp @@ -253,7 +253,7 @@ int DatabaseAuthorizer::CreateVTable(const String& table_name, return kSQLAuthDeny; UseCounter::Count(database_context_->GetExecutionContext(), - UseCounter::kWebDatabaseCreateDropFTS3Table); + WebFeature::kWebDatabaseCreateDropFTS3Table); last_action_changed_database_ = true; return DenyBasedOnTableName(table_name); } @@ -268,7 +268,7 @@ int DatabaseAuthorizer::DropVTable(const String& table_name, return kSQLAuthDeny; UseCounter::Count(database_context_->GetExecutionContext(), - UseCounter::kWebDatabaseCreateDropFTS3Table); + WebFeature::kWebDatabaseCreateDropFTS3Table); return UpdateDeletesBasedOnTableName(table_name); } diff --git a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp index 22e819bdcb61f4..3d05dca2b76522 100644 --- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp +++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp @@ -703,8 +703,7 @@ void WebGLRenderingContextBase::ForceNextWebGLContextCreationToFail() { ImageBitmap* WebGLRenderingContextBase::TransferToImageBitmapBase( ScriptState* script_state) { - UseCounter::Feature feature = - UseCounter::kOffscreenCanvasTransferToImageBitmapWebGL; + WebFeature feature = WebFeature::kOffscreenCanvasTransferToImageBitmapWebGL; UseCounter::Count(ExecutionContext::From(script_state), feature); if (!GetDrawingBuffer()) return nullptr; @@ -714,7 +713,7 @@ ImageBitmap* WebGLRenderingContextBase::TransferToImageBitmapBase( ScriptPromise WebGLRenderingContextBase::commit( ScriptState* script_state, ExceptionState& exception_state) { - UseCounter::Feature feature = UseCounter::kOffscreenCanvasCommitWebGL; + WebFeature feature = WebFeature::kOffscreenCanvasCommitWebGL; UseCounter::Count(ExecutionContext::From(script_state), feature); int width = GetDrawingBuffer()->Size().Width(); int height = GetDrawingBuffer()->Size().Height(); @@ -4826,7 +4825,7 @@ void WebGLRenderingContextBase::TexImageHelperHTMLImageElement( RefPtr image_for_render = image->CachedImage()->GetImage(); if (image_for_render && image_for_render->IsSVGImage()) { if (canvas()) { - UseCounter::Count(canvas()->GetDocument(), UseCounter::kSVGInWebGL); + UseCounter::Count(canvas()->GetDocument(), WebFeature::kSVGInWebGL); } image_for_render = DrawImageIntoBuffer(std::move(image_for_render), image->width(), diff --git a/third_party/WebKit/Source/modules/webmidi/NavigatorWebMIDI.cpp b/third_party/WebKit/Source/modules/webmidi/NavigatorWebMIDI.cpp index e67f2e32fdefb0..83ccd58857152a 100644 --- a/third_party/WebKit/Source/modules/webmidi/NavigatorWebMIDI.cpp +++ b/third_party/WebKit/Source/modules/webmidi/NavigatorWebMIDI.cpp @@ -81,12 +81,12 @@ ScriptPromise NavigatorWebMIDI::requestMIDIAccess(ScriptState* script_state, Document& document = *ToDocument(ExecutionContext::From(script_state)); if (options.hasSysex() && options.sysex()) { - UseCounter::Count(document, UseCounter::kRequestMIDIAccessWithSysExOption); + UseCounter::Count(document, WebFeature::kRequestMIDIAccessWithSysExOption); UseCounter::CountCrossOriginIframe( - document, UseCounter::kRequestMIDIAccessIframeWithSysExOption); + document, WebFeature::kRequestMIDIAccessIframeWithSysExOption); } UseCounter::CountCrossOriginIframe(document, - UseCounter::kRequestMIDIAccessIframe); + WebFeature::kRequestMIDIAccessIframe); return MIDIAccessInitializer::Start(script_state, options); } diff --git a/third_party/WebKit/Source/modules/websockets/DOMWebSocket.cpp b/third_party/WebKit/Source/modules/websockets/DOMWebSocket.cpp index 192aeb28256b38..aacd15a8fc3dcc 100644 --- a/third_party/WebKit/Source/modules/websockets/DOMWebSocket.cpp +++ b/third_party/WebKit/Source/modules/websockets/DOMWebSocket.cpp @@ -288,7 +288,7 @@ DOMWebSocket* DOMWebSocket::Create(ExecutionContext* context, void DOMWebSocket::Connect(const String& url, const Vector& protocols, ExceptionState& exception_state) { - UseCounter::Count(GetExecutionContext(), UseCounter::kWebSocket); + UseCounter::Count(GetExecutionContext(), WebFeature::kWebSocket); NETWORK_DVLOG(1) << "WebSocket " << this << " connect() url=" << url; url_ = KURL(KURL(), url); @@ -297,7 +297,7 @@ void DOMWebSocket::Connect(const String& url, kUpgradeInsecureRequests && url_.Protocol() == "ws") { UseCounter::Count(GetExecutionContext(), - UseCounter::kUpgradeInsecureRequestsUpgradedRequest); + WebFeature::kUpgradeInsecureRequestsUpgradedRequest); url_.SetProtocol("wss"); if (url_.Port() == 80) url_.SetPort(443); diff --git a/third_party/WebKit/public/platform/UseCounterFeature.def b/third_party/WebKit/public/platform/UseCounterFeature.def index f7a68dbc930608..ba1c7f60da797e 100644 --- a/third_party/WebKit/public/platform/UseCounterFeature.def +++ b/third_party/WebKit/public/platform/UseCounterFeature.def @@ -1,8 +1,6 @@ // ============ Definition for WebFeature used for UseCounter =============== // A WebFeature conceptually represents some particular web-exposed API // or code path which can be used/triggered by a web page. -// TODO(lunalu): Replace occurance of UseCounter::Feature by WebFeature in -// Blink. // TODO(rbyers): Add CSS and animated CSS feature types by making this a // more sophisticated class. // diff --git a/third_party/WebKit/public/platform/WebFeature.h b/third_party/WebKit/public/platform/WebFeature.h index 0acc877f136a9e..348447fd907ef9 100644 --- a/third_party/WebKit/public/platform/WebFeature.h +++ b/third_party/WebKit/public/platform/WebFeature.h @@ -5,8 +5,6 @@ namespace blink { // A WebFeature conceptually represents some particular web-exposed API // or code path which can be used/triggered by a web page. -// TODO(lunalu): Replace occurance of UseCounter::Feature by WebFeature in -// Blink. // TODO(rbyers): Add CSS and animated CSS feature types by making this a // more sophisticated class. enum class WebFeature : uint32_t { diff --git a/third_party/WebKit/public/web/WebLocalFrame.h b/third_party/WebKit/public/web/WebLocalFrame.h index 7581208e2f1754..a1e93acc8c83ae 100644 --- a/third_party/WebKit/public/web/WebLocalFrame.h +++ b/third_party/WebKit/public/web/WebLocalFrame.h @@ -228,7 +228,7 @@ class WebLocalFrame : public WebFrame { // one of its descendants having processed a user gesture. virtual void SetHasReceivedUserGesture() = 0; - // Reports a list of unique blink::UseCounter::Feature values representing + // Reports a list of unique blink::WebFeature values representing // Blink features used, performed or encountered by the browser during the // current page load happening on the frame. virtual void BlinkFeatureUsageReport(const std::set& features) = 0;