OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * |
| 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are |
| 6 * met: |
| 7 * |
| 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above |
| 11 * copyright notice, this list of conditions and the following disclaimer |
| 12 * in the documentation and/or other materials provided with the |
| 13 * distribution. |
| 14 * * Neither the name of Google Inc. nor the names of its |
| 15 * contributors may be used to endorse or promote products derived from |
| 16 * this software without specific prior written permission. |
| 17 * |
| 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ |
| 30 |
| 31 #ifndef DartScriptValueDeserializer_h |
| 32 #define DartScriptValueDeserializer_h |
| 33 |
| 34 #include "ScriptValueDeserializer.h" |
| 35 |
| 36 #include <dart_api.h> |
| 37 |
| 38 namespace WebCore { |
| 39 |
| 40 class DartScriptValueDeserializer : public ScriptValueDeserializer { |
| 41 public: |
| 42 DartScriptValueDeserializer() |
| 43 : m_result(0) |
| 44 { |
| 45 } |
| 46 |
| 47 Dart_Handle result() { return m_result; } |
| 48 |
| 49 virtual bool newArray(uint32_t length) |
| 50 { |
| 51 // FIXME: proper implementation if necessary. |
| 52 return false; |
| 53 } |
| 54 |
| 55 virtual bool newObject() |
| 56 { |
| 57 // FIXME: proper implementation if necessary. |
| 58 return false; |
| 59 } |
| 60 |
| 61 virtual bool tryGetObjectFromObjectReference(uint32_t reference) |
| 62 { |
| 63 // FIXME: proper implementation if necessary. |
| 64 return false; |
| 65 } |
| 66 |
| 67 virtual uint32_t objectReferenceCount() |
| 68 { |
| 69 // FIXME: proper implementation if necessary. |
| 70 return 0; |
| 71 } |
| 72 |
| 73 virtual void addReferenceForTop() |
| 74 { |
| 75 // FIXME: proper implementation if necessary. |
| 76 ASSERT_NOT_REACHED(); |
| 77 } |
| 78 |
| 79 |
| 80 // FIXME: proper implementation for missing methods if necessary. |
| 81 virtual bool pushUndefined() { return false; } |
| 82 virtual bool pushNull(); |
| 83 virtual bool pushTrue() { return false; } |
| 84 virtual bool pushTrueObject() { return false; } |
| 85 virtual bool pushFalse() { return false; } |
| 86 virtual bool pushFalseObject() { return false; } |
| 87 virtual bool pushScriptString(const char* data, uint32_t length); |
| 88 virtual bool pushScriptStringObject() { return false; } |
| 89 virtual bool pushInt32(int32_t value) { return false; } |
| 90 virtual bool pushUInt32(uint32_t value) { return false; } |
| 91 virtual bool pushDate(double numberValue) { return false; } |
| 92 virtual bool pushNumber(double value) { return false; } |
| 93 virtual bool pushNumberObject(double value) { return false; } |
| 94 virtual bool pushBlob(PassRefPtr<Blob> blob); |
| 95 virtual bool pushFile(PassRefPtr<File> file); |
| 96 virtual bool pushFileList(PassRefPtr<FileList> fileList); |
| 97 virtual bool pushImageData(PassRefPtr<ImageData> imageData); |
| 98 |
| 99 virtual bool pushArray(uint32_t length) |
| 100 { |
| 101 // FIXME: proper implementation if necessary. |
| 102 return false; |
| 103 } |
| 104 |
| 105 virtual bool pushRegExp(uint32_t flags) |
| 106 { |
| 107 // FIXME: proper implementation if necessary. |
| 108 return false; |
| 109 } |
| 110 |
| 111 virtual bool pushObject(uint32_t numProperties) |
| 112 { |
| 113 // FIXME: proper implementation if necessary. |
| 114 return false; |
| 115 } |
| 116 |
| 117 virtual bool pushSparseArray(uint32_t numProperties, uint32_t length) |
| 118 { |
| 119 // FIXME: proper implementation if necessary. |
| 120 return false; |
| 121 } |
| 122 |
| 123 // FIXME: proper implementation for missing methods if necessary. |
| 124 virtual bool pushInt8Array(uint32_t byteOffset, uint32_t byteLength) { retur
n false; } |
| 125 virtual bool pushUint8Array(uint32_t byteOffset, uint32_t byteLength) { retu
rn false; } |
| 126 virtual bool pushInt16Array(uint32_t byteOffset, uint32_t byteLength) { retu
rn false; } |
| 127 virtual bool pushUint16Array(uint32_t byteOffset, uint32_t byteLength) { ret
urn false; } |
| 128 virtual bool pushInt32Array(uint32_t byteOffset, uint32_t byteLength) { retu
rn false; } |
| 129 virtual bool pushUint32Array(uint32_t byteOffset, uint32_t byteLength) { ret
urn false; } |
| 130 virtual bool pushFloat32Array(uint32_t byteOffset, uint32_t byteLength) { re
turn false; } |
| 131 virtual bool pushFloat64Array(uint32_t byteOffset, uint32_t byteLength) { re
turn false; } |
| 132 virtual bool pushDataView(uint32_t byteOffset, uint32_t byteLength) { return
false; } |
| 133 virtual bool pushArrayBuffer(PassRefPtr<ArrayBuffer> arrayBuffer); |
| 134 |
| 135 private: |
| 136 Dart_Handle m_result; |
| 137 }; |
| 138 |
| 139 } // namespace WebCore |
| 140 |
| 141 #endif // DartScriptValueDeserializer_h |
OLD | NEW |