OLD | NEW |
---|---|
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/ScriptState.h" | 7 #include "bindings/core/v8/ScriptState.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/V8DedicatedWorkerGlobalScopePartial.h" | 13 #include "bindings/modules/v8/V8DedicatedWorkerGlobalScopePartial.h" |
14 #include "bindings/modules/v8/V8Gamepad.h" | |
15 #include "bindings/modules/v8/V8GamepadButton.h" | |
14 #include "bindings/modules/v8/V8InstallEvent.h" | 16 #include "bindings/modules/v8/V8InstallEvent.h" |
15 #include "bindings/modules/v8/V8NavigatorPartial.h" | 17 #include "bindings/modules/v8/V8NavigatorPartial.h" |
16 #include "bindings/modules/v8/V8ServiceWorkerGlobalScope.h" | 18 #include "bindings/modules/v8/V8ServiceWorkerGlobalScope.h" |
17 #include "bindings/modules/v8/V8SharedWorkerGlobalScopePartial.h" | 19 #include "bindings/modules/v8/V8SharedWorkerGlobalScopePartial.h" |
18 #include "bindings/modules/v8/V8WindowPartial.h" | 20 #include "bindings/modules/v8/V8WindowPartial.h" |
19 #include "bindings/modules/v8/V8WorkerNavigatorPartial.h" | 21 #include "bindings/modules/v8/V8WorkerNavigatorPartial.h" |
20 #include "core/dom/ExecutionContext.h" | 22 #include "core/dom/ExecutionContext.h" |
21 #include "core/origin_trials/OriginTrialContext.h" | 23 #include "core/origin_trials/OriginTrialContext.h" |
22 | 24 |
23 namespace blink { | 25 namespace blink { |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
68 V8NavigatorPartial::installWebShare(isolate, world, | 70 V8NavigatorPartial::installWebShare(isolate, world, |
69 v8::Local<v8::Object>(), | 71 v8::Local<v8::Object>(), |
70 prototypeObject, interfaceObject); | 72 prototypeObject, interfaceObject); |
71 } | 73 } |
72 if (RuntimeEnabledFeatures::webUSBEnabled() || | 74 if (RuntimeEnabledFeatures::webUSBEnabled() || |
73 (originTrialContext && | 75 (originTrialContext && |
74 originTrialContext->isFeatureEnabled("WebUSB"))) { | 76 originTrialContext->isFeatureEnabled("WebUSB"))) { |
75 V8NavigatorPartial::installWebUSB(isolate, world, v8::Local<v8::Object>(), | 77 V8NavigatorPartial::installWebUSB(isolate, world, v8::Local<v8::Object>(), |
76 prototypeObject, interfaceObject); | 78 prototypeObject, interfaceObject); |
77 } | 79 } |
80 if (RuntimeEnabledFeatures::webVREnabled() || | |
81 (originTrialContext && originTrialContext->isFeatureEnabled("WebVR"))) { | |
82 V8NavigatorPartial::installWebVR(isolate, world, global, prototypeObject, | |
83 interfaceObject); | |
84 } | |
78 } else if (wrapperTypeInfo == &V8WorkerNavigator::wrapperTypeInfo) { | 85 } else if (wrapperTypeInfo == &V8WorkerNavigator::wrapperTypeInfo) { |
79 if (RuntimeEnabledFeatures::durableStorageEnabled() || | 86 if (RuntimeEnabledFeatures::durableStorageEnabled() || |
80 (originTrialContext && | 87 (originTrialContext && |
81 originTrialContext->isFeatureEnabled("DurableStorage"))) { | 88 originTrialContext->isFeatureEnabled("DurableStorage"))) { |
82 V8WorkerNavigatorPartial::installDurableStorage( | 89 V8WorkerNavigatorPartial::installDurableStorage( |
83 isolate, world, v8::Local<v8::Object>(), prototypeObject, | 90 isolate, world, v8::Local<v8::Object>(), prototypeObject, |
84 interfaceObject); | 91 interfaceObject); |
85 } | 92 } |
86 } else if (wrapperTypeInfo == &V8Window::wrapperTypeInfo) { | 93 } else if (wrapperTypeInfo == &V8Window::wrapperTypeInfo) { |
87 if (RuntimeEnabledFeatures::durableStorageEnabled() || | 94 if (RuntimeEnabledFeatures::durableStorageEnabled() || |
88 (originTrialContext && | 95 (originTrialContext && |
89 originTrialContext->isFeatureEnabled("DurableStorage"))) { | 96 originTrialContext->isFeatureEnabled("DurableStorage"))) { |
90 V8WindowPartial::installDurableStorage(isolate, world, global, | 97 V8WindowPartial::installDurableStorage(isolate, world, global, |
91 prototypeObject, interfaceObject); | 98 prototypeObject, interfaceObject); |
92 } | 99 } |
93 if (RuntimeEnabledFeatures::webBluetoothEnabled() || | 100 if (RuntimeEnabledFeatures::webBluetoothEnabled() || |
94 (originTrialContext && | 101 (originTrialContext && |
95 originTrialContext->isFeatureEnabled("WebBluetooth"))) { | 102 originTrialContext->isFeatureEnabled("WebBluetooth"))) { |
96 V8WindowPartial::installWebBluetooth(isolate, world, global, | 103 V8WindowPartial::installWebBluetooth(isolate, world, global, |
97 prototypeObject, interfaceObject); | 104 prototypeObject, interfaceObject); |
98 } | 105 } |
99 if (RuntimeEnabledFeatures::webUSBEnabled() || | 106 if (RuntimeEnabledFeatures::webUSBEnabled() || |
100 (originTrialContext && | 107 (originTrialContext && |
101 originTrialContext->isFeatureEnabled("WebUSB"))) { | 108 originTrialContext->isFeatureEnabled("WebUSB"))) { |
102 V8WindowPartial::installWebUSB(isolate, world, global, prototypeObject, | 109 V8WindowPartial::installWebUSB(isolate, world, global, prototypeObject, |
103 interfaceObject); | 110 interfaceObject); |
104 } | 111 } |
112 if (RuntimeEnabledFeatures::webVREnabled() || | |
113 (originTrialContext && originTrialContext->isFeatureEnabled("WebVR"))) { | |
114 V8WindowPartial::installWebVR(isolate, world, global, prototypeObject, | |
115 interfaceObject); | |
116 } | |
117 if (RuntimeEnabledFeatures::gamepadExtensionsEnabled() || | |
118 (originTrialContext && originTrialContext->isFeatureEnabled("WebVR"))) { | |
haraken
2016/10/07 02:19:52
Shouldn't this be "GamepadExtensions"?
iclelland
2016/10/07 14:51:50
No, chasej pointed out in #9 that this should be "
| |
119 V8WindowPartial::installGamepadExtensions( | |
120 isolate, world, global, prototypeObject, interfaceObject); | |
121 } | |
105 } else if (wrapperTypeInfo == &V8SharedWorkerGlobalScope::wrapperTypeInfo) { | 122 } else if (wrapperTypeInfo == &V8SharedWorkerGlobalScope::wrapperTypeInfo) { |
106 if (RuntimeEnabledFeatures::durableStorageEnabled() || | 123 if (RuntimeEnabledFeatures::durableStorageEnabled() || |
107 (originTrialContext && | 124 (originTrialContext && |
108 originTrialContext->isFeatureEnabled("DurableStorage"))) { | 125 originTrialContext->isFeatureEnabled("DurableStorage"))) { |
109 V8SharedWorkerGlobalScopePartial::installDurableStorage( | 126 V8SharedWorkerGlobalScopePartial::installDurableStorage( |
110 isolate, world, global, prototypeObject, interfaceObject); | 127 isolate, world, global, prototypeObject, interfaceObject); |
111 } | 128 } |
112 } else if (wrapperTypeInfo == | 129 } else if (wrapperTypeInfo == |
113 &V8DedicatedWorkerGlobalScope::wrapperTypeInfo) { | 130 &V8DedicatedWorkerGlobalScope::wrapperTypeInfo) { |
114 if (RuntimeEnabledFeatures::durableStorageEnabled() || | 131 if (RuntimeEnabledFeatures::durableStorageEnabled() || |
(...skipping 16 matching lines...) Expand all Loading... | |
131 isolate, world, global, prototypeObject, interfaceObject); | 148 isolate, world, global, prototypeObject, interfaceObject); |
132 } | 149 } |
133 } else if (wrapperTypeInfo == &V8InstallEvent::wrapperTypeInfo) { | 150 } else if (wrapperTypeInfo == &V8InstallEvent::wrapperTypeInfo) { |
134 if (RuntimeEnabledFeatures::foreignFetchEnabled() || | 151 if (RuntimeEnabledFeatures::foreignFetchEnabled() || |
135 (originTrialContext && | 152 (originTrialContext && |
136 originTrialContext->isFeatureEnabled("ForeignFetch"))) { | 153 originTrialContext->isFeatureEnabled("ForeignFetch"))) { |
137 V8InstallEvent::installForeignFetch(isolate, world, | 154 V8InstallEvent::installForeignFetch(isolate, world, |
138 v8::Local<v8::Object>(), | 155 v8::Local<v8::Object>(), |
139 prototypeObject, interfaceObject); | 156 prototypeObject, interfaceObject); |
140 } | 157 } |
158 } else if (wrapperTypeInfo == &V8Gamepad::wrapperTypeInfo) { | |
159 if (RuntimeEnabledFeatures::gamepadExtensionsEnabled() || | |
160 (originTrialContext && originTrialContext->isFeatureEnabled("WebVR"))) { | |
haraken
2016/10/07 02:19:52
Ditto.
| |
161 V8Gamepad::installGamepadExtensions(isolate, world, global, | |
162 prototypeObject, interfaceObject); | |
163 } | |
164 } else if (wrapperTypeInfo == &V8GamepadButton::wrapperTypeInfo) { | |
165 if (RuntimeEnabledFeatures::gamepadExtensionsEnabled() || | |
166 (originTrialContext && originTrialContext->isFeatureEnabled("WebVR"))) { | |
haraken
2016/10/07 02:19:52
Ditto.
| |
167 V8GamepadButton::installGamepadExtensions( | |
168 isolate, world, global, prototypeObject, interfaceObject); | |
169 } | |
141 } | 170 } |
142 } | 171 } |
143 | 172 |
144 void registerInstallConditionalFeaturesForModules() { | 173 void registerInstallConditionalFeaturesForModules() { |
145 s_originalInstallConditionalFeaturesFunction = | 174 s_originalInstallConditionalFeaturesFunction = |
146 setInstallConditionalFeaturesFunction( | 175 setInstallConditionalFeaturesFunction( |
147 &installConditionalFeaturesForModules); | 176 &installConditionalFeaturesForModules); |
148 } | 177 } |
149 | 178 |
150 } // namespace blink | 179 } // namespace blink |
OLD | NEW |