| 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/ConditionalFeatures.h" | 7 #include "bindings/core/v8/ConditionalFeatures.h" |
| 8 #include "bindings/core/v8/ConditionalFeaturesForCore.h" | 8 #include "bindings/core/v8/ConditionalFeaturesForCore.h" |
| 9 #include "bindings/core/v8/ScriptState.h" | 9 #include "bindings/core/v8/ScriptState.h" |
| 10 #include "bindings/core/v8/V8DedicatedWorkerGlobalScope.h" | 10 #include "bindings/core/v8/V8DedicatedWorkerGlobalScope.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 const WrapperTypeInfo* wrapper_type_info, | 39 const WrapperTypeInfo* wrapper_type_info, |
| 40 const ScriptState* script_state, | 40 const ScriptState* script_state, |
| 41 v8::Local<v8::Object> prototype_object, | 41 v8::Local<v8::Object> prototype_object, |
| 42 v8::Local<v8::Function> interface_object) { | 42 v8::Local<v8::Function> interface_object) { |
| 43 // TODO(iclelland): Generate all of this logic at compile-time, based on the | 43 // TODO(iclelland): Generate all of this logic at compile-time, based on the |
| 44 // configuration of origin trial enabled attibutes and interfaces in IDL | 44 // configuration of origin trial enabled attibutes and interfaces in IDL |
| 45 // files. (crbug.com/615060) | 45 // files. (crbug.com/615060) |
| 46 (*g_original_install_conditional_features_function)( | 46 (*g_original_install_conditional_features_function)( |
| 47 wrapper_type_info, script_state, prototype_object, interface_object); | 47 wrapper_type_info, script_state, prototype_object, interface_object); |
| 48 | 48 |
| 49 ExecutionContext* execution_context = script_state->GetExecutionContext(); | 49 ExecutionContext* execution_context = ExecutionContext::From(script_state); |
| 50 if (!execution_context) | 50 if (!execution_context) |
| 51 return; | 51 return; |
| 52 v8::Isolate* isolate = script_state->GetIsolate(); | 52 v8::Isolate* isolate = script_state->GetIsolate(); |
| 53 const DOMWrapperWorld& world = script_state->World(); | 53 const DOMWrapperWorld& world = script_state->World(); |
| 54 if (wrapper_type_info == &V8Navigator::wrapperTypeInfo) { | 54 if (wrapper_type_info == &V8Navigator::wrapperTypeInfo) { |
| 55 // Mimics the [SecureContext] extended attribute. Work-around for | 55 // Mimics the [SecureContext] extended attribute. Work-around for |
| 56 // https://crbug.com/695123. | 56 // https://crbug.com/695123. |
| 57 if (OriginTrials::installedAppEnabled(execution_context) && | 57 if (OriginTrials::installedAppEnabled(execution_context) && |
| 58 execution_context->IsSecureContext()) { | 58 execution_context->IsSecureContext()) { |
| 59 V8NavigatorPartial::installInstalledApp( | 59 V8NavigatorPartial::installInstalledApp( |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 RegisterInstallConditionalFeaturesForCore(); | 292 RegisterInstallConditionalFeaturesForCore(); |
| 293 g_original_install_conditional_features_function = | 293 g_original_install_conditional_features_function = |
| 294 SetInstallConditionalFeaturesFunction( | 294 SetInstallConditionalFeaturesFunction( |
| 295 &InstallConditionalFeaturesForModules); | 295 &InstallConditionalFeaturesForModules); |
| 296 g_original_install_pending_conditional_feature_function = | 296 g_original_install_pending_conditional_feature_function = |
| 297 SetInstallPendingConditionalFeatureFunction( | 297 SetInstallPendingConditionalFeatureFunction( |
| 298 &InstallPendingConditionalFeatureForModules); | 298 &InstallPendingConditionalFeatureForModules); |
| 299 } | 299 } |
| 300 | 300 |
| 301 } // namespace blink | 301 } // namespace blink |
| OLD | NEW |