| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # | 2 # |
| 3 # Copyright (C) 2011 Google Inc. All rights reserved. | 3 # Copyright (C) 2011 Google Inc. All rights reserved. |
| 4 # | 4 # |
| 5 # Redistribution and use in source and binary forms, with or without | 5 # Redistribution and use in source and binary forms, with or without |
| 6 # modification, are permitted provided that the following conditions are | 6 # modification, are permitted provided that the following conditions are |
| 7 # met: | 7 # met: |
| 8 # | 8 # |
| 9 # * Redistributions of source code must retain the above copyright | 9 # * Redistributions of source code must retain the above copyright |
| 10 # notice, this list of conditions and the following disclaimer. | 10 # notice, this list of conditions and the following disclaimer. |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 (re.compile(r', v8::Isolate\*( isolate)?'), ''), | 61 (re.compile(r', v8::Isolate\*( isolate)?'), ''), |
| 62 (re.compile(r', isolate'), ''), | 62 (re.compile(r', isolate'), ''), |
| 63 (re.compile(r', v8::Handle<v8::Object> creationContext'), ''), | 63 (re.compile(r', v8::Handle<v8::Object> creationContext'), ''), |
| 64 (re.compile(r', creationContext'), ''), | 64 (re.compile(r', creationContext'), ''), |
| 65 (re.compile(r'createWrapper'), 'toDart'), | 65 (re.compile(r'createWrapper'), 'toDart'), |
| 66 (re.compile(r'v8::Handle<v8::Object>'), 'Dart_Handle'), | 66 (re.compile(r'v8::Handle<v8::Object>'), 'Dart_Handle'), |
| 67 (re.compile(r'V8'), 'Dart'), | 67 (re.compile(r'V8'), 'Dart'), |
| 68 ]) | 68 ]) |
| 69 massage('cpp', [ | 69 massage('cpp', [ |
| 70 (re.compile(r'^#include "V8'), '#include "Dart'), | 70 (re.compile(r'^#include "V8'), '#include "Dart'), |
| 71 (re.compile(r'^#include "bindings/v8/CustomElementWrapper.h"'), '#includ
e "bindings/dart/DartCustomElement.h"'), | 71 #(re.compile(r'^#include "bindings/v8/CustomElementWrapper.h"'), '#inclu
de "bindings/dart/DartCustomElement.h"'), |
| 72 (re.compile(r'^#include "bindings/v8/CustomElementWrapper.h"'), '#includ
e "bindings/dart/DartCustomElementWrapper.h"'), |
| 72 (re.compile(r'v8\.h'), 'dart_api.h'), | 73 (re.compile(r'v8\.h'), 'dart_api.h'), |
| 73 (re.compile( | 74 (re.compile( |
| 74 r'return wrap\(static_cast<(\w+)\*>\(element\), creationContext, iso
late\);'), | 75 r'return wrap\(static_cast<(\w+)\*>\(element\), creationContext, iso
late\);'), |
| 75 r'return Dart\1::toDart(static_cast<\1*>(element));'), | 76 r'return Dart\1::toDart(static_cast<\1*>(element));'), |
| 76 (re.compile( | 77 (re.compile( |
| 77 r'return createWrapperFunction\(element, creationContext, isolate\)'
), | 78 r'return createWrapperFunction\(element, creationContext, isolate\)'
), |
| 78 r'return createWrapperFunction(element)'), | 79 r'return createWrapperFunction(element)'), |
| 79 (re.compile( | 80 (re.compile( |
| 80 r'return V8%sElement::createWrapper\(element, creationContext, isola
te\);' % tag), | 81 r'return V8%sElement::createWrapper\(element, creationContext, isola
te\);' % tag), |
| 81 r'return DartDOMWrapper::toDart<Dart%sElement>(element);' % tag), | 82 r'return DartDOMWrapper::toDart<Dart%sElement>(element);' % tag), |
| 82 (re.compile( | 83 (re.compile( |
| 83 r'return createV8HTMLFallbackWrapper\(toHTMLUnknownElement\(element\
), creationContext, isolate\);'), | 84 r'return createV8HTMLFallbackWrapper\(toHTMLUnknownElement\(element\
), creationContext, isolate\);'), |
| 84 r'return DartHTMLUnknownElement::toDart(toHTMLUnknownElement(element
));'), | 85 r'return DartHTMLUnknownElement::toDart(toHTMLUnknownElement(element
));'), |
| 85 (re.compile( | 86 (re.compile( |
| 86 r'return createV8HTMLDirectWrapper\(element, creationContext, isolat
e\);'), | 87 r'return createV8HTMLDirectWrapper\(element, creationContext, isolat
e\);'), |
| 87 r'return DartDOMWrapper::toDart<DartHTMLElement>(element);'), | 88 r'return DartDOMWrapper::toDart<DartHTMLElement>(element);'), |
| 88 (re.compile( | 89 (re.compile( |
| 89 r'= createV8HTMLDirectWrapper;'), | 90 r'= createV8HTMLDirectWrapper;'), |
| 90 r'= DartDOMWrapper::toDart<DartHTMLElement>;'), | 91 r'= DartDOMWrapper::toDart<DartHTMLElement>;'), |
| 91 (re.compile( | 92 (re.compile( |
| 92 r'#include "bindings/v8/CustomElementHelpers.h"'), | 93 r'#include "bindings/v8/CustomElementHelpers.h"'), |
| 93 r'#include "bindings/v8/CustomElementHelpers.h"\n#include "bindings/
dart/DartCustomElement.h"'), | 94 r'#include "bindings/v8/CustomElementHelpers.h"\n#include "bindings/
dart/DartCustomElement.h"'), |
| 94 (re.compile( | 95 (re.compile( |
| 95 r'return CustomElementWrapper<%sElement, V8%sElement>::wrap\(element
, creationContext, isolate, createWrapperFunction\);' % (tag, tag)), | 96 r'return CustomElementWrapper<%sElement, V8%sElement>::wrap\(element
, creationContext, isolate, createWrapperFunction\);' % (tag, tag)), |
| 96 r'return DartCustomElement::toDart(element, DartCustomElement::Creat
eWrapperFunction(createWrapperFunction));'), | 97 r'return DartCustomElementWrapper<%sElement>::wrap(element, createWr
apperFunction);' % tag), |
| 98 #r'return DartCustomElement::toDart(element, DartCustomElement::Crea
teWrapperFunction(createWrapperFunction));'), |
| 97 (re.compile( | 99 (re.compile( |
| 98 r'return wrap\(toHTMLUnknownElement\(element\), creationContext, iso
late\);'), | 100 r'return wrap\(toHTMLUnknownElement\(element\), creationContext, iso
late\);'), |
| 99 # FIXME: We map custom elements to DartHTMLElement here instead of D
artHTMLUnknownElement. | 101 # FIXME: We map custom elements to DartHTMLElement here instead of D
artHTMLUnknownElement. |
| 100 # This should be handled earlier. | 102 # This should be handled earlier. |
| 101 r'return element->isCustomElement() ? DartDOMWrapper::toDart<DartHTM
LElement>(element) : DartHTMLUnknownElement::toDart(toHTMLUnknownElement(element
));'), | 103 #r'return element->isCustomElement() ? DartDOMWrapper::toDart<DartHT
MLElement>(element) : DartHTMLUnknownElement::toDart(toHTMLUnknownElement(elemen
t));'), |
| 104 r'return DartHTMLUnknownElement::toDart(toHTMLUnknownElement(element
));'), |
| 102 (re.compile(r'createV8%sWrapper' % tag), r'createDart%sWrapper' % tag), | 105 (re.compile(r'createV8%sWrapper' % tag), r'createDart%sWrapper' % tag), |
| 103 (re.compile(r', v8::Isolate\*( isolate)?'), ''), | 106 (re.compile(r', v8::Isolate\*( isolate)?'), ''), |
| 104 (re.compile(r', v8::Handle<v8::Object> creationContext'), ''), | 107 (re.compile(r', v8::Handle<v8::Object> creationContext'), ''), |
| 105 (re.compile(r'v8::Handle<v8::Object>'), 'Dart_Handle'), | 108 (re.compile(r'v8::Handle<v8::Object>'), 'Dart_Handle'), |
| 106 (re.compile(r'findSVGTagNameOfV8Type\(const WrapperTypeInfo\* type\)'),
'findSVGTagNameOfDartType(Dart_Handle type)'), | 109 (re.compile(r'findSVGTagNameOfV8Type\(const WrapperTypeInfo\* type\)'),
'findSVGTagNameOfDartType(Dart_Handle type)'), |
| 107 (re.compile(r'findHTMLTagNameOfV8Type\(const WrapperTypeInfo\* type\)'),
'findHTMLTagNameOfDartType(Dart_Handle type)'), | 110 (re.compile(r'findHTMLTagNameOfV8Type\(const WrapperTypeInfo\* type\)'),
'findHTMLTagNameOfDartType(Dart_Handle type)'), |
| 108 (re.compile(r'V8CustomElement'), 'DartCustomElement'), | 111 (re.compile(r'V8CustomElement'), 'DartCustomElement'), |
| 109 (re.compile(r'\s*map.set\(WrapperTypeTraits.*\n'), ''), | 112 (re.compile(r'\s*map.set\(WrapperTypeTraits.*\n'), ''), |
| 110 (re.compile(r'HashMap<const WrapperTypeInfo\*, const QualifiedName\*>'),
'HashMap<Dart_Handle, const QualifiedName*>'), | 113 (re.compile(r'HashMap<const WrapperTypeInfo\*, const QualifiedName\*>'),
'HashMap<Dart_Handle, const QualifiedName*>'), |
| 111 ]) | 114 ]) |
| 112 | 115 |
| 113 return 0 | 116 return 0 |
| 114 | 117 |
| 115 if __name__ == '__main__': | 118 if __name__ == '__main__': |
| 116 sys.exit(main(sys.argv)) | 119 sys.exit(main(sys.argv)) |
| OLD | NEW |