Disallow [Measure] and [MeasureAs] on interfaces without a constructor

For the instances where MeasureAs was specified on interfaces without
a constructor, simply remove the MeasureAs. Since they can't be
created by script, it seems more worthwhile want to measure where
these object are returned rather than the use of the interfaces
themselves.

The only change in generated code will be less includes of
core/frame/UseCounter.h, as can be seen in the binding testsuite
update.

BUG=415074, 567015

Review URL: https://codereview.chromium.org/1509493002

Cr-Commit-Position: refs/heads/master@{#363503}
diff --git a/third_party/WebKit/Source/bindings/scripts/v8_interface.py b/third_party/WebKit/Source/bindings/scripts/v8_interface.py
index e633908..95bebe6 100644
--- a/third_party/WebKit/Source/bindings/scripts/v8_interface.py
+++ b/third_party/WebKit/Source/bindings/scripts/v8_interface.py
@@ -226,11 +226,14 @@
     if constructors or custom_constructors or named_constructor:
         if interface.is_partial:
             raise Exception('[Constructor] and [NamedConstructor] MUST NOT be'
-                            ' specified on partial interface definitions:'
+                            ' specified on partial interface definitions: '
                             '%s' % interface.name)
 
         includes.add('bindings/core/v8/V8ObjectConstructor.h')
         includes.add('core/frame/LocalDOMWindow.h')
+    elif 'Measure' in extended_attributes or 'MeasureAs' in extended_attributes:
+        raise Exception('[Measure] or [MeasureAs] specified for interface without a constructor: '
+                        '%s' % interface.name)
 
     # [Unscopeable] attributes and methods
     unscopeables = []
diff --git a/third_party/WebKit/Source/bindings/tests/idls/core/TestInterface.idl b/third_party/WebKit/Source/bindings/tests/idls/core/TestInterface.idl
index a2caf5b..e7cfabd 100644
--- a/third_party/WebKit/Source/bindings/tests/idls/core/TestInterface.idl
+++ b/third_party/WebKit/Source/bindings/tests/idls/core/TestInterface.idl
@@ -38,7 +38,6 @@
     DoNotCheckConstants,
     ImplementedAs=TestInterfaceImplementation,
     Iterable,
-    Measure,
     RuntimeEnabled=FeatureName,
     SetWrapperReferenceTo(TestInterface referencedName),
     Exposed=(Worker,Window),
diff --git a/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterfacePartial.cpp b/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterfacePartial.cpp
index d70bfe3..fb8c0a5 100644
--- a/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterfacePartial.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterfacePartial.cpp
@@ -20,7 +20,6 @@
 #include "core/dom/ContextFeatures.h"
 #include "core/dom/Document.h"
 #include "core/frame/LocalFrame.h"
-#include "core/frame/UseCounter.h"
 #include "platform/RuntimeEnabledFeatures.h"
 #include "platform/ScriptForbiddenScope.h"
 #include "platform/TraceEvent.h"
diff --git a/third_party/WebKit/Source/core/svg/SVGAnimatedAngle.idl b/third_party/WebKit/Source/core/svg/SVGAnimatedAngle.idl
index 2f17812..7a3d9a0 100644
--- a/third_party/WebKit/Source/core/svg/SVGAnimatedAngle.idl
+++ b/third_party/WebKit/Source/core/svg/SVGAnimatedAngle.idl
@@ -28,7 +28,6 @@
 [
     SetWrapperReferenceTo(SVGElement contextElement),
     RuntimeEnabled=SVG1DOM,
-    MeasureAs=SVG1DOM,
     WillBeGarbageCollected,
 ] interface SVGAnimatedAngle {
     readonly attribute SVGAngle baseVal;
diff --git a/third_party/WebKit/Source/core/svg/SVGAnimatedBoolean.idl b/third_party/WebKit/Source/core/svg/SVGAnimatedBoolean.idl
index 6cb318d..08ba55e7 100644
--- a/third_party/WebKit/Source/core/svg/SVGAnimatedBoolean.idl
+++ b/third_party/WebKit/Source/core/svg/SVGAnimatedBoolean.idl
@@ -28,7 +28,6 @@
 [
     SetWrapperReferenceTo(SVGElement contextElement),
     RuntimeEnabled=SVG1DOM,
-    MeasureAs=SVG1DOM,
     WillBeGarbageCollected,
 ] interface SVGAnimatedBoolean {
     [RaisesException=Setter] attribute boolean baseVal;
diff --git a/third_party/WebKit/Source/core/svg/SVGAnimatedEnumeration.idl b/third_party/WebKit/Source/core/svg/SVGAnimatedEnumeration.idl
index 08fbfb1..ccd9347 100644
--- a/third_party/WebKit/Source/core/svg/SVGAnimatedEnumeration.idl
+++ b/third_party/WebKit/Source/core/svg/SVGAnimatedEnumeration.idl
@@ -29,7 +29,6 @@
     ImplementedAs=SVGAnimatedEnumerationBase,
     SetWrapperReferenceTo(SVGElement contextElement),
     RuntimeEnabled=SVG1DOM,
-    MeasureAs=SVG1DOM,
     WillBeGarbageCollected,
 ] interface SVGAnimatedEnumeration {
     [RaisesException=Setter] attribute unsigned short baseVal;
diff --git a/third_party/WebKit/Source/core/svg/SVGAnimatedInteger.idl b/third_party/WebKit/Source/core/svg/SVGAnimatedInteger.idl
index 4167d927..8ff6243a 100644
--- a/third_party/WebKit/Source/core/svg/SVGAnimatedInteger.idl
+++ b/third_party/WebKit/Source/core/svg/SVGAnimatedInteger.idl
@@ -28,7 +28,6 @@
 [
     SetWrapperReferenceTo(SVGElement contextElement),
     RuntimeEnabled=SVG1DOM,
-    MeasureAs=SVG1DOM,
     WillBeGarbageCollected,
 ] interface SVGAnimatedInteger {
     [RaisesException=Setter] attribute long baseVal;
diff --git a/third_party/WebKit/Source/core/svg/SVGAnimatedLength.idl b/third_party/WebKit/Source/core/svg/SVGAnimatedLength.idl
index b46026e..12bfefc 100644
--- a/third_party/WebKit/Source/core/svg/SVGAnimatedLength.idl
+++ b/third_party/WebKit/Source/core/svg/SVGAnimatedLength.idl
@@ -28,7 +28,6 @@
 [
     SetWrapperReferenceTo(SVGElement contextElement),
     RuntimeEnabled=SVG1DOM,
-    MeasureAs=SVG1DOM,
     WillBeGarbageCollected,
 ] interface SVGAnimatedLength {
     readonly attribute SVGLength baseVal;
diff --git a/third_party/WebKit/Source/core/svg/SVGAnimatedLengthList.idl b/third_party/WebKit/Source/core/svg/SVGAnimatedLengthList.idl
index d96c3ecf..b1c4c32 100644
--- a/third_party/WebKit/Source/core/svg/SVGAnimatedLengthList.idl
+++ b/third_party/WebKit/Source/core/svg/SVGAnimatedLengthList.idl
@@ -28,7 +28,6 @@
 [
     SetWrapperReferenceTo(SVGElement contextElement),
     RuntimeEnabled=SVG1DOM,
-    MeasureAs=SVG1DOM,
     WillBeGarbageCollected,
 ] interface SVGAnimatedLengthList {
     readonly attribute SVGLengthList baseVal;
diff --git a/third_party/WebKit/Source/core/svg/SVGAnimatedNumber.idl b/third_party/WebKit/Source/core/svg/SVGAnimatedNumber.idl
index 1ca0c07..7d1b202f 100644
--- a/third_party/WebKit/Source/core/svg/SVGAnimatedNumber.idl
+++ b/third_party/WebKit/Source/core/svg/SVGAnimatedNumber.idl
@@ -27,7 +27,6 @@
 // http://www.w3.org/TR/SVG2/types.html#InterfaceSVGAnimatedNumber
 
 [
-    MeasureAs=SVG1DOM,
     RuntimeEnabled=SVG1DOM,
     SetWrapperReferenceTo(SVGElement contextElement),
     WillBeGarbageCollected,
diff --git a/third_party/WebKit/Source/core/svg/SVGAnimatedNumberList.idl b/third_party/WebKit/Source/core/svg/SVGAnimatedNumberList.idl
index 5e73f09d..a1c14b9 100644
--- a/third_party/WebKit/Source/core/svg/SVGAnimatedNumberList.idl
+++ b/third_party/WebKit/Source/core/svg/SVGAnimatedNumberList.idl
@@ -28,7 +28,6 @@
 [
     SetWrapperReferenceTo(SVGElement contextElement),
     RuntimeEnabled=SVG1DOM,
-    MeasureAs=SVG1DOM,
     WillBeGarbageCollected,
 ] interface SVGAnimatedNumberList {
     readonly attribute SVGNumberList baseVal;
diff --git a/third_party/WebKit/Source/core/svg/SVGAnimatedPreserveAspectRatio.idl b/third_party/WebKit/Source/core/svg/SVGAnimatedPreserveAspectRatio.idl
index 3f1528c..70da61e 100644
--- a/third_party/WebKit/Source/core/svg/SVGAnimatedPreserveAspectRatio.idl
+++ b/third_party/WebKit/Source/core/svg/SVGAnimatedPreserveAspectRatio.idl
@@ -28,7 +28,6 @@
 [
     SetWrapperReferenceTo(SVGElement contextElement),
     RuntimeEnabled=SVG1DOM,
-    MeasureAs=SVG1DOM,
     WillBeGarbageCollected,
 ] interface SVGAnimatedPreserveAspectRatio {
     readonly attribute SVGPreserveAspectRatio baseVal;
diff --git a/third_party/WebKit/Source/core/svg/SVGAnimatedRect.idl b/third_party/WebKit/Source/core/svg/SVGAnimatedRect.idl
index aa1a597..e2ec1b4 100644
--- a/third_party/WebKit/Source/core/svg/SVGAnimatedRect.idl
+++ b/third_party/WebKit/Source/core/svg/SVGAnimatedRect.idl
@@ -28,7 +28,6 @@
 [
     SetWrapperReferenceTo(SVGElement contextElement),
     RuntimeEnabled=SVG1DOM,
-    MeasureAs=SVG1DOM,
     WillBeGarbageCollected,
 ] interface SVGAnimatedRect {
     // TODO(philipj): SVGRect should be DOMRectReadOnly.
diff --git a/third_party/WebKit/Source/core/svg/SVGAnimatedString.idl b/third_party/WebKit/Source/core/svg/SVGAnimatedString.idl
index 5f4a067..4b65a15 100644
--- a/third_party/WebKit/Source/core/svg/SVGAnimatedString.idl
+++ b/third_party/WebKit/Source/core/svg/SVGAnimatedString.idl
@@ -28,7 +28,6 @@
 [
     SetWrapperReferenceTo(SVGElement contextElement),
     RuntimeEnabled=SVG1DOM,
-    MeasureAs=SVG1DOM,
     WillBeGarbageCollected,
 ] interface SVGAnimatedString {
     [RaisesException=Setter] attribute DOMString baseVal;
diff --git a/third_party/WebKit/Source/core/svg/SVGAnimatedTransformList.idl b/third_party/WebKit/Source/core/svg/SVGAnimatedTransformList.idl
index 54937fa..3119e0f4 100644
--- a/third_party/WebKit/Source/core/svg/SVGAnimatedTransformList.idl
+++ b/third_party/WebKit/Source/core/svg/SVGAnimatedTransformList.idl
@@ -28,7 +28,6 @@
 [
     SetWrapperReferenceTo(SVGElement contextElement),
     RuntimeEnabled=SVG1DOM,
-    MeasureAs=SVG1DOM,
     WillBeGarbageCollected,
 ] interface SVGAnimatedTransformList {
     [MeasureAs=SVGAnimatedTransformListBaseVal] readonly attribute SVGTransformList baseVal;
diff --git a/third_party/WebKit/Source/core/svg/SVGLength.idl b/third_party/WebKit/Source/core/svg/SVGLength.idl
index d226239..0d4cd11 100644
--- a/third_party/WebKit/Source/core/svg/SVGLength.idl
+++ b/third_party/WebKit/Source/core/svg/SVGLength.idl
@@ -25,7 +25,6 @@
 [
     ImplementedAs=SVGLengthTearOff,
     SetWrapperReferenceTo(SVGElement contextElement),
-    MeasureAs=SVG1DOM,
     RuntimeEnabled=SVG1DOM,
     WillBeGarbageCollected,
 ] interface SVGLength {
diff --git a/third_party/WebKit/Source/core/svg/SVGLengthList.idl b/third_party/WebKit/Source/core/svg/SVGLengthList.idl
index e9dc983..9d1e6046 100644
--- a/third_party/WebKit/Source/core/svg/SVGLengthList.idl
+++ b/third_party/WebKit/Source/core/svg/SVGLengthList.idl
@@ -30,7 +30,6 @@
     ImplementedAs=SVGLengthListTearOff,
     SetWrapperReferenceTo(SVGElement contextElement),
     RuntimeEnabled=SVG1DOM,
-    MeasureAs=SVG1DOM,
     WillBeGarbageCollected,
 ] interface SVGLengthList {
     readonly attribute unsigned long length;
diff --git a/third_party/WebKit/Source/core/svg/SVGNumberList.idl b/third_party/WebKit/Source/core/svg/SVGNumberList.idl
index dd73608..4229cea 100644
--- a/third_party/WebKit/Source/core/svg/SVGNumberList.idl
+++ b/third_party/WebKit/Source/core/svg/SVGNumberList.idl
@@ -30,7 +30,6 @@
     ImplementedAs=SVGNumberListTearOff,
     SetWrapperReferenceTo(SVGElement contextElement),
     RuntimeEnabled=SVG1DOM,
-    MeasureAs=SVG1DOM,
     WillBeGarbageCollected,
 ] interface SVGNumberList {
     readonly attribute unsigned long length;
diff --git a/third_party/WebKit/Source/core/svg/SVGPointList.idl b/third_party/WebKit/Source/core/svg/SVGPointList.idl
index 2661d61..962de579 100644
--- a/third_party/WebKit/Source/core/svg/SVGPointList.idl
+++ b/third_party/WebKit/Source/core/svg/SVGPointList.idl
@@ -29,7 +29,6 @@
     ImplementedAs=SVGPointListTearOff,
     SetWrapperReferenceTo(SVGElement contextElement),
     RuntimeEnabled=SVG1DOM,
-    MeasureAs=SVG1DOM,
     WillBeGarbageCollected,
 ] interface SVGPointList {
     readonly attribute unsigned long length;
diff --git a/third_party/WebKit/Source/core/svg/SVGPreserveAspectRatio.idl b/third_party/WebKit/Source/core/svg/SVGPreserveAspectRatio.idl
index 2bcd9b6..c1e5747 100644
--- a/third_party/WebKit/Source/core/svg/SVGPreserveAspectRatio.idl
+++ b/third_party/WebKit/Source/core/svg/SVGPreserveAspectRatio.idl
@@ -29,7 +29,6 @@
     ImplementedAs=SVGPreserveAspectRatioTearOff,
     SetWrapperReferenceTo(SVGElement contextElement),
     RuntimeEnabled=SVG1DOM,
-    MeasureAs=SVG1DOM,
     WillBeGarbageCollected,
 ] interface SVGPreserveAspectRatio {
     // Alignment types
diff --git a/third_party/WebKit/Source/core/svg/SVGTransform.idl b/third_party/WebKit/Source/core/svg/SVGTransform.idl
index 290d489f..b1435b24 100644
--- a/third_party/WebKit/Source/core/svg/SVGTransform.idl
+++ b/third_party/WebKit/Source/core/svg/SVGTransform.idl
@@ -23,7 +23,6 @@
 
 [
     ImplementedAs=SVGTransformTearOff,
-    MeasureAs=SVG1DOM,
     RuntimeEnabled=SVG1DOM,
     SetWrapperReferenceTo(SVGElement contextElement),
     WillBeGarbageCollected,
diff --git a/third_party/WebKit/Source/core/svg/SVGTransformList.idl b/third_party/WebKit/Source/core/svg/SVGTransformList.idl
index 9199076..548d067 100644
--- a/third_party/WebKit/Source/core/svg/SVGTransformList.idl
+++ b/third_party/WebKit/Source/core/svg/SVGTransformList.idl
@@ -30,7 +30,6 @@
     ImplementedAs=SVGTransformListTearOff,
     SetWrapperReferenceTo(SVGElement contextElement),
     RuntimeEnabled=SVG1DOM,
-    MeasureAs=SVG1DOM,
     WillBeGarbageCollected,
 ] interface SVGTransformList {
     readonly attribute unsigned long length;