OLD | NEW |
1 {% from 'utilities.cpp.tmpl' import v8_value_to_local_cpp_value %} | 1 {% from 'utilities.cpp.tmpl' import v8_value_to_local_cpp_value %} |
2 {% filter format_blink_cpp_source_code %} | 2 {% filter format_blink_cpp_source_code %} |
3 | 3 |
4 {% include 'copyright_block.txt' %} | 4 {% include 'copyright_block.txt' %} |
5 | 5 |
6 #include "{{v8_class}}.h" | 6 #include "{{cpp_class}}.h" |
7 | 7 |
8 {% for filename in cpp_includes %} | 8 {% for filename in cpp_includes %} |
9 #include "{{filename}}" | 9 #include "{{filename}}" |
10 {% endfor %} | 10 {% endfor %} |
11 | 11 |
12 namespace blink { | 12 namespace blink { |
13 | 13 |
14 {{v8_class}}::{{v8_class}}(v8::Isolate* isolate, v8::Local<v8::Function> callbac
k) | 14 {{cpp_class}}::{{cpp_class}}(v8::Isolate* isolate, v8::Local<v8::Function> callb
ack) |
15 : m_callback(isolate, callback) | 15 : m_callback(isolate, callback) |
16 { | 16 { |
17 DCHECK(!m_callback.isEmpty()); | 17 DCHECK(!m_callback.isEmpty()); |
18 m_callback.setPhantom(); | 18 m_callback.setPhantom(); |
19 } | 19 } |
20 | 20 |
21 DEFINE_TRACE({{v8_class}}) | 21 DEFINE_TRACE({{cpp_class}}) |
22 { | 22 { |
23 } | 23 } |
24 | 24 |
25 bool {{v8_class}}::call({{argument_declarations | join(', ')}}) | 25 bool {{cpp_class}}::call({{argument_declarations | join(', ')}}) |
26 { | 26 { |
27 if (!scriptState->contextIsValid()) | 27 if (!scriptState->contextIsValid()) |
28 return false; | 28 return false; |
29 | 29 |
30 ExecutionContext* context = scriptState->getExecutionContext(); | 30 ExecutionContext* context = scriptState->getExecutionContext(); |
31 DCHECK(context); | 31 DCHECK(context); |
32 if (context->activeDOMObjectsAreSuspended() || context->activeDOMObjectsAreS
topped()) | 32 if (context->activeDOMObjectsAreSuspended() || context->activeDOMObjectsAreS
topped()) |
33 return false; | 33 return false; |
34 | 34 |
35 if (m_callback.isEmpty()) | 35 if (m_callback.isEmpty()) |
(...skipping 25 matching lines...) Expand all Loading... |
61 returnValue = cppValue; | 61 returnValue = cppValue; |
62 {% endif %} | 62 {% endif %} |
63 return true; | 63 return true; |
64 } | 64 } |
65 return false; | 65 return false; |
66 } | 66 } |
67 | 67 |
68 } // namespace blink | 68 } // namespace blink |
69 | 69 |
70 {% endfilter %}{# format_blink_cpp_source_code #} | 70 {% endfilter %}{# format_blink_cpp_source_code #} |
OLD | NEW |