Chromium Code Reviews| Index: Source/bindings/v8/SerializedScriptValue.h |
| diff --git a/Source/bindings/v8/SerializedScriptValue.h b/Source/bindings/v8/SerializedScriptValue.h |
| index 3de5644db34c36e6d87db3b4f13012adb9908a60..2d94ec9edd50eaf4faf0652c0d4c6537f38c45bd 100644 |
| --- a/Source/bindings/v8/SerializedScriptValue.h |
| +++ b/Source/bindings/v8/SerializedScriptValue.h |
| @@ -33,6 +33,7 @@ |
| #include "bindings/v8/ScriptValue.h" |
| +#include "wtf/HashMap.h" |
| #include "wtf/ThreadSafeRefCounted.h" |
| #include <v8.h> |
| @@ -45,16 +46,19 @@ class ArrayBufferContents; |
| 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: |
| // Increment this for each incompatible change to the wire format. |
| // Version 2: Added StringUCharTag for UChar v8 strings. |
| - static const uint32_t wireFormatVersion = 2; |
| + // Version 3: Switched to using uuids as blob data identifiers. |
| + static const uint32_t wireFormatVersion = 3; |
| virtual ~SerializedScriptValue(); |
| @@ -95,7 +99,9 @@ public: |
| ScriptValue deserializeForInspector(ScriptState*); |
| - const Vector<String>& blobURLs() const { return m_blobURLs; } |
| + // Only reflects the truth if the SSV was created by walking a v8 value, not reliable |
|
jsbell
2013/10/02 22:24:41
I think the only callers of this basically do:
SS
|
| + // if the SSV was created 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. |
| @@ -122,7 +128,7 @@ private: |
| String m_data; |
| OwnPtr<ArrayBufferContentsArray> m_arrayBufferContentsArray; |
| - Vector<String> m_blobURLs; |
| + BlobDataHandleMap m_blobDataHandles; |
| intptr_t m_externallyAllocatedMemory; |
| }; |