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

Side by Side Diff: third_party/WebKit/Source/bindings/scripts/v8_methods.py

Issue 2090773005: [OriginTrials] Raise an exception at compile time for OT-enabled methods (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add note about support in IDLExtendedAttributes.md Created 4 years, 6 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 unified diff | Download patch
OLDNEW
1 # Copyright (C) 2013 Google Inc. All rights reserved. 1 # Copyright (C) 2013 Google Inc. All rights reserved.
2 # 2 #
3 # Redistribution and use in source and binary forms, with or without 3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions are 4 # modification, are permitted provided that the following conditions are
5 # met: 5 # met:
6 # 6 #
7 # * Redistributions of source code must retain the above copyright 7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer. 8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above 9 # * Redistributions in binary form must reproduce the above
10 # copyright notice, this list of conditions and the following disclaimer 10 # copyright notice, this list of conditions and the following disclaimer
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 idl_type.is_explicit_nullable) 61 idl_type.is_explicit_nullable)
62 62
63 63
64 def method_context(interface, method, is_visible=True): 64 def method_context(interface, method, is_visible=True):
65 arguments = method.arguments 65 arguments = method.arguments
66 extended_attributes = method.extended_attributes 66 extended_attributes = method.extended_attributes
67 idl_type = method.idl_type 67 idl_type = method.idl_type
68 is_static = method.is_static 68 is_static = method.is_static
69 name = method.name 69 name = method.name
70 70
71 # [OriginTrialEnabled]
72 # TODO(iclelland): Allow origin trials on methods
73 # (crbug.com/621641)
74 if v8_utilities.origin_trial_feature_name(method):
75 raise Exception('[OriginTrialEnabled] cannot be specified on '
76 'individual methods: %s.%s' % (interface.name, method.na me))
77
71 if is_visible: 78 if is_visible:
72 idl_type.add_includes_for_type(extended_attributes) 79 idl_type.add_includes_for_type(extended_attributes)
73 80
74 this_cpp_value = cpp_value(interface, method, len(arguments)) 81 this_cpp_value = cpp_value(interface, method, len(arguments))
75 82
76 is_implemented_in_private_script = 'ImplementedInPrivateScript' in extended_ attributes 83 is_implemented_in_private_script = 'ImplementedInPrivateScript' in extended_ attributes
77 if is_implemented_in_private_script: 84 if is_implemented_in_private_script:
78 includes.add('bindings/core/v8/PrivateScriptRunner.h') 85 includes.add('bindings/core/v8/PrivateScriptRunner.h')
79 includes.add('core/frame/LocalFrame.h') 86 includes.add('core/frame/LocalFrame.h')
80 includes.add('platform/ScriptForbiddenScope.h') 87 includes.add('platform/ScriptForbiddenScope.h')
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 return method.idl_type and method.idl_type.name == 'Promise' 471 return method.idl_type and method.idl_type.name == 'Promise'
465 472
466 IdlOperation.returns_promise = property(method_returns_promise) 473 IdlOperation.returns_promise = property(method_returns_promise)
467 474
468 475
469 def argument_conversion_needs_exception_state(method, argument): 476 def argument_conversion_needs_exception_state(method, argument):
470 idl_type = argument.idl_type 477 idl_type = argument.idl_type
471 return (idl_type.v8_conversion_needs_exception_state or 478 return (idl_type.v8_conversion_needs_exception_state or
472 argument.is_variadic or 479 argument.is_variadic or
473 (method.returns_promise and idl_type.is_string_type)) 480 (method.returns_promise and idl_type.is_string_type))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698