| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 operator AtomicString() const { return AtomicString(m_stringImpl); } | 72 operator AtomicString() const { return AtomicString(m_stringImpl); } |
| 73 | 73 |
| 74 private: | 74 private: |
| 75 RefPtr<StringImpl> m_stringImpl; | 75 RefPtr<StringImpl> m_stringImpl; |
| 76 }; | 76 }; |
| 77 | 77 |
| 78 class DartUtilities { | 78 class DartUtilities { |
| 79 public: | 79 public: |
| 80 static const char* htmlLibraryName; | 80 static const char* htmlLibraryName; |
| 81 static const char* indexedDBLibraryName; | 81 static const char* indexedDBLibraryName; |
| 82 static const char* svgLibraryName; |
| 82 | 83 |
| 83 static Dart_Handle stringImplToDartString(StringImpl*); | 84 static Dart_Handle stringImplToDartString(StringImpl*); |
| 84 static Dart_Handle stringToDartString(const String&); | 85 static Dart_Handle stringToDartString(const String&); |
| 85 static Dart_Handle stringToDartString(const AtomicString&); | 86 static Dart_Handle stringToDartString(const AtomicString&); |
| 86 | 87 |
| 87 static Dart_Handle errorToException(Dart_Handle error) | 88 static Dart_Handle errorToException(Dart_Handle error) |
| 88 { | 89 { |
| 89 ASSERT(Dart_IsError(error)); | 90 ASSERT(Dart_IsError(error)); |
| 90 if (Dart_ErrorHasException(error)) | 91 if (Dart_ErrorHasException(error)) |
| 91 return Dart_ErrorGetException(error); | 92 return Dart_ErrorGetException(error); |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 static PassRefPtr<SerializedScriptValue> dartToSerializedScriptValue(Dart_Ha
ndle, Dart_Handle& exception); | 473 static PassRefPtr<SerializedScriptValue> dartToSerializedScriptValue(Dart_Ha
ndle, Dart_Handle& exception); |
| 473 static Dart_Handle serializedScriptValueToDart(PassRefPtr<SerializedScriptVa
lue>); | 474 static Dart_Handle serializedScriptValueToDart(PassRefPtr<SerializedScriptVa
lue>); |
| 474 | 475 |
| 475 static Dart_Handle dateToDart(double); | 476 static Dart_Handle dateToDart(double); |
| 476 static double dartToDate(Dart_Handle, Dart_Handle&); | 477 static double dartToDate(Dart_Handle, Dart_Handle&); |
| 477 static double dartToDate(Dart_NativeArguments args, int idx, Dart_Handle&); | 478 static double dartToDate(Dart_NativeArguments args, int idx, Dart_Handle&); |
| 478 static bool isDateTime(Dart_Handle); | 479 static bool isDateTime(Dart_Handle); |
| 479 static bool isBlob(Dart_Handle); | 480 static bool isBlob(Dart_Handle); |
| 480 static bool isImageData(Dart_Handle); | 481 static bool isImageData(Dart_Handle); |
| 481 static bool isIDBKeyRange(Dart_Handle); | 482 static bool isIDBKeyRange(Dart_Handle); |
| 483 static bool isTypeSubclassOf(Dart_Handle type, const char* libraryName, cons
t char* typeName); |
| 482 | 484 |
| 483 static bool isTypedData(Dart_Handle); | 485 static bool isTypedData(Dart_Handle); |
| 484 | 486 |
| 485 static Dart_Handle arrayBufferToDart(WTF::ArrayBuffer*); | 487 static Dart_Handle arrayBufferToDart(WTF::ArrayBuffer*); |
| 486 static Dart_Handle arrayBufferToDart(PassRefPtr<WTF::ArrayBuffer> value) | 488 static Dart_Handle arrayBufferToDart(PassRefPtr<WTF::ArrayBuffer> value) |
| 487 { | 489 { |
| 488 return arrayBufferToDart(value.get()); | 490 return arrayBufferToDart(value.get()); |
| 489 } | 491 } |
| 490 | 492 |
| 491 static Dart_Handle arrayBufferViewToDart(WTF::ArrayBufferView*); | 493 static Dart_Handle arrayBufferViewToDart(WTF::ArrayBufferView*); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 543 static PassRefPtr<WTF::Int32Array> dartToInt32Array(Dart_NativeArguments arg
s, int idx, Dart_Handle& exception); | 545 static PassRefPtr<WTF::Int32Array> dartToInt32Array(Dart_NativeArguments arg
s, int idx, Dart_Handle& exception); |
| 544 static PassRefPtr<WTF::Uint8Array> dartToUint8Array(Dart_Handle, Dart_Handle
&); | 546 static PassRefPtr<WTF::Uint8Array> dartToUint8Array(Dart_Handle, Dart_Handle
&); |
| 545 static PassRefPtr<WTF::Uint8Array> dartToUint8Array(Dart_NativeArguments arg
s, int idx, Dart_Handle& exception); | 547 static PassRefPtr<WTF::Uint8Array> dartToUint8Array(Dart_NativeArguments arg
s, int idx, Dart_Handle& exception); |
| 546 static PassRefPtr<WTF::Float32Array> dartToFloat32Array(Dart_Handle, Dart_Ha
ndle&); | 548 static PassRefPtr<WTF::Float32Array> dartToFloat32Array(Dart_Handle, Dart_Ha
ndle&); |
| 547 static PassRefPtr<WTF::Float32Array> dartToFloat32Array(Dart_NativeArguments
args, int idx, Dart_Handle& exception); | 549 static PassRefPtr<WTF::Float32Array> dartToFloat32Array(Dart_NativeArguments
args, int idx, Dart_Handle& exception); |
| 548 | 550 |
| 549 static v8::Local<v8::Context> currentV8Context(); | 551 static v8::Local<v8::Context> currentV8Context(); |
| 550 | 552 |
| 551 private: | 553 private: |
| 552 static PassRefPtr<StringImpl> toStringImpl(Dart_Handle, intptr_t charsize, i
ntptr_t strlength, Dart_Handle& exception); | 554 static PassRefPtr<StringImpl> toStringImpl(Dart_Handle, intptr_t charsize, i
ntptr_t strlength, Dart_Handle& exception); |
| 555 static bool objectIsType(Dart_Handle, Dart_Handle type); |
| 553 static bool objectIsType(Dart_Handle, const char* libraryName, const char* t
ypeName); | 556 static bool objectIsType(Dart_Handle, const char* libraryName, const char* t
ypeName); |
| 554 }; | 557 }; |
| 555 | 558 |
| 556 class DartIsolateScope { | 559 class DartIsolateScope { |
| 557 public: | 560 public: |
| 558 explicit DartIsolateScope(Dart_Isolate isolate) | 561 explicit DartIsolateScope(Dart_Isolate isolate) |
| 559 { | 562 { |
| 560 m_isolate = isolate; | 563 m_isolate = isolate; |
| 561 m_previousIsolate = Dart_CurrentIsolate(); | 564 m_previousIsolate = Dart_CurrentIsolate(); |
| 562 if (m_previousIsolate != m_isolate) { | 565 if (m_previousIsolate != m_isolate) { |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 646 } | 649 } |
| 647 }; | 650 }; |
| 648 | 651 |
| 649 | 652 |
| 650 #define DART_UNIMPLEMENTED_EXCEPTION() DartUtilities::notImplementedException(__
FILE__, __LINE__) | 653 #define DART_UNIMPLEMENTED_EXCEPTION() DartUtilities::notImplementedException(__
FILE__, __LINE__) |
| 651 #define DART_UNIMPLEMENTED() Dart_ThrowException(DART_UNIMPLEMENTED_EXCEPTION())
; | 654 #define DART_UNIMPLEMENTED() Dart_ThrowException(DART_UNIMPLEMENTED_EXCEPTION())
; |
| 652 | 655 |
| 653 } // namespace WebCore | 656 } // namespace WebCore |
| 654 | 657 |
| 655 #endif // DartUtilities_h | 658 #endif // DartUtilities_h |
| OLD | NEW |