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 #ifndef ScriptValueSerializer_h | 5 #ifndef ScriptValueSerializer_h |
6 #define ScriptValueSerializer_h | 6 #define ScriptValueSerializer_h |
7 | 7 |
8 #include "bindings/core/v8/SerializationTag.h" | 8 #include "bindings/core/v8/SerializationTag.h" |
9 #include "bindings/core/v8/SerializedScriptValue.h" | 9 #include "bindings/core/v8/SerializedScriptValue.h" |
10 #include "bindings/core/v8/V8Binding.h" | 10 #include "bindings/core/v8/V8Binding.h" |
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 template<class T> | 533 template<class T> |
534 bool doReadUintHelper(T* value) | 534 bool doReadUintHelper(T* value) |
535 { | 535 { |
536 *value = 0; | 536 *value = 0; |
537 uint8_t currentByte; | 537 uint8_t currentByte; |
538 int shift = 0; | 538 int shift = 0; |
539 do { | 539 do { |
540 if (m_position >= m_length) | 540 if (m_position >= m_length) |
541 return false; | 541 return false; |
542 currentByte = m_buffer[m_position++]; | 542 currentByte = m_buffer[m_position++]; |
543 *value |= ((currentByte & SerializedScriptValue::varIntMask) << shif
t); | 543 *value |= (static_cast<T>(currentByte & SerializedScriptValue::varIn
tMask) << shift); |
544 shift += SerializedScriptValue::varIntShift; | 544 shift += SerializedScriptValue::varIntShift; |
545 } while (currentByte & (1 << SerializedScriptValue::varIntShift)); | 545 } while (currentByte & (1 << SerializedScriptValue::varIntShift)); |
546 return true; | 546 return true; |
547 } | 547 } |
548 | 548 |
549 bool doReadUint64(uint64_t* value); | 549 bool doReadUint64(uint64_t* value); |
550 bool doReadNumber(double* number); | 550 bool doReadNumber(double* number); |
551 PassRefPtr<BlobDataHandle> getOrCreateBlobDataHandle(const String& uuid, con
st String& type, long long size = -1); | 551 PassRefPtr<BlobDataHandle> getOrCreateBlobDataHandle(const String& uuid, con
st String& type, long long size = -1); |
552 | 552 |
553 RefPtr<ScriptState> m_scriptState; | 553 RefPtr<ScriptState> m_scriptState; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
622 ArrayBufferContentsArray* m_arrayBufferContents; | 622 ArrayBufferContentsArray* m_arrayBufferContents; |
623 ImageBitmapContentsArray* m_imageBitmapContents; | 623 ImageBitmapContentsArray* m_imageBitmapContents; |
624 Vector<v8::Local<v8::Value>> m_arrayBuffers; | 624 Vector<v8::Local<v8::Value>> m_arrayBuffers; |
625 Vector<v8::Local<v8::Value>> m_imageBitmaps; | 625 Vector<v8::Local<v8::Value>> m_imageBitmaps; |
626 uint32_t m_version; | 626 uint32_t m_version; |
627 }; | 627 }; |
628 | 628 |
629 } // namespace blink | 629 } // namespace blink |
630 | 630 |
631 #endif // ScriptValueSerializer_h | 631 #endif // ScriptValueSerializer_h |
OLD | NEW |