| OLD | NEW |
| 1 // Copyright 2011, Google Inc. | 1 // Copyright 2011, Google Inc. |
| 2 // All rights reserved. | 2 // All rights reserved. |
| 3 // | 3 // |
| 4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
| 5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
| 6 // met: | 6 // met: |
| 7 // | 7 // |
| 8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
| 9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
| 10 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 #include "EventListener.h" | 34 #include "EventListener.h" |
| 35 #include "EventTarget.h" | 35 #include "EventTarget.h" |
| 36 #include "ExceptionCode.h" | 36 #include "ExceptionCode.h" |
| 37 #include "MediaQueryListListener.h" | 37 #include "MediaQueryListListener.h" |
| 38 #include "OptionsObject.h" | 38 #include "OptionsObject.h" |
| 39 #include "Range.h" | 39 #include "Range.h" |
| 40 #include "ScriptValue.h" | 40 #include "ScriptValue.h" |
| 41 #include "SerializedScriptValue.h" | 41 #include "SerializedScriptValue.h" |
| 42 #if ENABLE(SVG) | 42 #if ENABLE(SVG) |
| 43 #include "SVGPropertyTearOff.h" | 43 #include "SVGPropertyTearOff.h" |
| 44 #include "SVGAnimatedEnumerationPropertyTearOff.h" |
| 44 #endif | 45 #endif |
| 45 #include "VoidCallback.h" | 46 #include "VoidCallback.h" |
| 46 #include "base/basictypes.h" // for COMPILE_ASSERT | 47 #include "base/basictypes.h" // for COMPILE_ASSERT |
| 47 #include "npruntime_impl.h" | 48 #include "npruntime_impl.h" |
| 48 | 49 |
| 49 #include <bindings/npruntime.h> | 50 #include <bindings/npruntime.h> |
| 50 #include <dart_api.h> | 51 #include <dart_api.h> |
| 51 #include <wtf/PassRefPtr.h> | 52 #include <wtf/PassRefPtr.h> |
| 52 #include <wtf/RefPtr.h> | 53 #include <wtf/RefPtr.h> |
| 53 #include <wtf/text/AtomicString.h> | 54 #include <wtf/text/AtomicString.h> |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 | 184 |
| 184 class ContainerNode; | 185 class ContainerNode; |
| 185 Dart_Handle toDartValue(ContainerNode*); | 186 Dart_Handle toDartValue(ContainerNode*); |
| 186 | 187 |
| 187 class CSSMutableStyleDeclaration; | 188 class CSSMutableStyleDeclaration; |
| 188 Dart_Handle toDartValue(CSSMutableStyleDeclaration*); | 189 Dart_Handle toDartValue(CSSMutableStyleDeclaration*); |
| 189 | 190 |
| 190 class HTMLFormControlElement; | 191 class HTMLFormControlElement; |
| 191 Dart_Handle toDartValue(HTMLFormControlElement*); | 192 Dart_Handle toDartValue(HTMLFormControlElement*); |
| 192 | 193 |
| 194 template<typename T> |
| 195 Dart_Handle toDartValue(PassRefPtr< SVGAnimatedEnumerationPropertyTearOff<T> >) |
| 196 { |
| 197 DART_UNIMPLEMENTED(); |
| 198 return 0; |
| 199 } |
| 200 |
| 193 template <class Element> | 201 template <class Element> |
| 194 inline Dart_Handle vectorToDartList(const Vector< RefPtr<Element> >& vector) | 202 inline Dart_Handle vectorToDartList(const Vector< RefPtr<Element> >& vector) |
| 195 { | 203 { |
| 196 Dart_Handle list = Dart_NewList(vector.size()); | 204 Dart_Handle list = Dart_NewList(vector.size()); |
| 197 if (Dart_IsError(list)) | 205 if (Dart_IsError(list)) |
| 198 return list; | 206 return list; |
| 199 for (size_t i = 0; i < vector.size(); i++) { | 207 for (size_t i = 0; i < vector.size(); i++) { |
| 200 Dart_Handle result = Dart_ListSetAt(list, i, toDartValue(vector[i].get()
)); | 208 Dart_Handle result = Dart_ListSetAt(list, i, toDartValue(vector[i].get()
)); |
| 201 if (Dart_IsError(result)) | 209 if (Dart_IsError(result)) |
| 202 return result; | 210 return result; |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 DartDOMMap* domMap = DartUtilities::domMapForCurrentIsolate(); | 361 DartDOMMap* domMap = DartUtilities::domMapForCurrentIsolate(); |
| 354 ASSERT(!domMap->contains(domObject)); | 362 ASSERT(!domMap->contains(domObject)); |
| 355 domMap->set(domObject, persistentWrapperHandle); | 363 domMap->set(domObject, persistentWrapperHandle); |
| 356 } | 364 } |
| 357 | 365 |
| 358 template <class BindingsClass> | 366 template <class BindingsClass> |
| 359 static typename BindingsClass::NativeType* unwrapDartWrapper(Dart_Handle wra
pper, Dart_Handle& exception) | 367 static typename BindingsClass::NativeType* unwrapDartWrapper(Dart_Handle wra
pper, Dart_Handle& exception) |
| 360 { | 368 { |
| 361 // FIXME: support cross-domain wrappers. | 369 // FIXME: support cross-domain wrappers. |
| 362 if (!BindingsClass::instanceOf(wrapper)) { | 370 if (!BindingsClass::instanceOf(wrapper)) { |
| 363 String message = String("Invalid class: expected ") + BindingsClass:
:dartImplementationClassName; | 371 String message = String("Invalid class: expected instance of ") + Bi
ndingsClass::dartImplementationClassName; |
| 364 exception = DartUtilities::stringToDartString(message); | 372 exception = DartUtilities::stringToDartString(message); |
| 365 return 0; | 373 return 0; |
| 366 } | 374 } |
| 367 ASSERT(!exception); | 375 ASSERT(!exception); |
| 368 void* nativePointer = readNativePointer(wrapper, kNativeImplementationIn
dex); | 376 void* nativePointer = readNativePointer(wrapper, kNativeImplementationIn
dex); |
| 369 return reinterpret_cast<typename BindingsClass::NativeType*>(nativePoint
er); | 377 return reinterpret_cast<typename BindingsClass::NativeType*>(nativePoint
er); |
| 370 } | 378 } |
| 371 | 379 |
| 372 static void derefDOMObject(Dart_Handle wrapper, void* domObject); | 380 static void derefDOMObject(Dart_Handle wrapper, void* domObject); |
| 373 | 381 |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 770 explicit ParameterAdapter(Dart_Handle handle) | 778 explicit ParameterAdapter(Dart_Handle handle) |
| 771 { | 779 { |
| 772 setException(Dart_NewString("Not supported yet")); | 780 setException(Dart_NewString("Not supported yet")); |
| 773 } | 781 } |
| 774 operator Range::CompareHow() const { return this->value(); } | 782 operator Range::CompareHow() const { return this->value(); } |
| 775 }; | 783 }; |
| 776 | 784 |
| 777 } | 785 } |
| 778 | 786 |
| 779 #endif // DartDOMWrapper_h | 787 #endif // DartDOMWrapper_h |
| OLD | NEW |