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

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

Issue 2804753005: Rewrite references to "wtf/" to "platform/wtf/" in bindings. (Closed)
Patch Set: Created 3 years, 8 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 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 """Generate template values for a callback function. 5 """Generate template values for a callback function.
6 6
7 Design doc: http://www.chromium.org/developers/design-documents/idl-compiler 7 Design doc: http://www.chromium.org/developers/design-documents/idl-compiler
8 """ 8 """
9 9
10 from v8_globals import includes # pylint: disable=W0403 10 from v8_globals import includes # pylint: disable=W0403
11 import v8_utilities # pylint: disable=W0403 11 import v8_utilities # pylint: disable=W0403
12 12
13 CALLBACK_FUNCTION_H_INCLUDES = frozenset([ 13 CALLBACK_FUNCTION_H_INCLUDES = frozenset([
14 'bindings/core/v8/NativeValueTraits.h', 14 'bindings/core/v8/NativeValueTraits.h',
15 'bindings/core/v8/ScriptWrappable.h', 15 'bindings/core/v8/ScriptWrappable.h',
16 'bindings/core/v8/TraceWrapperV8Reference.h', 16 'bindings/core/v8/TraceWrapperV8Reference.h',
17 'platform/heap/Handle.h', 17 'platform/heap/Handle.h',
18 'wtf/text/WTFString.h', 18 'platform/wtf/text/WTFString.h',
19 ]) 19 ])
20 CALLBACK_FUNCTION_CPP_INCLUDES = frozenset([ 20 CALLBACK_FUNCTION_CPP_INCLUDES = frozenset([
21 'bindings/core/v8/ExceptionState.h', 21 'bindings/core/v8/ExceptionState.h',
22 'bindings/core/v8/ScriptState.h', 22 'bindings/core/v8/ScriptState.h',
23 'bindings/core/v8/ToV8.h', 23 'bindings/core/v8/ToV8.h',
24 'bindings/core/v8/V8Binding.h', 24 'bindings/core/v8/V8Binding.h',
25 'core/dom/ExecutionContext.h', 25 'core/dom/ExecutionContext.h',
26 'wtf/Assertions.h', 26 'platform/wtf/Assertions.h',
27 ]) 27 ])
28 28
29 29
30 def callback_function_context(callback_function): 30 def callback_function_context(callback_function):
31 includes.clear() 31 includes.clear()
32 includes.update(CALLBACK_FUNCTION_CPP_INCLUDES) 32 includes.update(CALLBACK_FUNCTION_CPP_INCLUDES)
33 idl_type = callback_function.idl_type 33 idl_type = callback_function.idl_type
34 idl_type_str = str(idl_type) 34 idl_type_str = str(idl_type)
35 forward_declarations = [] 35 forward_declarations = []
36 for argument in callback_function.arguments: 36 for argument in callback_function.arguments:
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 ] 74 ]
75 argument_declarations.extend( 75 argument_declarations.extend(
76 '%s %s' % (argument.idl_type.callback_cpp_type, argument.name) 76 '%s %s' % (argument.idl_type.callback_cpp_type, argument.name)
77 for argument in arguments) 77 for argument in arguments)
78 if return_cpp_type: 78 if return_cpp_type:
79 argument_declarations.append('%s returnValue' % return_cpp_type) 79 argument_declarations.append('%s returnValue' % return_cpp_type)
80 return { 80 return {
81 'argument_declarations': argument_declarations, 81 'argument_declarations': argument_declarations,
82 'arguments': [argument_context(argument) for argument in arguments], 82 'arguments': [argument_context(argument) for argument in arguments],
83 } 83 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698