Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Unified Diff: third_party/WebKit/Source/bindings/modules/v8/ConditionalFeaturesForModules.cpp

Issue 2812223004: Adding an origin trial for Budget API (Closed)
Patch Set: Fix expected output for virtual LayoutTests Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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() {

Powered by Google App Engine
This is Rietveld 408576698