Chromium Code Reviews| Index: Source/bindings/templates/callback.h |
| diff --git a/Source/bindings/tests/results/V8TestCallback.h b/Source/bindings/templates/callback.h |
| similarity index 52% |
| copy from Source/bindings/tests/results/V8TestCallback.h |
| copy to Source/bindings/templates/callback.h |
| index 7dd3e8d65a4871fed7f4f5572c6521f00a61925c..ae89be240dc198c482942e03f523c9794e716408 100644 |
| --- a/Source/bindings/tests/results/V8TestCallback.h |
| +++ b/Source/bindings/templates/callback.h |
| @@ -18,44 +18,41 @@ |
| Boston, MA 02111-1307, USA. |
| */ |
| -#ifndef V8TestCallback_h |
| -#define V8TestCallback_h |
| +#ifndef {{v8_class_name}}_h |
| +#define {{v8_class_name}}_h |
| -#include "bindings/bindings/tests/idls/TestCallback.h" |
| -#include "bindings/v8/ActiveDOMCallback.h" |
| -#include "bindings/v8/DOMWrapperWorld.h" |
| -#include "bindings/v8/ScopedPersistent.h" |
| +{% if conditional_string %} |
| +#if {{conditional_string}} |
| +{% endif %} |
| +{% for filename in header_includes -%} |
|
haraken
2013/07/26 02:03:30
Help me understand: What is "-%"?
kojih
2013/07/26 07:18:38
With '-' before '%}', whitespaces between '%}' and
|
| +#include "{{filename}}" |
| +{% endfor %} |
| namespace WebCore { |
| class ScriptExecutionContext; |
| -class V8TestCallback : public TestCallback, public ActiveDOMCallback { |
| +class {{v8_class_name}} : public {{interface_name}}, public ActiveDOMCallback { |
|
haraken
2013/07/26 02:03:30
interface_name => cpp_class_name
Remember that we
kojih
2013/07/26 07:18:38
done.
|
| public: |
| - static PassRefPtr<V8TestCallback> create(v8::Handle<v8::Value> value, ScriptExecutionContext* context) |
| + static PassRefPtr<{{v8_class_name}}> create(v8::Handle<v8::Value> value, ScriptExecutionContext* context) |
| { |
| ASSERT(value->IsObject()); |
| ASSERT(context); |
| - return adoptRef(new V8TestCallback(v8::Handle<v8::Object>::Cast(value), context)); |
| + return adoptRef(new {{v8_class_name}}(v8::Handle<v8::Object>::Cast(value), context)); |
| } |
| - virtual ~V8TestCallback(); |
| + virtual ~{{v8_class_name}}(); |
| // Functions |
| - virtual bool callbackWithNoParam(); |
| - virtual bool callbackWithTestObjectParam(TestObj* class1Param); |
| - virtual bool callbackWithTestObjectParam(TestObj* class2Param, const String& strArg); |
| - virtual int customCallback(TestObj* testObjParam, TestObj* testObjParam); |
| - virtual bool callbackWithStringList(RefPtr<DOMStringList> listParam); |
| - virtual bool callbackWithBoolean(bool boolParam); |
| - virtual bool callbackWithSequence(Vector<RefPtr<TestObj> > sequenceParam); |
| - virtual bool callbackWithThisArg(ScriptValue thisValue, int param); |
| +{% for function in functions %} |
| + virtual {{function["return_type"]}} {{function["name"]}}({{function["parameter_declaration"]}}); |
| +{% endfor %} |
| virtual ScriptExecutionContext* scriptExecutionContext() const { return ContextLifecycleObserver::scriptExecutionContext(); } |
| private: |
| - V8TestCallback(v8::Handle<v8::Object>, ScriptExecutionContext*); |
| + {{v8_class_name}}(v8::Handle<v8::Object>, ScriptExecutionContext*); |
| ScopedPersistent<v8::Object> m_callback; |
| RefPtr<DOMWrapperWorld> m_world; |
| @@ -63,5 +60,10 @@ private: |
| } |
| -#endif // V8TestCallback_h |
| +{% if conditional_string %} |
| +#endif // {{conditional_string}} |
| + |
| +{% endif %} |
| +#endif // {{v8_class_name}}_h |
| + |