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

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

Issue 223123002: Add blob serialization support [currently unused] to SerializedScriptValue. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebaseline crypto tests Created 6 years, 8 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 | « Source/bindings/v8/IDBBindingUtilities.cpp ('k') | Source/bindings/v8/SerializedScriptValue.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/SerializedScriptValue.h
diff --git a/Source/bindings/v8/SerializedScriptValue.h b/Source/bindings/v8/SerializedScriptValue.h
index 35978435c684737a062cf5efa07f87ec9112ede3..c3815420605998d0aacbf17002101ff28e099eca 100644
--- a/Source/bindings/v8/SerializedScriptValue.h
+++ b/Source/bindings/v8/SerializedScriptValue.h
@@ -32,11 +32,16 @@
#define SerializedScriptValue_h
#include "bindings/v8/ScriptValue.h"
-
#include "wtf/HashMap.h"
#include "wtf/ThreadSafeRefCounted.h"
#include <v8.h>
+namespace blink {
+
+class WebBlobInfo;
+
+}
+
namespace WTF {
class ArrayBuffer;
@@ -53,6 +58,7 @@ class MessagePort;
typedef Vector<RefPtr<MessagePort>, 1> MessagePortArray;
typedef Vector<RefPtr<WTF::ArrayBuffer>, 1> ArrayBufferArray;
typedef HashMap<String, RefPtr<BlobDataHandle> > BlobDataHandleMap;
+typedef Vector<blink::WebBlobInfo> WebBlobInfoArray;
class SerializedScriptValue FINAL : public ThreadSafeRefCounted<SerializedScriptValue> {
public:
@@ -61,7 +67,8 @@ public:
// Version 3: Switched to using uuids as blob data identifiers.
// Version 4: Extended File serialization to be complete.
// Version 5: Added CryptoKeyTag for Key objects.
- static const uint32_t wireFormatVersion = 5;
+ // Version 6: Added indexed serialization for File, Blob, and FileList.
+ static const uint32_t wireFormatVersion = 6;
~SerializedScriptValue();
@@ -76,8 +83,7 @@ public:
static PassRefPtr<SerializedScriptValue> create(const String&);
static PassRefPtr<SerializedScriptValue> create(const String&, v8::Isolate*);
static PassRefPtr<SerializedScriptValue> create();
-
- static PassRefPtr<SerializedScriptValue> create(const ScriptValue&, ExceptionState&, ScriptState*);
+ static PassRefPtr<SerializedScriptValue> create(const ScriptValue&, WebBlobInfoArray*, ExceptionState&, ScriptState*);
// Never throws exceptions.
static PassRefPtr<SerializedScriptValue> createAndSwallowExceptions(v8::Handle<v8::Value>, v8::Isolate*);
@@ -90,7 +96,7 @@ public:
// Deserializes the value (in the current context). Returns a null value in
// case of failure.
v8::Handle<v8::Value> deserialize(MessagePortArray* = 0);
- v8::Handle<v8::Value> deserialize(v8::Isolate*, MessagePortArray* = 0);
+ v8::Handle<v8::Value> deserialize(v8::Isolate*, MessagePortArray* = 0, const WebBlobInfoArray* = 0);
// Helper function which pulls the values out of a JS sequence and into a MessagePortArray.
// Also validates the elements per sections 4.1.13 and 4.1.15 of the WebIDL spec and section 8.3.3
@@ -116,7 +122,7 @@ private:
typedef Vector<WTF::ArrayBufferContents, 1> ArrayBufferContentsArray;
SerializedScriptValue();
- SerializedScriptValue(v8::Handle<v8::Value>, MessagePortArray*, ArrayBufferArray*, ExceptionState&, v8::Isolate*);
+ SerializedScriptValue(v8::Handle<v8::Value>, MessagePortArray*, ArrayBufferArray*, WebBlobInfoArray*, ExceptionState&, v8::Isolate*);
explicit SerializedScriptValue(const String& wireData);
static PassOwnPtr<ArrayBufferContentsArray> transferArrayBuffers(ArrayBufferArray&, ExceptionState&, v8::Isolate*);
« no previous file with comments | « Source/bindings/v8/IDBBindingUtilities.cpp ('k') | Source/bindings/v8/SerializedScriptValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698