Add use counters for V8 non-standard Error API

V8 provides non-standard Error API through:

Error.captureStackTrace
Error.prepareStackTrace
Error.stackTraceLimit

Let's add use counters to gauge how wide-spread these are used.

This is the Chromium side of required changes.
The V8-side CL: https://crrev.com/c/753443

Bug: v8:6975
Change-Id: I578eb0bb9af1c1161c48139c6e6134185e1ff49a
Reviewed-on: https://chromium-review.googlesource.com/753446
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#514498}
diff --git a/third_party/WebKit/Source/bindings/core/v8/UseCounterCallback.cpp b/third_party/WebKit/Source/bindings/core/v8/UseCounterCallback.cpp
index 068b090..0f3a242 100644
--- a/third_party/WebKit/Source/bindings/core/v8/UseCounterCallback.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/UseCounterCallback.cpp
@@ -130,6 +130,15 @@
     case v8::Isolate::kLineOrParagraphSeparatorAsLineTerminator:
       blink_feature = WebFeature::kV8LineOrParagraphSeparatorAsLineTerminator;
       break;
+    case v8::Isolate::kErrorCaptureStackTrace:
+      blink_feature = WebFeature::kV8ErrorCaptureStackTrace;
+      break;
+    case v8::Isolate::kErrorPrepareStackTrace:
+      blink_feature = WebFeature::kV8ErrorPrepareStackTrace;
+      break;
+    case v8::Isolate::kErrorStackTraceLimit:
+      blink_feature = WebFeature::kV8ErrorStackTraceLimit;
+      break;
     default:
       // This can happen if V8 has added counters that this version of Blink
       // does not know about. It's harmless.
diff --git a/third_party/WebKit/public/platform/web_feature.mojom b/third_party/WebKit/public/platform/web_feature.mojom
index aaf8066..7fe8a51 100644
--- a/third_party/WebKit/public/platform/web_feature.mojom
+++ b/third_party/WebKit/public/platform/web_feature.mojom
@@ -1751,6 +1751,9 @@
   kV8Element_GetBoundingClientRect_Method = 2219,
   kV8Range_GetClientRects_Method = 2220,
   kV8Range_GetBoundingClientRect_Method = 2221,
+  kV8ErrorCaptureStackTrace = 2222,
+  kV8ErrorPrepareStackTrace = 2223,
+  kV8ErrorStackTraceLimit = 2224,
 
   // Add new features immediately above this line. Don't change assigned
   // numbers of any item, and don't reuse removed slots.
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml
index 237fef6..cde12c3 100644
--- a/tools/metrics/histograms/enums.xml
+++ b/tools/metrics/histograms/enums.xml
@@ -16891,6 +16891,9 @@
   <int value="2219" label="V8Element_GetBoundingClientRect_Method"/>
   <int value="2220" label="V8Range_GetClientRects_Method"/>
   <int value="2221" label="V8Range_GetBoundingClientRect_Method"/>
+  <int value="2222" label="V8ErrorCaptureStackTrace"/>
+  <int value="2223" label="V8ErrorPrepareStackTrace"/>
+  <int value="2224" label="V8ErrorStackTraceLimit"/>
 </enum>
 
 <enum name="FeedbackSource">