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

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

Issue 23068032: Add constants and primitive type readonly attributes to Python IDL compiler (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 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/interface.h
diff --git a/Source/bindings/templates/interface.h b/Source/bindings/templates/interface.h
index b6eb271e46f578574c478edb198b6cfb8fdc2cbb..449cc86427ec9985b76680f5e6d79003e6db23fb 100644
--- a/Source/bindings/templates/interface.h
+++ b/Source/bindings/templates/interface.h
@@ -27,6 +27,7 @@
{% for filename in header_includes %}
#include "{{filename}}"
{% endfor %}
+
namespace WebCore {
class {{v8_class_name}} {
@@ -40,9 +41,7 @@ public:
}
static void derefObject(void*);
static WrapperTypeInfo info;
-
static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
-
static inline void* toInternalPointer({{cpp_class_name}}* impl)
{
return impl;
@@ -52,14 +51,11 @@ public:
{
return static_cast<{{cpp_class_name}}*>(object);
}
-
static void installPerContextProperties(v8::Handle<v8::Object>, {{cpp_class_name}}*, v8::Isolate*) { }
static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, v8::Isolate*) { }
-
private:
friend v8::Handle<v8::Object> wrap({{cpp_class_name}}*, v8::Handle<v8::Object> creationContext, v8::Isolate*);
static v8::Handle<v8::Object> createWrapper(PassRefPtr<{{cpp_class_name}}>, v8::Handle<v8::Object> creationContext, v8::Isolate*);
-
};
template<>
@@ -68,6 +64,7 @@ public:
static WrapperTypeInfo* info() { return &{{v8_class_name}}::info; }
};
+
inline v8::Handle<v8::Object> wrap({{cpp_class_name}}* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
{
ASSERT(impl);
@@ -85,11 +82,6 @@ inline v8::Handle<v8::Value> toV8({{cpp_class_name}}* impl, v8::Handle<v8::Objec
return wrap(impl, creationContext, isolate);
}
-inline v8::Handle<v8::Value> toV8(PassRefPtr< {{cpp_class_name}} > impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
- return toV8(impl.get(), creationContext, isolate);
-}
-
template<typename CallbackInfo>
inline void v8SetReturnValue(const CallbackInfo& callbackInfo, {{cpp_class_name}}* impl, v8::Handle<v8::Object> creationContext)
{
@@ -124,34 +116,41 @@ inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, {{cpp_class_n
v8SetReturnValueNull(callbackInfo);
return;
}
- if (DOMDataStore::setReturnValueFromWrapperFast<{{v8_class_name}}>(callbackInfo.GetReturnValue(), impl, callbackInfo.GetHolder(), wrappable))
+ if (DOMDataStore::setReturnValueFromWrapperFast<{{v8_class_name}}>(callbackInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable))
return;
v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
v8SetReturnValue(callbackInfo, wrapper);
}
+
+inline v8::Handle<v8::Value> toV8(PassRefPtr< {{cpp_class_name}} > impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
haraken 2013/08/22 07:31:33 Nit: You don't need a space before {{cpp_class_nam
Nils Barth (inactive) 2013/08/22 09:08:13 (Perl compatibility.)
+{
+ return toV8(impl.get(), creationContext, isolate);
+}
+
template<class CallbackInfo>
-inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<{{cpp_class_name}}> impl, v8::Handle<v8::Object> creationContext)
+inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr< {{cpp_class_name}} > impl, v8::Handle<v8::Object> creationContext)
{
v8SetReturnValue(callbackInfo, impl.get(), creationContext);
}
template<class CallbackInfo>
-inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassRefPtr<{{cpp_class_name}}> impl, v8::Handle<v8::Object> creationContext)
+inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassRefPtr< {{cpp_class_name}} > impl, v8::Handle<v8::Object> creationContext)
{
v8SetReturnValueForMainWorld(callbackInfo, impl.get(), creationContext);
}
template<class CallbackInfo, class Wrappable>
-inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<{{cpp_class_name}}> impl, Wrappable* wrappable)
+inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr< {{cpp_class_name}} > impl, Wrappable* wrappable)
{
v8SetReturnValueFast(callbackInfo, impl.get(), wrappable);
}
}
-
{% if conditional_string %}
+
#endif // {{conditional_string}}
{% endif %}
#endif // {{v8_class_name}}_h
+

Powered by Google App Engine
This is Rietveld 408576698