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

Side by Side Diff: third_party/WebKit/Source/bindings/templates/callback_function.cpp.tmpl

Issue 2474693002: [wrapper-tracing] Support for incrementally tracing ScopedPersistent (Closed)
Patch Set: Added bailout for tests when the flag is off Created 4 years, 1 month 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 {% 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 "{{cpp_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 {{cpp_class}}::{{cpp_class}}(ScriptState* scriptState, v8::Local<v8::Function> c allback) 14 {{cpp_class}}::{{cpp_class}}(ScriptState* scriptState, v8::Local<v8::Function> c allback)
15 : m_scriptState(scriptState), 15 : m_scriptState(scriptState),
16 m_callback(scriptState->isolate(), callback) { 16 m_callback(scriptState->isolate(), this, callback) {
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({{cpp_class}}) {} 21 DEFINE_TRACE({{cpp_class}}) {}
22 22
23 DEFINE_TRACE_WRAPPERS({{cpp_class}}) { 23 DEFINE_TRACE_WRAPPERS({{cpp_class}}) {
24 visitor->traceWrappers(&m_callback.cast<v8::Object>()); 24 visitor->traceWrappers(m_callback.cast<v8::Value>());
25 } 25 }
26 26
27 bool {{cpp_class}}::call({{argument_declarations | join(', ')}}) { 27 bool {{cpp_class}}::call({{argument_declarations | join(', ')}}) {
28 if (!m_scriptState->contextIsValid()) 28 if (!m_scriptState->contextIsValid())
29 return false; 29 return false;
30 30
31 ExecutionContext* context = m_scriptState->getExecutionContext(); 31 ExecutionContext* context = m_scriptState->getExecutionContext();
32 DCHECK(context); 32 DCHECK(context);
33 if (context->activeDOMObjectsAreSuspended() || context->activeDOMObjectsAreSto pped()) 33 if (context->activeDOMObjectsAreSuspended() || context->activeDOMObjectsAreSto pped())
34 return false; 34 return false;
(...skipping 29 matching lines...) Expand all
64 returnValue = cppValue; 64 returnValue = cppValue;
65 {% endif %} 65 {% endif %}
66 return true; 66 return true;
67 } 67 }
68 return false; 68 return false;
69 } 69 }
70 70
71 } // namespace blink 71 } // namespace blink
72 72
73 {% endfilter %}{# format_blink_cpp_source_code #} 73 {% endfilter %}{# format_blink_cpp_source_code #}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698