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

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

Issue 2891953002: Ship and experiment with the Budget API (Closed)
Patch Set: Ship and experiment with the Budget API Created 3 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "bindings/modules/v8/ConditionalFeaturesForModules.h" 5 #include "bindings/modules/v8/ConditionalFeaturesForModules.h"
6 6
7 #include "bindings/core/v8/ConditionalFeaturesForCore.h" 7 #include "bindings/core/v8/ConditionalFeaturesForCore.h"
8 #include "bindings/core/v8/V8DedicatedWorkerGlobalScope.h" 8 #include "bindings/core/v8/V8DedicatedWorkerGlobalScope.h"
9 #include "bindings/core/v8/V8Navigator.h" 9 #include "bindings/core/v8/V8Navigator.h"
10 #include "bindings/core/v8/V8SharedWorkerGlobalScope.h" 10 #include "bindings/core/v8/V8SharedWorkerGlobalScope.h"
11 #include "bindings/core/v8/V8Window.h" 11 #include "bindings/core/v8/V8Window.h"
12 #include "bindings/core/v8/V8WorkerNavigator.h" 12 #include "bindings/core/v8/V8WorkerNavigator.h"
13 #include "bindings/modules/v8/V8BudgetService.h"
13 #include "bindings/modules/v8/V8DedicatedWorkerGlobalScopePartial.h" 14 #include "bindings/modules/v8/V8DedicatedWorkerGlobalScopePartial.h"
14 #include "bindings/modules/v8/V8Gamepad.h" 15 #include "bindings/modules/v8/V8Gamepad.h"
15 #include "bindings/modules/v8/V8GamepadButton.h" 16 #include "bindings/modules/v8/V8GamepadButton.h"
16 #include "bindings/modules/v8/V8InstallEvent.h" 17 #include "bindings/modules/v8/V8InstallEvent.h"
17 #include "bindings/modules/v8/V8NavigatorPartial.h" 18 #include "bindings/modules/v8/V8NavigatorPartial.h"
18 #include "bindings/modules/v8/V8ServiceWorkerGlobalScope.h" 19 #include "bindings/modules/v8/V8ServiceWorkerGlobalScope.h"
19 #include "bindings/modules/v8/V8SharedWorkerGlobalScopePartial.h" 20 #include "bindings/modules/v8/V8SharedWorkerGlobalScopePartial.h"
20 #include "bindings/modules/v8/V8WindowPartial.h" 21 #include "bindings/modules/v8/V8WindowPartial.h"
21 #include "bindings/modules/v8/V8WorkerNavigatorPartial.h" 22 #include "bindings/modules/v8/V8WorkerNavigatorPartial.h"
22 #include "core/dom/ExecutionContext.h" 23 #include "core/dom/ExecutionContext.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 if (OriginTrials::foreignFetchEnabled(execution_context)) { 94 if (OriginTrials::foreignFetchEnabled(execution_context)) {
94 V8ServiceWorkerGlobalScope::installForeignFetch( 95 V8ServiceWorkerGlobalScope::installForeignFetch(
95 isolate, world, instance_object, prototype_object, interface_object); 96 isolate, world, instance_object, prototype_object, interface_object);
96 } 97 }
97 } else if (wrapper_type_info == &V8InstallEvent::wrapperTypeInfo) { 98 } else if (wrapper_type_info == &V8InstallEvent::wrapperTypeInfo) {
98 if (OriginTrials::foreignFetchEnabled(execution_context)) { 99 if (OriginTrials::foreignFetchEnabled(execution_context)) {
99 V8InstallEvent::installForeignFetch(isolate, world, 100 V8InstallEvent::installForeignFetch(isolate, world,
100 v8::Local<v8::Object>(), 101 v8::Local<v8::Object>(),
101 prototype_object, interface_object); 102 prototype_object, interface_object);
102 } 103 }
104 } else if (wrapper_type_info == &V8BudgetService::wrapperTypeInfo) {
105 if (OriginTrials::budgetQueryEnabled(execution_context)) {
106 V8BudgetService::installBudgetQuery(isolate, world,
107 v8::Local<v8::Object>(),
108 prototype_object, interface_object);
109 }
103 } else if (wrapper_type_info == &V8Gamepad::wrapperTypeInfo) { 110 } else if (wrapper_type_info == &V8Gamepad::wrapperTypeInfo) {
104 if (OriginTrials::gamepadExtensionsEnabled(execution_context)) { 111 if (OriginTrials::gamepadExtensionsEnabled(execution_context)) {
105 V8Gamepad::installGamepadExtensions(isolate, world, 112 V8Gamepad::installGamepadExtensions(isolate, world,
106 v8::Local<v8::Object>(), 113 v8::Local<v8::Object>(),
107 prototype_object, interface_object); 114 prototype_object, interface_object);
108 } 115 }
109 } else if (wrapper_type_info == &V8GamepadButton::wrapperTypeInfo) { 116 } else if (wrapper_type_info == &V8GamepadButton::wrapperTypeInfo) {
110 if (OriginTrials::gamepadExtensionsEnabled(execution_context)) { 117 if (OriginTrials::gamepadExtensionsEnabled(execution_context)) {
111 V8GamepadButton::installGamepadExtensions( 118 V8GamepadButton::installGamepadExtensions(
112 isolate, world, v8::Local<v8::Object>(), prototype_object, 119 isolate, world, v8::Local<v8::Object>(), prototype_object,
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 interface_object); 202 interface_object);
196 } 203 }
197 if (context_data->GetExistingConstructorAndPrototypeForType( 204 if (context_data->GetExistingConstructorAndPrototypeForType(
198 &V8Navigator::wrapperTypeInfo, &prototype_object, 205 &V8Navigator::wrapperTypeInfo, &prototype_object,
199 &interface_object)) { 206 &interface_object)) {
200 V8NavigatorPartial::installWebVR(isolate, world, v8::Local<v8::Object>(), 207 V8NavigatorPartial::installWebVR(isolate, world, v8::Local<v8::Object>(),
201 prototype_object, interface_object); 208 prototype_object, interface_object);
202 } 209 }
203 return; 210 return;
204 } 211 }
212 if (feature == "BudgetQuery") {
213 if (context_data->GetExistingConstructorAndPrototypeForType(
214 &V8BudgetService::wrapperTypeInfo, &prototype_object,
215 &interface_object)) {
216 V8BudgetService::installBudgetQuery(isolate, world,
217 v8::Local<v8::Object>(),
218 prototype_object, interface_object);
219 }
220 return;
221 }
205 } 222 }
206 223
207 void RegisterInstallConditionalFeaturesForModules() { 224 void RegisterInstallConditionalFeaturesForModules() {
208 RegisterInstallConditionalFeaturesForCore(); 225 RegisterInstallConditionalFeaturesForCore();
209 g_original_install_conditional_features_function = 226 g_original_install_conditional_features_function =
210 SetInstallConditionalFeaturesFunction( 227 SetInstallConditionalFeaturesFunction(
211 &InstallConditionalFeaturesForModules); 228 &InstallConditionalFeaturesForModules);
212 g_original_install_pending_conditional_feature_function = 229 g_original_install_pending_conditional_feature_function =
213 SetInstallPendingConditionalFeatureFunction( 230 SetInstallPendingConditionalFeatureFunction(
214 &InstallPendingConditionalFeatureForModules); 231 &InstallPendingConditionalFeatureForModules);
215 } 232 }
216 233
217 } // namespace blink 234 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698