Chromium Code Reviews| 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" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 68 V8NavigatorPartial::installWebShare(isolate, world, | 68 V8NavigatorPartial::installWebShare(isolate, world, |
| 69 v8::Local<v8::Object>(), | 69 v8::Local<v8::Object>(), |
| 70 prototypeObject, interfaceObject); | 70 prototypeObject, interfaceObject); |
| 71 } | 71 } |
| 72 if (RuntimeEnabledFeatures::webUSBEnabled() || | 72 if (RuntimeEnabledFeatures::webUSBEnabled() || |
| 73 (originTrialContext && | 73 (originTrialContext && |
| 74 originTrialContext->isFeatureEnabled("WebUSB"))) { | 74 originTrialContext->isFeatureEnabled("WebUSB"))) { |
| 75 V8NavigatorPartial::installWebUSB(isolate, world, v8::Local<v8::Object>(), | 75 V8NavigatorPartial::installWebUSB(isolate, world, v8::Local<v8::Object>(), |
| 76 prototypeObject, interfaceObject); | 76 prototypeObject, interfaceObject); |
| 77 } | 77 } |
| 78 if (RuntimeEnabledFeatures::webVREnabled() || | |
| 79 (originTrialContext && | |
| 80 originTrialContext->isFeatureEnabled("WebVR"))) { | |
| 81 V8WindowPartial::installWebVR(isolate, world, global, prototypeObject, | |
|
iclelland
2016/10/05 21:55:57
This should probably be V8NavigatorPartial::instal
amp
2016/10/05 22:04:43
Ah, yes it should. I wasn't paying enough attenti
| |
| 82 interfaceObject); | |
| 83 } | |
| 78 } else if (wrapperTypeInfo == &V8WorkerNavigator::wrapperTypeInfo) { | 84 } else if (wrapperTypeInfo == &V8WorkerNavigator::wrapperTypeInfo) { |
| 79 if (RuntimeEnabledFeatures::durableStorageEnabled() || | 85 if (RuntimeEnabledFeatures::durableStorageEnabled() || |
| 80 (originTrialContext && | 86 (originTrialContext && |
| 81 originTrialContext->isFeatureEnabled("DurableStorage"))) { | 87 originTrialContext->isFeatureEnabled("DurableStorage"))) { |
| 82 V8WorkerNavigatorPartial::installDurableStorage( | 88 V8WorkerNavigatorPartial::installDurableStorage( |
| 83 isolate, world, v8::Local<v8::Object>(), prototypeObject, | 89 isolate, world, v8::Local<v8::Object>(), prototypeObject, |
| 84 interfaceObject); | 90 interfaceObject); |
| 85 } | 91 } |
| 86 } else if (wrapperTypeInfo == &V8Window::wrapperTypeInfo) { | 92 } else if (wrapperTypeInfo == &V8Window::wrapperTypeInfo) { |
| 87 if (RuntimeEnabledFeatures::durableStorageEnabled() || | 93 if (RuntimeEnabledFeatures::durableStorageEnabled() || |
| 88 (originTrialContext && | 94 (originTrialContext && |
| 89 originTrialContext->isFeatureEnabled("DurableStorage"))) { | 95 originTrialContext->isFeatureEnabled("DurableStorage"))) { |
| 90 V8WindowPartial::installDurableStorage(isolate, world, global, | 96 V8WindowPartial::installDurableStorage(isolate, world, global, |
| 91 prototypeObject, interfaceObject); | 97 prototypeObject, interfaceObject); |
| 92 } | 98 } |
| 93 if (RuntimeEnabledFeatures::webBluetoothEnabled() || | 99 if (RuntimeEnabledFeatures::webBluetoothEnabled() || |
| 94 (originTrialContext && | 100 (originTrialContext && |
| 95 originTrialContext->isFeatureEnabled("WebBluetooth"))) { | 101 originTrialContext->isFeatureEnabled("WebBluetooth"))) { |
| 96 V8WindowPartial::installWebBluetooth(isolate, world, global, | 102 V8WindowPartial::installWebBluetooth(isolate, world, global, |
| 97 prototypeObject, interfaceObject); | 103 prototypeObject, interfaceObject); |
| 98 } | 104 } |
| 99 if (RuntimeEnabledFeatures::webUSBEnabled() || | 105 if (RuntimeEnabledFeatures::webUSBEnabled() || |
| 100 (originTrialContext && | 106 (originTrialContext && |
| 101 originTrialContext->isFeatureEnabled("WebUSB"))) { | 107 originTrialContext->isFeatureEnabled("WebUSB"))) { |
| 102 V8WindowPartial::installWebUSB(isolate, world, global, prototypeObject, | 108 V8WindowPartial::installWebUSB(isolate, world, global, prototypeObject, |
| 103 interfaceObject); | 109 interfaceObject); |
| 104 } | 110 } |
| 111 if (RuntimeEnabledFeatures::webVREnabled() || | |
| 112 (originTrialContext && | |
| 113 originTrialContext->isFeatureEnabled("WebVR"))) { | |
| 114 V8WindowPartial::installWebVR(isolate, world, global, prototypeObject, | |
| 115 interfaceObject); | |
| 116 } | |
| 105 } else if (wrapperTypeInfo == &V8SharedWorkerGlobalScope::wrapperTypeInfo) { | 117 } else if (wrapperTypeInfo == &V8SharedWorkerGlobalScope::wrapperTypeInfo) { |
| 106 if (RuntimeEnabledFeatures::durableStorageEnabled() || | 118 if (RuntimeEnabledFeatures::durableStorageEnabled() || |
| 107 (originTrialContext && | 119 (originTrialContext && |
| 108 originTrialContext->isFeatureEnabled("DurableStorage"))) { | 120 originTrialContext->isFeatureEnabled("DurableStorage"))) { |
| 109 V8SharedWorkerGlobalScopePartial::installDurableStorage( | 121 V8SharedWorkerGlobalScopePartial::installDurableStorage( |
| 110 isolate, world, global, prototypeObject, interfaceObject); | 122 isolate, world, global, prototypeObject, interfaceObject); |
| 111 } | 123 } |
| 112 } else if (wrapperTypeInfo == | 124 } else if (wrapperTypeInfo == |
| 113 &V8DedicatedWorkerGlobalScope::wrapperTypeInfo) { | 125 &V8DedicatedWorkerGlobalScope::wrapperTypeInfo) { |
| 114 if (RuntimeEnabledFeatures::durableStorageEnabled() || | 126 if (RuntimeEnabledFeatures::durableStorageEnabled() || |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 141 } | 153 } |
| 142 } | 154 } |
| 143 | 155 |
| 144 void registerInstallConditionalFeaturesForModules() { | 156 void registerInstallConditionalFeaturesForModules() { |
| 145 s_originalInstallConditionalFeaturesFunction = | 157 s_originalInstallConditionalFeaturesFunction = |
| 146 setInstallConditionalFeaturesFunction( | 158 setInstallConditionalFeaturesFunction( |
| 147 &installConditionalFeaturesForModules); | 159 &installConditionalFeaturesForModules); |
| 148 } | 160 } |
| 149 | 161 |
| 150 } // namespace blink | 162 } // namespace blink |
| OLD | NEW |