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

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

Issue 2494823002: V8ScriptValueSerializer: Use PartitionAlloc for the buffer, and avoid copying it into a String. (Closed)
Patch Set: initialize SerializedScriptValue::m_dataBufferSize Created 4 years, 1 month 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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8ScriptValueSerializer_h 5 #ifndef V8ScriptValueSerializer_h
6 #define V8ScriptValueSerializer_h 6 #define V8ScriptValueSerializer_h
7 7
8 #include "bindings/core/v8/ExceptionState.h" 8 #include "bindings/core/v8/ExceptionState.h"
9 #include "bindings/core/v8/ScriptState.h" 9 #include "bindings/core/v8/ScriptState.h"
10 #include "bindings/core/v8/SerializationTag.h" 10 #include "bindings/core/v8/SerializationTag.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 void finalizeTransfer(ExceptionState&); 74 void finalizeTransfer(ExceptionState&);
75 75
76 // Shared between File and FileList logic; does not write a leading tag. 76 // Shared between File and FileList logic; does not write a leading tag.
77 bool writeFile(File*, ExceptionState&); 77 bool writeFile(File*, ExceptionState&);
78 78
79 // v8::ValueSerializer::Delegate 79 // v8::ValueSerializer::Delegate
80 void ThrowDataCloneError(v8::Local<v8::String> message) override; 80 void ThrowDataCloneError(v8::Local<v8::String> message) override;
81 v8::Maybe<bool> WriteHostObject(v8::Isolate*, 81 v8::Maybe<bool> WriteHostObject(v8::Isolate*,
82 v8::Local<v8::Object> message) override; 82 v8::Local<v8::Object> message) override;
83 83
84 void* ReallocateBufferMemory(void* oldBuffer,
85 size_t,
86 size_t* actualSize) override;
87 void FreeBufferMemory(void* buffer) override;
88
84 RefPtr<ScriptState> m_scriptState; 89 RefPtr<ScriptState> m_scriptState;
85 RefPtr<SerializedScriptValue> m_serializedScriptValue; 90 RefPtr<SerializedScriptValue> m_serializedScriptValue;
86 v8::ValueSerializer m_serializer; 91 v8::ValueSerializer m_serializer;
87 const Transferables* m_transferables = nullptr; 92 const Transferables* m_transferables = nullptr;
88 const ExceptionState* m_exceptionState = nullptr; 93 const ExceptionState* m_exceptionState = nullptr;
89 WebBlobInfoArray* m_blobInfoArray = nullptr; 94 WebBlobInfoArray* m_blobInfoArray = nullptr;
90 95
91 #if DCHECK_IS_ON() 96 #if DCHECK_IS_ON()
92 bool m_serializeInvoked = false; 97 bool m_serializeInvoked = false;
93 #endif 98 #endif
94 }; 99 };
95 100
96 } // namespace blink 101 } // namespace blink
97 102
98 #endif // V8ScriptValueSerializer_h 103 #endif // V8ScriptValueSerializer_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698