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

Unified Diff: tools/dom/templates/html/dartium/cpp_header.template

Issue 224993003: Refactor the class id generation code a bit to make it possible to have toActiveDOMObject, ToEventT… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 9 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: tools/dom/templates/html/dartium/cpp_header.template
===================================================================
--- tools/dom/templates/html/dartium/cpp_header.template (revision 34719)
+++ tools/dom/templates/html/dartium/cpp_header.template (working copy)
@@ -18,14 +18,29 @@
namespace WebCore {
struct Dart$INTERFACE {
- static const char* const dartImplementationClassName;
- static const int dartImplementationLibraryId;
- static const int dartClassId;
+ static const int dartClassId = $(INTERFACE)ClassId;
typedef $WEBCORE_CLASS_NAME NativeType;
static const bool isNode = $IS_NODE;
static const bool isActive = $IS_ACTIVE;
static const bool isEventTarget = $IS_EVENT_TARGET;
+ static ActiveDOMObject* toActiveDOMObject(void* value)
vsm 2014/04/08 20:29:27 if HasConverters is false for the type, should the
siva 2014/04/08 23:09:03 I don't yet have the GC prolog code done yet. You
+ {
+ $TO_ACTIVE
+ }
+ static EventTarget* toEventTarget(void* value)
+ {
+ $TO_EVENT_TARGET
+ }
+ static Node* toNode(void* value)
+ {
+ $TO_NODE
+ }
+ static $WEBCORE_CLASS_NAME* toNative(void* value)
+ {
+ return static_cast<$WEBCORE_CLASS_NAME*>(value);
+ }
+
$TO_NATIVE
$TO_DART
static Dart_Handle toDart(PassRefPtr< $WEBCORE_CLASS_NAME > value)
@@ -36,12 +51,16 @@
{
return createWrapper(value.get());
}
- static void returnToDart(Dart_NativeArguments args, PassRefPtr< $WEBCORE_CLASS_NAME > value, bool autoDartScope = true)
+ static void returnToDart(Dart_NativeArguments args,
+ PassRefPtr< $WEBCORE_CLASS_NAME > value,
+ bool autoDartScope = true)
{
return returnToDart(args, value.get(), autoDartScope);
}
- static Dart_NativeFunction resolver(Dart_Handle name, int argumentCount, bool* autoSetupScope);
+ static Dart_NativeFunction resolver(Dart_Handle name,
+ int argumentCount,
+ bool* autoSetupScope);
};
Dart_Handle $(WEBCORE_CLASS_NAME_ESCAPED)_toDart(PassRefPtr< $WEBCORE_CLASS_NAME > value);
@@ -50,6 +69,6 @@
$DECLARATIONS
}
-}
+} // namespace WebCore
#endif // Dart$(INTERFACE)_h

Powered by Google App Engine
This is Rietveld 408576698