OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "bindings/core/v8/SerializedScriptValueFactory.h" | 5 #include "bindings/core/v8/SerializedScriptValueFactory.h" |
6 | 6 |
7 #include "bindings/core/v8/ExceptionState.h" | 7 #include "bindings/core/v8/ExceptionState.h" |
8 #include "bindings/core/v8/ScriptValueSerializer.h" | 8 #include "bindings/core/v8/ScriptValueSerializer.h" |
9 #include "bindings/core/v8/Transferables.h" | 9 #include "bindings/core/v8/Transferables.h" |
10 #include "core/dom/DOMArrayBuffer.h" | 10 #include "core/dom/DOMArrayBuffer.h" |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 // information stored in m_data isn't even encoded in UTF-16. Instead, | 148 // information stored in m_data isn't even encoded in UTF-16. Instead, |
149 // unicode characters are encoded as UTF-8 with two code units per UChar. | 149 // unicode characters are encoded as UTF-8 with two code units per UChar. |
150 SerializedScriptValueReader reader(reinterpret_cast<const uint8_t*>(data.imp
l()->characters16()), 2 * data.length(), blobInfo, blobDataHandles, ScriptState:
:current(isolate)); | 150 SerializedScriptValueReader reader(reinterpret_cast<const uint8_t*>(data.imp
l()->characters16()), 2 * data.length(), blobInfo, blobDataHandles, ScriptState:
:current(isolate)); |
151 ScriptValueDeserializer deserializer(reader, messagePorts, arrayBufferConten
tsArray, imageBitmapContentsArray); | 151 ScriptValueDeserializer deserializer(reader, messagePorts, arrayBufferConten
tsArray, imageBitmapContentsArray); |
152 | 152 |
153 // deserialize() can run arbitrary script (e.g., setters), which could resul
t in |this| being destroyed. | 153 // deserialize() can run arbitrary script (e.g., setters), which could resul
t in |this| being destroyed. |
154 // Holding a RefPtr ensures we are alive (along with our internal data) thro
ughout the operation. | 154 // Holding a RefPtr ensures we are alive (along with our internal data) thro
ughout the operation. |
155 return deserializer.deserialize(); | 155 return deserializer.deserialize(); |
156 } | 156 } |
157 | 157 |
158 | |
159 } // namespace blink | 158 } // namespace blink |
OLD | NEW |