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

Unified Diff: third_party/WebKit/Source/bindings/scripts/v8_methods.py

Issue 2571063002: Remove Blink-in-JS (Closed)
Patch Set: Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/bindings/scripts/v8_methods.py
diff --git a/third_party/WebKit/Source/bindings/scripts/v8_methods.py b/third_party/WebKit/Source/bindings/scripts/v8_methods.py
index e4f1abf28609dd0391fbbb3d938ea19af866f934..bb5d2f0fc1b092fd44d8195b419aecff1defd674 100644
--- a/third_party/WebKit/Source/bindings/scripts/v8_methods.py
+++ b/third_party/WebKit/Source/bindings/scripts/v8_methods.py
@@ -80,7 +80,6 @@ def filter_custom_registration(methods, interface_is_partial):
def filter_method_configuration(methods, interface_is_partial):
return [method for method in methods if
method_is_visible(method, interface_is_partial) and
- method['should_be_exposed_to_script'] and
not method['origin_trial_feature_name'] and
not conditionally_exposed(method) and
not custom_registration(method)]
@@ -90,7 +89,6 @@ def method_for_origin_trial_feature(methods, feature_name, interface_is_partial)
"""Filters the list of methods, and returns those defined for the named origin trial feature."""
return [method for method in methods if
method_is_visible(method, interface_is_partial) and
- method['should_be_exposed_to_script'] and
method['origin_trial_feature_name'] == feature_name and
not conditionally_exposed(method) and
not custom_registration(method)]
@@ -107,7 +105,6 @@ def use_local_result(method):
extended_attributes = method.extended_attributes
idl_type = method.idl_type
return (has_extended_attribute_value(method, 'CallWith', 'ScriptState') or
- 'ImplementedInPrivateScript' in extended_attributes or
'NewObject' in extended_attributes or
'RaisesException' in extended_attributes or
idl_type.is_union_type or
@@ -126,15 +123,6 @@ def method_context(interface, method, is_visible=True):
this_cpp_value = cpp_value(interface, method, len(arguments))
- is_implemented_in_private_script = 'ImplementedInPrivateScript' in extended_attributes
- if is_implemented_in_private_script:
- includes.add('bindings/core/v8/PrivateScriptRunner.h')
- includes.add('core/frame/LocalFrame.h')
- includes.add('platform/ScriptForbiddenScope.h')
-
- # [OnlyExposedToPrivateScript]
- is_only_exposed_to_private_script = 'OnlyExposedToPrivateScript' in extended_attributes
-
is_call_with_script_arguments = has_extended_attribute_value(method, 'CallWith', 'ScriptArguments')
if is_call_with_script_arguments:
includes.update(['bindings/core/v8/ScriptCallStack.h',
@@ -181,8 +169,6 @@ def method_context(interface, method, is_visible=True):
return {
'activity_logging_world_list': v8_utilities.activity_logging_world_list(method), # [ActivityLogging]
'arguments': argument_contexts,
- 'argument_declarations_for_private_script':
- argument_declarations_for_private_script(interface, method),
'cpp_type': (v8_types.cpp_template_type('Nullable', idl_type.cpp_type)
if idl_type.is_explicit_nullable else idl_type.cpp_type),
'cpp_value': this_cpp_value,
@@ -214,7 +200,6 @@ def method_context(interface, method, is_visible=True):
'is_custom_call_epilogue': is_custom_call_epilogue,
'is_custom_element_callbacks': is_custom_element_callbacks,
'is_explicit_nullable': idl_type.is_explicit_nullable,
- 'is_implemented_in_private_script': is_implemented_in_private_script,
'is_new_object': 'NewObject' in extended_attributes,
'is_partial_interface_member':
'PartialInterfaceImplementedAs' in extended_attributes,
@@ -236,16 +221,12 @@ def method_context(interface, method, is_visible=True):
'on_instance': v8_utilities.on_instance(interface, method),
'on_interface': v8_utilities.on_interface(interface, method),
'on_prototype': v8_utilities.on_prototype(interface, method),
- 'only_exposed_to_private_script': is_only_exposed_to_private_script,
'origin_trial_enabled_function': v8_utilities.origin_trial_enabled_function_name(method), # [OriginTrialEnabled]
'origin_trial_feature_name': v8_utilities.origin_trial_feature_name(method), # [OriginTrialEnabled]
- 'private_script_v8_value_to_local_cpp_value': idl_type.v8_value_to_local_cpp_value(
- extended_attributes, 'v8Value', 'cppValue', isolate='scriptState->isolate()', bailout_return_value='false'),
'property_attributes': property_attributes(interface, method),
'returns_promise': method.returns_promise,
'runtime_enabled_function': v8_utilities.runtime_enabled_function_name(method), # [RuntimeEnabled]
'secure_context_test': v8_utilities.secure_context(method, interface), # [SecureContext]
- 'should_be_exposed_to_script': not (is_implemented_in_private_script and is_only_exposed_to_private_script),
'use_output_parameter_for_result': idl_type.use_output_parameter_for_result,
'use_local_result': use_local_result(method),
'v8_set_return_value': v8_set_return_value(interface.name, method, this_cpp_value),
@@ -268,11 +249,6 @@ def argument_context(interface, method, argument, index, is_visible=True):
not is_legacy_interface_type_checking(interface, method) and
idl_type.is_wrapper_type)
- if ('ImplementedInPrivateScript' in extended_attributes and
- not idl_type.is_wrapper_type and
- not idl_type.is_basic_type):
- raise Exception('Private scripts supports only primitive types and DOM wrappers.')
-
set_default_value = argument.set_default_value
this_cpp_type = idl_type.cpp_type_args(extended_attributes=extended_attributes,
raw_type=True,
@@ -306,9 +282,6 @@ def argument_context(interface, method, argument, index, is_visible=True):
'is_variadic_wrapper_type': is_variadic_wrapper_type,
'is_wrapper_type': idl_type.is_wrapper_type,
'name': argument.name,
- 'private_script_cpp_value_to_v8_value': idl_type.cpp_value_to_v8_value(
- argument.name, isolate='scriptState->isolate()',
- creation_context='scriptState->context()->Global()'),
'use_permissive_dictionary_conversion': 'PermissiveDictionaryConversion' in extended_attributes,
'v8_set_return_value': v8_set_return_value(interface.name, method, this_cpp_value),
'v8_set_return_value_for_main_world': v8_set_return_value(interface.name, method, this_cpp_value, for_main_world=True),
@@ -324,16 +297,6 @@ def argument_context(interface, method, argument, index, is_visible=True):
return context
-def argument_declarations_for_private_script(interface, method):
- argument_declarations = ['LocalFrame* frame']
- argument_declarations.append('%s* holderImpl' % interface.name)
- argument_declarations.extend(['%s %s' % (argument.idl_type.cpp_type_args(
- used_as_rvalue_type=True), argument.name) for argument in method.arguments])
- if method.idl_type.name != 'void':
- argument_declarations.append('%s* %s' % (method.idl_type.cpp_type, 'result'))
- return argument_declarations
-
-
################################################################################
# Value handling
################################################################################
@@ -342,9 +305,6 @@ def cpp_value(interface, method, number_of_arguments):
# Truncate omitted optional arguments
arguments = method.arguments[:number_of_arguments]
cpp_arguments = []
- if 'ImplementedInPrivateScript' in method.extended_attributes:
- cpp_arguments.append('toLocalFrame(toFrameIfNotDetached(info.GetIsolate()->GetCurrentContext()))')
- cpp_arguments.append('impl')
if method.is_constructor:
call_with_values = interface.extended_attributes.get('ConstructorCallWith')
@@ -356,15 +316,11 @@ def cpp_value(interface, method, number_of_arguments):
# static member functions, which for instance members (non-static members)
# take *impl as their first argument
if ('PartialInterfaceImplementedAs' in method.extended_attributes and
- 'ImplementedInPrivateScript' not in method.extended_attributes and
not method.is_static):
cpp_arguments.append('*impl')
cpp_arguments.extend(argument.name for argument in arguments)
- if 'ImplementedInPrivateScript' in method.extended_attributes:
- if method.idl_type.name != 'void':
- cpp_arguments.append('&result')
- elif ('RaisesException' in method.extended_attributes or
+ if ('RaisesException' in method.extended_attributes or
(method.is_constructor and
has_extended_attribute_value(interface, 'RaisesException', 'Constructor'))):
cpp_arguments.append('exceptionState')
@@ -379,8 +335,6 @@ def cpp_value(interface, method, number_of_arguments):
base_name = 'create'
elif method.name == 'NamedConstructor':
base_name = 'createForJSConstructor'
- elif 'ImplementedInPrivateScript' in method.extended_attributes:
- base_name = '%sMethod' % method.name
else:
base_name = v8_utilities.cpp_name(method)
@@ -395,11 +349,6 @@ def v8_set_return_value(interface_name, method, cpp_value, for_main_world=False)
# Constructors and void methods don't have a return type
return None
- if ('ImplementedInPrivateScript' in extended_attributes and
- not idl_type.is_wrapper_type and
- not idl_type.is_basic_type):
- raise Exception('Private scripts supports only primitive types and DOM wrappers.')
-
# [CallWith=ScriptState], [RaisesException]
if use_local_result(method):
if idl_type.is_explicit_nullable:
« no previous file with comments | « third_party/WebKit/Source/bindings/scripts/v8_interface.py ('k') | third_party/WebKit/Source/bindings/scripts/v8_types.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698