Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(403)

Unified Diff: WebCore/bindings/v8/SerializedScriptValue.h

Issue 11192017: ********** WebCore blob hacking (Closed) Base URL: http://svn.webkit.org/repository/webkit/trunk/Source/
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « WebCore/bindings/js/SerializedScriptValue.h ('k') | WebCore/bindings/v8/SerializedScriptValue.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
};
« no previous file with comments | « WebCore/bindings/js/SerializedScriptValue.h ('k') | WebCore/bindings/v8/SerializedScriptValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698