| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 void assign(const U* values, size_t size) | 117 void assign(const U* values, size_t size) |
| 118 { | 118 { |
| 119 m_data.assign(values, values + size); | 119 m_data.assign(values, values + size); |
| 120 } | 120 } |
| 121 | 121 |
| 122 size_t size() const { return m_data.size(); } | 122 size_t size() const { return m_data.size(); } |
| 123 bool isEmpty() const { return m_data.empty(); } | 123 bool isEmpty() const { return m_data.empty(); } |
| 124 | 124 |
| 125 T& operator[](size_t i) | 125 T& operator[](size_t i) |
| 126 { | 126 { |
| 127 BLINK_ASSERT(i < m_data.size()); | 127 DCHECK_LT(i, m_data.size()); |
| 128 return m_data[i]; | 128 return m_data[i]; |
| 129 } | 129 } |
| 130 | 130 |
| 131 const T& operator[](size_t i) const | 131 const T& operator[](size_t i) const |
| 132 { | 132 { |
| 133 BLINK_ASSERT(i < m_data.size()); | 133 DCHECK_LT(i, m_data.size()); |
| 134 return m_data[i]; | 134 return m_data[i]; |
| 135 } | 135 } |
| 136 | 136 |
| 137 T* data() { return m_data.data(); } | 137 T* data() { return m_data.data(); } |
| 138 const T* data() const { return m_data.data(); } | 138 const T* data() const { return m_data.data(); } |
| 139 | 139 |
| 140 iterator begin() { return m_data.begin(); } | 140 iterator begin() { return m_data.begin(); } |
| 141 iterator end() { return m_data.end(); } | 141 iterator end() { return m_data.end(); } |
| 142 const_iterator begin() const { return m_data.begin(); } | 142 const_iterator begin() const { return m_data.begin(); } |
| 143 const_iterator end() const { return m_data.end(); } | 143 const_iterator end() const { return m_data.end(); } |
| 144 | 144 |
| 145 void swap(WebVector<T>& other) | 145 void swap(WebVector<T>& other) |
| 146 { | 146 { |
| 147 m_data.swap(other.m_data); | 147 m_data.swap(other.m_data); |
| 148 } | 148 } |
| 149 | 149 |
| 150 private: | 150 private: |
| 151 std::vector<T> m_data; | 151 std::vector<T> m_data; |
| 152 }; | 152 }; |
| 153 | 153 |
| 154 } // namespace blink | 154 } // namespace blink |
| 155 | 155 |
| 156 #endif | 156 #endif |
| OLD | NEW |