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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.h

Issue 2305703002: Move V8-based serialization into dedicated classes and add support for ArrayBuffer transfer. (Closed)
Patch Set: reviewer comments Created 4 years, 3 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009, 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2009, 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 // Returns true if the value contains a transferable ArrayBuffer. 106 // Returns true if the value contains a transferable ArrayBuffer.
107 bool containsTransferableArrayBuffer() const; 107 bool containsTransferableArrayBuffer() const;
108 108
109 String& data() { return m_data; } 109 String& data() { return m_data; }
110 BlobDataHandleMap& blobDataHandles() { return m_blobDataHandles; } 110 BlobDataHandleMap& blobDataHandles() { return m_blobDataHandles; }
111 ArrayBufferContentsArray* getArrayBufferContentsArray() { return m_arrayBuff erContentsArray.get(); } 111 ArrayBufferContentsArray* getArrayBufferContentsArray() { return m_arrayBuff erContentsArray.get(); }
112 ImageBitmapContentsArray* getImageBitmapContentsArray() { return m_imageBitm apContentsArray.get(); } 112 ImageBitmapContentsArray* getImageBitmapContentsArray() { return m_imageBitm apContentsArray.get(); }
113 113
114 private: 114 private:
115 friend class ScriptValueSerializer; 115 friend class ScriptValueSerializer;
116 friend class V8ScriptValueSerializer;
116 117
117 enum StringDataMode { 118 enum StringDataMode {
118 StringValue, 119 StringValue,
119 WireData 120 WireData
120 }; 121 };
121 122
122 SerializedScriptValue(); 123 SerializedScriptValue();
123 explicit SerializedScriptValue(const String& wireData); 124 explicit SerializedScriptValue(const String& wireData);
124 125
125 void setData(const String& data) { m_data = data; } 126 void setData(const String& data) { m_data = data; }
126 void transferArrayBuffers(v8::Isolate*, const ArrayBufferArray&, ExceptionSt ate&); 127 void transferArrayBuffers(v8::Isolate*, const ArrayBufferArray&, ExceptionSt ate&);
127 void transferImageBitmaps(v8::Isolate*, const ImageBitmapArray&, ExceptionSt ate&); 128 void transferImageBitmaps(v8::Isolate*, const ImageBitmapArray&, ExceptionSt ate&);
128 void transferOffscreenCanvas(v8::Isolate*, const OffscreenCanvasArray&, Exce ptionState&); 129 void transferOffscreenCanvas(v8::Isolate*, const OffscreenCanvasArray&, Exce ptionState&);
129 130
130 String m_data; 131 String m_data;
131 std::unique_ptr<ArrayBufferContentsArray> m_arrayBufferContentsArray; 132 std::unique_ptr<ArrayBufferContentsArray> m_arrayBufferContentsArray;
132 std::unique_ptr<ImageBitmapContentsArray> m_imageBitmapContentsArray; 133 std::unique_ptr<ImageBitmapContentsArray> m_imageBitmapContentsArray;
133 BlobDataHandleMap m_blobDataHandles; 134 BlobDataHandleMap m_blobDataHandles;
134 intptr_t m_externallyAllocatedMemory; 135 intptr_t m_externallyAllocatedMemory;
135 }; 136 };
136 137
137 } // namespace blink 138 } // namespace blink
138 139
139 #endif // SerializedScriptValue_h 140 #endif // SerializedScriptValue_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698