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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.h

Issue 2087143002: [Binding] [Refactoring] Create Writer and Serializer in one method (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Debug build Created 4 years, 6 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 | « no previous file | third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.h
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.h b/third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.h
index fb2b414d72c708d01a0fea0dae9baf115521406e..7ed7d2b57821a819289c522838419c7bf8aa5d6a 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.h
+++ b/third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.h
@@ -204,19 +204,19 @@ class CORE_EXPORT ScriptValueSerializer {
WTF_MAKE_NONCOPYABLE(ScriptValueSerializer);
protected:
class StateBase;
-public:
- enum Status {
+ enum class Status {
Success,
InputError,
DataCloneError,
JSException
};
- ScriptValueSerializer(SerializedScriptValueWriter&, const Transferables*, WebBlobInfoArray*, BlobDataHandleMap& blobDataHandles, v8::TryCatch&, ScriptState*);
+public:
+ ScriptValueSerializer(SerializedScriptValueWriter&, const Transferables*, WebBlobInfoArray*, ScriptState*);
v8::Isolate* isolate() { return m_scriptState->isolate(); }
v8::Local<v8::Context> context() { return m_scriptState->context(); }
- Status serialize(v8::Local<v8::Value>);
+ PassRefPtr<SerializedScriptValue> serialize(v8::Local<v8::Value>, Transferables*, ExceptionState&);
String errorMessage() { return m_errorMessage; }
static String serializeWTFString(const String&);
@@ -374,6 +374,8 @@ protected:
private:
StateBase* doSerialize(v8::Local<v8::Value>, StateBase* next);
StateBase* doSerializeArrayBuffer(v8::Local<v8::Value> arrayBuffer, StateBase* next);
+ void transferData(Transferables*, ExceptionState&, SerializedScriptValue*);
+
StateBase* checkException(StateBase*);
StateBase* writeObject(uint32_t numProperties, StateBase*);
StateBase* writeSparseArray(uint32_t numProperties, uint32_t length, StateBase*);
@@ -385,7 +387,7 @@ private:
{
ASSERT(state);
++m_depth;
- return checkComposite(state) ? state : handleError(InputError, "Value being cloned is either cyclic or too deeply nested.", state);
+ return checkComposite(state) ? state : handleError(Status::InputError, "Value being cloned is either cyclic or too deeply nested.", state);
}
StateBase* pop(StateBase* state)
@@ -439,7 +441,7 @@ private:
RefPtr<ScriptState> m_scriptState;
SerializedScriptValueWriter& m_writer;
- v8::TryCatch& m_tryCatch;
+ v8::TryCatch m_tryCatch;
int m_depth;
Status m_status;
String m_errorMessage;
@@ -451,7 +453,7 @@ private:
ObjectPool m_transferredOffscreenCanvas;
uint32_t m_nextObjectReference;
WebBlobInfoArray* m_blobInfo;
- BlobDataHandleMap& m_blobDataHandles;
+ BlobDataHandleMap* m_blobDataHandles;
};
class ScriptValueDeserializer;
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698