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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 executionContext, OriginTrialContext::DontCreateIfNotExists); | 45 executionContext, OriginTrialContext::DontCreateIfNotExists); |
46 v8::Isolate* isolate = scriptState->isolate(); | 46 v8::Isolate* isolate = scriptState->isolate(); |
47 const DOMWrapperWorld& world = scriptState->world(); | 47 const DOMWrapperWorld& world = scriptState->world(); |
48 v8::Local<v8::Object> global = scriptState->context()->Global(); | 48 v8::Local<v8::Object> global = scriptState->context()->Global(); |
49 if (wrapperTypeInfo == &V8Navigator::wrapperTypeInfo) { | 49 if (wrapperTypeInfo == &V8Navigator::wrapperTypeInfo) { |
50 if (RuntimeEnabledFeatures::durableStorageEnabled() || | 50 if (RuntimeEnabledFeatures::durableStorageEnabled() || |
51 (originTrialContext && | 51 (originTrialContext && |
52 originTrialContext->isFeatureEnabled("DurableStorage"))) { | 52 originTrialContext->isFeatureEnabled("DurableStorage"))) { |
53 V8NavigatorPartial::installDurableStorage( | 53 V8NavigatorPartial::installDurableStorage( |
54 isolate, world, v8::Local<v8::Object>(), prototypeObject, | 54 isolate, world, v8::Local<v8::Object>(), prototypeObject, |
55 interfaceObject); // Need to specify interface object explicitly to a
void looping back here | 55 interfaceObject); // Need to specify interface object explicitly to |
| 56 // avoid looping back here |
56 } | 57 } |
57 if (RuntimeEnabledFeatures::webBluetoothEnabled() || | 58 if (RuntimeEnabledFeatures::webBluetoothEnabled() || |
58 (originTrialContext && | 59 (originTrialContext && |
59 originTrialContext->isFeatureEnabled("WebBluetooth"))) { | 60 originTrialContext->isFeatureEnabled("WebBluetooth"))) { |
60 V8NavigatorPartial::installWebBluetooth(isolate, world, | 61 V8NavigatorPartial::installWebBluetooth(isolate, world, |
61 v8::Local<v8::Object>(), | 62 v8::Local<v8::Object>(), |
62 prototypeObject, interfaceObject); | 63 prototypeObject, interfaceObject); |
63 } | 64 } |
64 if (RuntimeEnabledFeatures::webShareEnabled() || | 65 if (RuntimeEnabledFeatures::webShareEnabled() || |
65 (originTrialContext && | 66 (originTrialContext && |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 } | 141 } |
141 } | 142 } |
142 | 143 |
143 void registerInstallConditionalFeaturesForModules() { | 144 void registerInstallConditionalFeaturesForModules() { |
144 s_originalInstallConditionalFeaturesFunction = | 145 s_originalInstallConditionalFeaturesFunction = |
145 setInstallConditionalFeaturesFunction( | 146 setInstallConditionalFeaturesFunction( |
146 &installConditionalFeaturesForModules); | 147 &installConditionalFeaturesForModules); |
147 } | 148 } |
148 | 149 |
149 } // namespace blink | 150 } // namespace blink |
OLD | NEW |