Index: third_party/WebKit/Source/bindings/modules/v8/ConditionalFeaturesForModules.cpp |
diff --git a/third_party/WebKit/Source/bindings/modules/v8/ConditionalFeaturesForModules.cpp b/third_party/WebKit/Source/bindings/modules/v8/ConditionalFeaturesForModules.cpp |
index f26d82f34d22f0813087d145d2e4b45b9d57fccb..124942600e528dde9e603c05d6ef1b85711d2a07 100644 |
--- a/third_party/WebKit/Source/bindings/modules/v8/ConditionalFeaturesForModules.cpp |
+++ b/third_party/WebKit/Source/bindings/modules/v8/ConditionalFeaturesForModules.cpp |
@@ -12,6 +12,7 @@ |
#include "bindings/core/v8/V8SharedWorkerGlobalScope.h" |
#include "bindings/core/v8/V8Window.h" |
#include "bindings/core/v8/V8WorkerNavigator.h" |
+#include "bindings/modules/v8/V8BudgetService.h" |
#include "bindings/modules/v8/V8DedicatedWorkerGlobalScopePartial.h" |
#include "bindings/modules/v8/V8Gamepad.h" |
#include "bindings/modules/v8/V8GamepadButton.h" |
@@ -74,6 +75,12 @@ void InstallConditionalFeaturesForModules( |
V8NavigatorPartial::installWebVR(isolate, world, v8::Local<v8::Object>(), |
prototype_object, interface_object); |
} |
+ } else if (wrapper_type_info == &V8BudgetService::wrapperTypeInfo) { |
+ if (OriginTrials::budgetQueryEnabled(execution_context)) { |
+ V8BudgetService::installBudgetQuery(isolate, world, |
+ v8::Local<v8::Object>(), |
+ prototype_object, interface_object); |
+ } |
} else if (wrapper_type_info == &V8Window::wrapperTypeInfo) { |
v8::Local<v8::Object> instance_object = |
script_state->GetContext()->Global(); |
@@ -208,6 +215,16 @@ void InstallPendingConditionalFeatureForModules( |
} |
return; |
} |
+ if (feature == "BudgetQuery") { |
+ if (context_data->GetExistingConstructorAndPrototypeForType( |
+ &V8BudgetService::wrapperTypeInfo, &prototype_object, |
+ &interface_object)) { |
+ V8BudgetService::installBudgetQuery(isolate, world, |
+ v8::Local<v8::Object>(), |
+ prototype_object, interface_object); |
+ } |
+ return; |
+ } |
} |
void RegisterInstallConditionalFeaturesForModules() { |