Index: WebCore/bindings/v8/SerializedScriptValue.h |
=================================================================== |
--- WebCore/bindings/v8/SerializedScriptValue.h (revision 140218) |
+++ WebCore/bindings/v8/SerializedScriptValue.h (working copy) |
@@ -34,14 +34,17 @@ |
#include "ScriptValue.h" |
#include <v8.h> |
#include <wtf/ArrayBuffer.h> |
+#include <wtf/HashMap.h> |
#include <wtf/Threading.h> |
namespace WebCore { |
+class BlobDataHandle; |
class MessagePort; |
typedef Vector<RefPtr<MessagePort>, 1> MessagePortArray; |
typedef Vector<RefPtr<WTF::ArrayBuffer>, 1> ArrayBufferArray; |
+typedef HashMap<String, RefPtr<BlobDataHandle> > BlobDataHandleMap; |
class SerializedScriptValue : public ThreadSafeRefCounted<SerializedScriptValue> { |
public: |
@@ -87,7 +90,10 @@ |
ScriptValue deserializeForInspector(ScriptState*); |
#endif |
- const Vector<String>& blobURLs() const { return m_blobURLs; } |
+ // Only reflects the truth if the SSV was created by walking a v8 value. The class |
+ // does not know about blobs potentially contained the data string when its its |
+ // been createdFromWire(data). |
+ bool containsBlobs() const { return !m_blobDataHandles.isEmpty(); } |
// Informs the V8 about external memory allocated and owned by this object. Large values should contribute |
// to GC counters to eventually trigger a GC, otherwise flood of postMessage() can cause OOM. |
@@ -96,10 +102,6 @@ |
void registerMemoryAllocatedWithCurrentScriptContext(); |
private: |
- enum StringDataMode { |
- StringValue, |
- WireData |
- }; |
typedef Vector<WTF::ArrayBufferContents, 1> ArrayBufferContentsArray; |
SerializedScriptValue(); |
@@ -110,7 +112,7 @@ |
String m_data; |
OwnPtr<ArrayBufferContentsArray> m_arrayBufferContentsArray; |
- Vector<String> m_blobURLs; |
+ BlobDataHandleMap m_blobDataHandles; |
intptr_t m_externallyAllocatedMemory; |
}; |