| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 | 74 |
| 75 virtual ~SerializedScriptValue(); | 75 virtual ~SerializedScriptValue(); |
| 76 | 76 |
| 77 static PassRefPtr<SerializedScriptValue> nullValue(); | 77 static PassRefPtr<SerializedScriptValue> nullValue(); |
| 78 | 78 |
| 79 String toWireString() const { return m_data; } | 79 String toWireString() const { return m_data; } |
| 80 void toWireBytes(Vector<char>&) const; | 80 void toWireBytes(Vector<char>&) const; |
| 81 | 81 |
| 82 // Deserializes the value (in the current context). Returns a null value in | 82 // Deserializes the value (in the current context). Returns a null value in |
| 83 // case of failure. | 83 // case of failure. |
| 84 v8::Handle<v8::Value> deserialize(MessagePortArray* = 0); | 84 v8::Local<v8::Value> deserialize(MessagePortArray* = 0); |
| 85 v8::Handle<v8::Value> deserialize(v8::Isolate*, MessagePortArray* = 0, const
WebBlobInfoArray* = 0); | 85 v8::Local<v8::Value> deserialize(v8::Isolate*, MessagePortArray* = 0, const
WebBlobInfoArray* = 0); |
| 86 | 86 |
| 87 // Helper function which pulls the values out of a JS sequence and into a Me
ssagePortArray. | 87 // Helper function which pulls the values out of a JS sequence and into a Me
ssagePortArray. |
| 88 // Also validates the elements per sections 4.1.13 and 4.1.15 of the WebIDL
spec and section 8.3.3 | 88 // Also validates the elements per sections 4.1.13 and 4.1.15 of the WebIDL
spec and section 8.3.3 |
| 89 // of the HTML5 spec and generates exceptions as appropriate. | 89 // of the HTML5 spec and generates exceptions as appropriate. |
| 90 // Returns true if the array was filled, or false if the passed value was no
t of an appropriate type. | 90 // Returns true if the array was filled, or false if the passed value was no
t of an appropriate type. |
| 91 static bool extractTransferables(v8::Isolate*, v8::Local<v8::Value>, int, Me
ssagePortArray&, ArrayBufferArray&, ExceptionState&); | 91 static bool extractTransferables(v8::Isolate*, v8::Local<v8::Value>, int, Me
ssagePortArray&, ArrayBufferArray&, ExceptionState&); |
| 92 | 92 |
| 93 // Informs the V8 about external memory allocated and owned by this object.
Large values should contribute | 93 // Informs the V8 about external memory allocated and owned by this object.
Large values should contribute |
| 94 // to GC counters to eventually trigger a GC, otherwise flood of postMessage
() can cause OOM. | 94 // to GC counters to eventually trigger a GC, otherwise flood of postMessage
() can cause OOM. |
| 95 // Ok to invoke multiple times (only adds memory once). | 95 // Ok to invoke multiple times (only adds memory once). |
| (...skipping 24 matching lines...) Expand all Loading... |
| 120 OwnPtr<ArrayBufferContentsArray> m_arrayBufferContentsArray; | 120 OwnPtr<ArrayBufferContentsArray> m_arrayBufferContentsArray; |
| 121 BlobDataHandleMap m_blobDataHandles; | 121 BlobDataHandleMap m_blobDataHandles; |
| 122 intptr_t m_externallyAllocatedMemory; | 122 intptr_t m_externallyAllocatedMemory; |
| 123 | 123 |
| 124 friend class SerializedScriptValueFactory; | 124 friend class SerializedScriptValueFactory; |
| 125 }; | 125 }; |
| 126 | 126 |
| 127 } // namespace blink | 127 } // namespace blink |
| 128 | 128 |
| 129 #endif // SerializedScriptValue_h | 129 #endif // SerializedScriptValue_h |
| OLD | NEW |