OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009, 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2009, 2010 Google Inc. 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 typedef Vector<RefPtr<WTF::ArrayBuffer>, 1> ArrayBufferArray; | 53 typedef Vector<RefPtr<WTF::ArrayBuffer>, 1> ArrayBufferArray; |
54 typedef HashMap<String, RefPtr<BlobDataHandle> > BlobDataHandleMap; | 54 typedef HashMap<String, RefPtr<BlobDataHandle> > BlobDataHandleMap; |
55 | 55 |
56 class SerializedScriptValue : public ThreadSafeRefCounted<SerializedScriptValue>
{ | 56 class SerializedScriptValue : public ThreadSafeRefCounted<SerializedScriptValue>
{ |
57 public: | 57 public: |
58 // Increment this for each incompatible change to the wire format. | 58 // Increment this for each incompatible change to the wire format. |
59 // Version 2: Added StringUCharTag for UChar v8 strings. | 59 // Version 2: Added StringUCharTag for UChar v8 strings. |
60 // Version 3: Switched to using uuids as blob data identifiers. | 60 // Version 3: Switched to using uuids as blob data identifiers. |
61 static const uint32_t wireFormatVersion = 3; | 61 static const uint32_t wireFormatVersion = 3; |
62 | 62 |
63 virtual ~SerializedScriptValue(); | 63 ~SerializedScriptValue(); |
64 | 64 |
65 // If a serialization error occurs (e.g., cyclic input value) this | 65 // If a serialization error occurs (e.g., cyclic input value) this |
66 // function returns an empty representation, schedules a V8 exception to | 66 // function returns an empty representation, schedules a V8 exception to |
67 // be thrown using v8::ThrowException(), and sets |didThrow|. In this case | 67 // be thrown using v8::ThrowException(), and sets |didThrow|. In this case |
68 // the caller must not invoke any V8 operations until control returns to | 68 // the caller must not invoke any V8 operations until control returns to |
69 // V8. When serialization is successful, |didThrow| is false. | 69 // V8. When serialization is successful, |didThrow| is false. |
70 static PassRefPtr<SerializedScriptValue> create(v8::Handle<v8::Value>, Messa
gePortArray*, ArrayBufferArray*, bool& didThrow, v8::Isolate*); | 70 static PassRefPtr<SerializedScriptValue> create(v8::Handle<v8::Value>, Messa
gePortArray*, ArrayBufferArray*, bool& didThrow, v8::Isolate*); |
71 static PassRefPtr<SerializedScriptValue> create(v8::Handle<v8::Value>, v8::I
solate*); | 71 static PassRefPtr<SerializedScriptValue> create(v8::Handle<v8::Value>, v8::I
solate*); |
72 static PassRefPtr<SerializedScriptValue> createFromWire(const String&); | 72 static PassRefPtr<SerializedScriptValue> createFromWire(const String&); |
73 static PassRefPtr<SerializedScriptValue> createFromWireBytes(const Vector<ui
nt8_t>&); | 73 static PassRefPtr<SerializedScriptValue> createFromWireBytes(const Vector<ui
nt8_t>&); |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 | 128 |
129 String m_data; | 129 String m_data; |
130 OwnPtr<ArrayBufferContentsArray> m_arrayBufferContentsArray; | 130 OwnPtr<ArrayBufferContentsArray> m_arrayBufferContentsArray; |
131 BlobDataHandleMap m_blobDataHandles; | 131 BlobDataHandleMap m_blobDataHandles; |
132 intptr_t m_externallyAllocatedMemory; | 132 intptr_t m_externallyAllocatedMemory; |
133 }; | 133 }; |
134 | 134 |
135 } // namespace WebCore | 135 } // namespace WebCore |
136 | 136 |
137 #endif // SerializedScriptValue_h | 137 #endif // SerializedScriptValue_h |
OLD | NEW |