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

Side by Side 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, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // WARNING: Do not edit - generated code. 5 // WARNING: Do not edit - generated code.
6 6
7 #ifndef Dart$(INTERFACE)_h 7 #ifndef Dart$(INTERFACE)_h
8 #define Dart$(INTERFACE)_h 8 #define Dart$(INTERFACE)_h
9 9
10 #include "bindings/dart/DartDOMWrapper.h" 10 #include "bindings/dart/DartDOMWrapper.h"
11 $WEBCORE_INCLUDES 11 $WEBCORE_INCLUDES
12 12
13 // FIXME: We need this to access the WrapperTypeInfo. 13 // FIXME: We need this to access the WrapperTypeInfo.
14 $V8_INTERFACE_INCLUDE 14 $V8_INTERFACE_INCLUDE
15 15
16 #include <dart_api.h> 16 #include <dart_api.h>
17 17
18 namespace WebCore { 18 namespace WebCore {
19 19
20 struct Dart$INTERFACE { 20 struct Dart$INTERFACE {
21 static const char* const dartImplementationClassName; 21 static const int dartClassId = $(INTERFACE)ClassId;
22 static const int dartImplementationLibraryId;
23 static const int dartClassId;
24 typedef $WEBCORE_CLASS_NAME NativeType; 22 typedef $WEBCORE_CLASS_NAME NativeType;
25 static const bool isNode = $IS_NODE; 23 static const bool isNode = $IS_NODE;
26 static const bool isActive = $IS_ACTIVE; 24 static const bool isActive = $IS_ACTIVE;
27 static const bool isEventTarget = $IS_EVENT_TARGET; 25 static const bool isEventTarget = $IS_EVENT_TARGET;
28 26
27 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
28 {
29 $TO_ACTIVE
30 }
31 static EventTarget* toEventTarget(void* value)
32 {
33 $TO_EVENT_TARGET
34 }
35 static Node* toNode(void* value)
36 {
37 $TO_NODE
38 }
39 static $WEBCORE_CLASS_NAME* toNative(void* value)
40 {
41 return static_cast<$WEBCORE_CLASS_NAME*>(value);
42 }
43
29 $TO_NATIVE 44 $TO_NATIVE
30 $TO_DART 45 $TO_DART
31 static Dart_Handle toDart(PassRefPtr< $WEBCORE_CLASS_NAME > value) 46 static Dart_Handle toDart(PassRefPtr< $WEBCORE_CLASS_NAME > value)
32 { 47 {
33 return toDart(value.get()); 48 return toDart(value.get());
34 } 49 }
35 static Dart_Handle createWrapper(PassRefPtr< $WEBCORE_CLASS_NAME > value) 50 static Dart_Handle createWrapper(PassRefPtr< $WEBCORE_CLASS_NAME > value)
36 { 51 {
37 return createWrapper(value.get()); 52 return createWrapper(value.get());
38 } 53 }
39 static void returnToDart(Dart_NativeArguments args, PassRefPtr< $WEBCORE_CLA SS_NAME > value, bool autoDartScope = true) 54 static void returnToDart(Dart_NativeArguments args,
55 PassRefPtr< $WEBCORE_CLASS_NAME > value,
56 bool autoDartScope = true)
40 { 57 {
41 return returnToDart(args, value.get(), autoDartScope); 58 return returnToDart(args, value.get(), autoDartScope);
42 } 59 }
43 60
44 static Dart_NativeFunction resolver(Dart_Handle name, int argumentCount, boo l* autoSetupScope); 61 static Dart_NativeFunction resolver(Dart_Handle name,
62 int argumentCount,
63 bool* autoSetupScope);
45 }; 64 };
46 65
47 Dart_Handle $(WEBCORE_CLASS_NAME_ESCAPED)_toDart(PassRefPtr< $WEBCORE_CLASS_NAME > value); 66 Dart_Handle $(WEBCORE_CLASS_NAME_ESCAPED)_toDart(PassRefPtr< $WEBCORE_CLASS_NAME > value);
48 67
49 namespace Dart$(INTERFACE)Internal { 68 namespace Dart$(INTERFACE)Internal {
50 $DECLARATIONS 69 $DECLARATIONS
51 } 70 }
52 71
53 } 72 } // namespace WebCore
54 73
55 #endif // Dart$(INTERFACE)_h 74 #endif // Dart$(INTERFACE)_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698