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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 // of the HTML5 spec and generates exceptions as appropriate. | 90 // of the HTML5 spec and generates exceptions as appropriate. |
91 // Returns true if the array was filled, or false if the passed value was no
t of an appropriate type. | 91 // Returns true if the array was filled, or false if the passed value was no
t of an appropriate type. |
92 static bool extractTransferables(v8::Isolate*, v8::Local<v8::Value>, int, Me
ssagePortArray&, ArrayBufferArray&, ExceptionState&); | 92 static bool extractTransferables(v8::Isolate*, v8::Local<v8::Value>, int, Me
ssagePortArray&, ArrayBufferArray&, ExceptionState&); |
93 | 93 |
94 // Informs the V8 about external memory allocated and owned by this object.
Large values should contribute | 94 // Informs the V8 about external memory allocated and owned by this object.
Large values should contribute |
95 // to GC counters to eventually trigger a GC, otherwise flood of postMessage
() can cause OOM. | 95 // to GC counters to eventually trigger a GC, otherwise flood of postMessage
() can cause OOM. |
96 // Ok to invoke multiple times (only adds memory once). | 96 // Ok to invoke multiple times (only adds memory once). |
97 // The memory registration is revoked automatically in destructor. | 97 // The memory registration is revoked automatically in destructor. |
98 void registerMemoryAllocatedWithCurrentScriptContext(); | 98 void registerMemoryAllocatedWithCurrentScriptContext(); |
99 | 99 |
| 100 // Returns true if the value contains a transferable ArrayBuffer. |
| 101 bool containsTransferableArrayBuffer() const; |
| 102 |
100 private: | 103 private: |
101 // The followings are private, but used by SerializedScriptValueFactory. | 104 // The followings are private, but used by SerializedScriptValueFactory. |
102 enum StringDataMode { | 105 enum StringDataMode { |
103 StringValue, | 106 StringValue, |
104 WireData | 107 WireData |
105 }; | 108 }; |
106 typedef Vector<WTF::ArrayBufferContents, 1> ArrayBufferContentsArray; | 109 typedef Vector<WTF::ArrayBufferContents, 1> ArrayBufferContentsArray; |
107 | 110 |
108 SerializedScriptValue(); | 111 SerializedScriptValue(); |
109 explicit SerializedScriptValue(const String& wireData); | 112 explicit SerializedScriptValue(const String& wireData); |
(...skipping 11 matching lines...) Expand all Loading... |
121 OwnPtr<ArrayBufferContentsArray> m_arrayBufferContentsArray; | 124 OwnPtr<ArrayBufferContentsArray> m_arrayBufferContentsArray; |
122 BlobDataHandleMap m_blobDataHandles; | 125 BlobDataHandleMap m_blobDataHandles; |
123 intptr_t m_externallyAllocatedMemory; | 126 intptr_t m_externallyAllocatedMemory; |
124 | 127 |
125 friend class SerializedScriptValueFactory; | 128 friend class SerializedScriptValueFactory; |
126 }; | 129 }; |
127 | 130 |
128 } // namespace blink | 131 } // namespace blink |
129 | 132 |
130 #endif // SerializedScriptValue_h | 133 #endif // SerializedScriptValue_h |
OLD | NEW |