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

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

Issue 413393003: Blink-in-JS: Implement internal APIs exposed only to private scripts (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 months 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
« no previous file with comments | « Source/bindings/scripts/v8_interface.py ('k') | Source/bindings/templates/interface.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/scripts/v8_methods.py
diff --git a/Source/bindings/scripts/v8_methods.py b/Source/bindings/scripts/v8_methods.py
index 6e1e682fcf812d3e91a0dff6e58a2a2686293dc6..9e92e0ed43d273adc1b054f1be904578a42c0037 100644
--- a/Source/bindings/scripts/v8_methods.py
+++ b/Source/bindings/scripts/v8_methods.py
@@ -99,6 +99,10 @@ def method_context(interface, method):
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/ScriptCallStackFactory.h',
@@ -176,12 +180,13 @@ def method_context(interface, method):
'number_of_required_or_variadic_arguments': len([
argument for argument in arguments
if not argument.is_optional]),
- 'only_exposed_to_private_script': 'OnlyExposedToPrivateScript' in extended_attributes,
+ 'only_exposed_to_private_script': is_only_exposed_to_private_script,
'per_context_enabled_function': v8_utilities.per_context_enabled_function_name(method), # [PerContextEnabled]
'private_script_v8_value_to_local_cpp_value': idl_type.v8_value_to_local_cpp_value(
extended_attributes, 'v8Value', 'cppValue', isolate='scriptState->isolate()', used_in_private_script=True),
'property_attributes': property_attributes(method),
'runtime_enabled_function': v8_utilities.runtime_enabled_function_name(method), # [RuntimeEnabled]
+ 'should_be_exposed_to_script': not (is_implemented_in_private_script and is_only_exposed_to_private_script),
'signature': 'v8::Local<v8::Signature>()' if is_static or 'DoNotCheckSignature' in extended_attributes else 'defaultSignature',
'union_arguments': idl_type.union_arguments,
'use_local_result': use_local_result(method),
« no previous file with comments | « Source/bindings/scripts/v8_interface.py ('k') | Source/bindings/templates/interface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698