| Index: third_party/WebKit/Source/core/testing/WorkerInternals.cpp
|
| diff --git a/third_party/WebKit/Source/core/testing/WorkerInternals.cpp b/third_party/WebKit/Source/core/testing/WorkerInternals.cpp
|
| index 42ee53948a1e119a65f732375f22c234cb4b35fb..afc509ca9ab668448cb153b393e68c19c83241ce 100644
|
| --- a/third_party/WebKit/Source/core/testing/WorkerInternals.cpp
|
| +++ b/third_party/WebKit/Source/core/testing/WorkerInternals.cpp
|
| @@ -4,6 +4,7 @@
|
|
|
| #include "core/testing/WorkerInternals.h"
|
|
|
| +#include "bindings/core/v8/ExceptionState.h"
|
| #include "bindings/core/v8/ScriptState.h"
|
| #include "core/dom/ExecutionContext.h"
|
| #include "core/frame/Deprecation.h"
|
| @@ -21,13 +22,25 @@ OriginTrialsTest* WorkerInternals::originTrialsTest() const {
|
| }
|
|
|
| void WorkerInternals::countFeature(ScriptState* script_state,
|
| - uint32_t feature) {
|
| + uint32_t feature,
|
| + ExceptionState& exception_state) {
|
| + if (UseCounter::kNumberOfFeatures <= feature) {
|
| + exception_state.ThrowTypeError(
|
| + "The given feature does not exist in UseCounter::Feature.");
|
| + return;
|
| + }
|
| UseCounter::Count(ExecutionContext::From(script_state),
|
| static_cast<UseCounter::Feature>(feature));
|
| }
|
|
|
| void WorkerInternals::countDeprecation(ScriptState* script_state,
|
| - uint32_t feature) {
|
| + uint32_t feature,
|
| + ExceptionState& exception_state) {
|
| + if (UseCounter::kNumberOfFeatures <= feature) {
|
| + exception_state.ThrowTypeError(
|
| + "The given feature does not exist in UseCounter::Feature.");
|
| + return;
|
| + }
|
| Deprecation::CountDeprecation(ExecutionContext::From(script_state),
|
| static_cast<UseCounter::Feature>(feature));
|
| }
|
|
|