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

Unified Diff: Source/bindings/templates/callback.h

Issue 19607011: Generate binding code for VoidCallback.idl with code generator in python (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
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..2ed72805037c7582212fcf41338f20a616f31664 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 includes -%}
+#include "{{filename}}"
+{% endfor %}
namespace WebCore {
class ScriptExecutionContext;
-class V8TestCallback : public TestCallback, public ActiveDOMCallback {
+class {{v8_class_name}} : public {{interface_name}}, public ActiveDOMCallback {
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 definition in class_public_definitions -%}
+{{definition | indent(4, true)}}
+{% 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
+

Powered by Google App Engine
This is Rietveld 408576698