| OLD | NEW |
| 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 Array_h | 5 #ifndef Array_h |
| 6 #define Array_h | 6 #define Array_h |
| 7 | 7 |
| 8 #include "platform/PlatformExport.h" | 8 #include "platform/PlatformExport.h" |
| 9 #include "platform/inspector_protocol/Collections.h" | 9 #include "platform/inspector_protocol/Collections.h" |
| 10 #include "platform/inspector_protocol/ErrorSupport.h" | 10 #include "platform/inspector_protocol/ErrorSupport.h" |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 m_vector.append(std::move(value)); | 109 m_vector.append(std::move(value)); |
| 110 } | 110 } |
| 111 | 111 |
| 112 size_t length() | 112 size_t length() |
| 113 { | 113 { |
| 114 return m_vector.size(); | 114 return m_vector.size(); |
| 115 } | 115 } |
| 116 | 116 |
| 117 T* get(size_t index) | 117 T* get(size_t index) |
| 118 { | 118 { |
| 119 return m_vector[index].get(); | 119 return m_vector[index]; |
| 120 } | 120 } |
| 121 | 121 |
| 122 PassOwnPtr<protocol::ListValue> serialize() | 122 PassOwnPtr<protocol::ListValue> serialize() |
| 123 { | 123 { |
| 124 OwnPtr<protocol::ListValue> result = ListValue::create(); | 124 OwnPtr<protocol::ListValue> result = ListValue::create(); |
| 125 for (auto& item : m_vector) | 125 for (auto& item : m_vector) |
| 126 result->pushValue(toValue(item.get())); | 126 result->pushValue(toValue(item.get())); |
| 127 return result; | 127 return result; |
| 128 } | 128 } |
| 129 | 129 |
| 130 private: | 130 private: |
| 131 protocol::Vector<OwnPtr<T>> m_vector; | 131 protocol::Vector<OwnPtr<T>> m_vector; |
| 132 }; | 132 }; |
| 133 | 133 |
| 134 } // namespace platform | 134 } // namespace platform |
| 135 } // namespace blink | 135 } // namespace blink |
| 136 | 136 |
| 137 #endif // !defined(Array_h) | 137 #endif // !defined(Array_h) |
| OLD | NEW |