| 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/ScriptValueSerializer.h" | 5 #include "bindings/core/v8/ScriptValueSerializer.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/Transferables.h" | 7 #include "bindings/core/v8/Transferables.h" |
| 8 #include "bindings/core/v8/V8ArrayBuffer.h" | 8 #include "bindings/core/v8/V8ArrayBuffer.h" |
| 9 #include "bindings/core/v8/V8ArrayBufferView.h" | 9 #include "bindings/core/v8/V8ArrayBufferView.h" |
| 10 #include "bindings/core/v8/V8Blob.h" | 10 #include "bindings/core/v8/V8Blob.h" |
| (...skipping 1608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1619 return true; | 1619 return true; |
| 1620 } | 1620 } |
| 1621 | 1621 |
| 1622 bool SerializedScriptValueReader::readString(v8::Local<v8::Value>* value) | 1622 bool SerializedScriptValueReader::readString(v8::Local<v8::Value>* value) |
| 1623 { | 1623 { |
| 1624 uint32_t length; | 1624 uint32_t length; |
| 1625 if (!doReadUint32(&length)) | 1625 if (!doReadUint32(&length)) |
| 1626 return false; | 1626 return false; |
| 1627 if (m_position + length > m_length) | 1627 if (m_position + length > m_length) |
| 1628 return false; | 1628 return false; |
| 1629 *value = v8AtomicString(isolate(), reinterpret_cast<const char*>(m_buffer +
m_position), length); | 1629 *value = v8StringFromUtf8(isolate(), reinterpret_cast<const char*>(m_buffer
+ m_position), length); |
| 1630 m_position += length; | 1630 m_position += length; |
| 1631 return true; | 1631 return true; |
| 1632 } | 1632 } |
| 1633 | 1633 |
| 1634 bool SerializedScriptValueReader::readUCharString(v8::Local<v8::Value>* value) | 1634 bool SerializedScriptValueReader::readUCharString(v8::Local<v8::Value>* value) |
| 1635 { | 1635 { |
| 1636 uint32_t length; | 1636 uint32_t length; |
| 1637 if (!doReadUint32(&length) || (length & 1)) | 1637 if (!doReadUint32(&length) || (length & 1)) |
| 1638 return false; | 1638 return false; |
| 1639 if (m_position + length > m_length) | 1639 if (m_position + length > m_length) |
| (...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2413 return false; | 2413 return false; |
| 2414 uint32_t objectReference = m_openCompositeReferenceStack[m_openCompositeRefe
renceStack.size() - 1]; | 2414 uint32_t objectReference = m_openCompositeReferenceStack[m_openCompositeRefe
renceStack.size() - 1]; |
| 2415 m_openCompositeReferenceStack.shrink(m_openCompositeReferenceStack.size() -
1); | 2415 m_openCompositeReferenceStack.shrink(m_openCompositeReferenceStack.size() -
1); |
| 2416 if (objectReference >= m_objectPool.size()) | 2416 if (objectReference >= m_objectPool.size()) |
| 2417 return false; | 2417 return false; |
| 2418 *object = m_objectPool[objectReference]; | 2418 *object = m_objectPool[objectReference]; |
| 2419 return true; | 2419 return true; |
| 2420 } | 2420 } |
| 2421 | 2421 |
| 2422 } // namespace blink | 2422 } // namespace blink |
| OLD | NEW |