| 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 "base/gtest_prod_util.h" | 8 #include "base/gtest_prod_util.h" |
| 9 #include "bindings/core/v8/SerializationTag.h" | 9 #include "bindings/core/v8/SerializationTag.h" |
| 10 #include "bindings/core/v8/SerializedScriptValue.h" | 10 #include "bindings/core/v8/SerializedScriptValue.h" |
| (...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 649 | 649 |
| 650 protected: | 650 protected: |
| 651 SerializedScriptValueReader& reader() { return m_reader; } | 651 SerializedScriptValueReader& reader() { return m_reader; } |
| 652 virtual bool read(v8::Local<v8::Value>*); | 652 virtual bool read(v8::Local<v8::Value>*); |
| 653 | 653 |
| 654 private: | 654 private: |
| 655 bool initializeObject(v8::Local<v8::Object>, | 655 bool initializeObject(v8::Local<v8::Object>, |
| 656 uint32_t numProperties, | 656 uint32_t numProperties, |
| 657 v8::Local<v8::Value>*); | 657 v8::Local<v8::Value>*); |
| 658 bool doDeserialize(); | 658 bool doDeserialize(); |
| 659 void push(v8::Local<v8::Value> value) { m_stack.append(value); }; | 659 void push(v8::Local<v8::Value> value) { m_stack.push_back(value); }; |
| 660 void pop(unsigned length) { | 660 void pop(unsigned length) { |
| 661 ASSERT(length <= m_stack.size()); | 661 ASSERT(length <= m_stack.size()); |
| 662 m_stack.shrink(m_stack.size() - length); | 662 m_stack.shrink(m_stack.size() - length); |
| 663 } | 663 } |
| 664 unsigned stackDepth() const { return m_stack.size(); } | 664 unsigned stackDepth() const { return m_stack.size(); } |
| 665 | 665 |
| 666 v8::Local<v8::Value> element(unsigned index); | 666 v8::Local<v8::Value> element(unsigned index); |
| 667 void openComposite(const v8::Local<v8::Value>&); | 667 void openComposite(const v8::Local<v8::Value>&); |
| 668 bool closeComposite(v8::Local<v8::Value>*); | 668 bool closeComposite(v8::Local<v8::Value>*); |
| 669 | 669 |
| 670 SerializedScriptValueReader& m_reader; | 670 SerializedScriptValueReader& m_reader; |
| 671 Vector<v8::Local<v8::Value>> m_stack; | 671 Vector<v8::Local<v8::Value>> m_stack; |
| 672 Vector<v8::Local<v8::Value>> m_objectPool; | 672 Vector<v8::Local<v8::Value>> m_objectPool; |
| 673 Vector<uint32_t> m_openCompositeReferenceStack; | 673 Vector<uint32_t> m_openCompositeReferenceStack; |
| 674 MessagePortArray* m_transferredMessagePorts; | 674 MessagePortArray* m_transferredMessagePorts; |
| 675 ArrayBufferContentsArray* m_arrayBufferContents; | 675 ArrayBufferContentsArray* m_arrayBufferContents; |
| 676 ImageBitmapContentsArray* m_imageBitmapContents; | 676 ImageBitmapContentsArray* m_imageBitmapContents; |
| 677 Vector<v8::Local<v8::Value>> m_arrayBuffers; | 677 Vector<v8::Local<v8::Value>> m_arrayBuffers; |
| 678 Vector<v8::Local<v8::Value>> m_imageBitmaps; | 678 Vector<v8::Local<v8::Value>> m_imageBitmaps; |
| 679 uint32_t m_version; | 679 uint32_t m_version; |
| 680 }; | 680 }; |
| 681 | 681 |
| 682 } // namespace blink | 682 } // namespace blink |
| 683 | 683 |
| 684 #endif // ScriptValueSerializer_h | 684 #endif // ScriptValueSerializer_h |
| OLD | NEW |