| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2014 Apple Inc. All rights reserved. | 3 * Copyright (C) 2014 Apple Inc. All rights reserved. |
| 4 * Copyright (C) 2014 Samsung Electronics. All rights reserved. | 4 * Copyright (C) 2014 Samsung Electronics. All rights reserved. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions are | 7 * modification, are permitted provided that the following conditions are |
| 8 * met: | 8 * met: |
| 9 * | 9 * |
| 10 * * Redistributions of source code must retain the above copyright | 10 * * Redistributions of source code must retain the above copyright |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 | 45 |
| 46 public: | 46 public: |
| 47 using ValueType = typename Container::ValueType; | 47 using ValueType = typename Container::ValueType; |
| 48 using iterator = ValueType*; | 48 using iterator = ValueType*; |
| 49 | 49 |
| 50 AttributeCollectionGeneric(Container& attributes) | 50 AttributeCollectionGeneric(Container& attributes) |
| 51 : m_attributes(attributes) {} | 51 : m_attributes(attributes) {} |
| 52 | 52 |
| 53 ValueType& operator[](unsigned index) const { return at(index); } | 53 ValueType& operator[](unsigned index) const { return at(index); } |
| 54 ValueType& at(unsigned index) const { | 54 ValueType& at(unsigned index) const { |
| 55 RELEASE_ASSERT(index < size()); | 55 CHECK_LT(index, size()); |
| 56 return begin()[index]; | 56 return begin()[index]; |
| 57 } | 57 } |
| 58 | 58 |
| 59 iterator begin() const { return m_attributes.data(); } | 59 iterator begin() const { return m_attributes.data(); } |
| 60 iterator end() const { return begin() + size(); } | 60 iterator end() const { return begin() + size(); } |
| 61 | 61 |
| 62 unsigned size() const { return m_attributes.size(); } | 62 unsigned size() const { return m_attributes.size(); } |
| 63 bool isEmpty() const { return !size(); } | 63 bool isEmpty() const { return !size(); } |
| 64 | 64 |
| 65 iterator find(const QualifiedName&) const; | 65 iterator find(const QualifiedName&) const; |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 shouldIgnoreAttributeCase)) | 214 shouldIgnoreAttributeCase)) |
| 215 return index; | 215 return index; |
| 216 } | 216 } |
| 217 } | 217 } |
| 218 return kNotFound; | 218 return kNotFound; |
| 219 } | 219 } |
| 220 | 220 |
| 221 } // namespace blink | 221 } // namespace blink |
| 222 | 222 |
| 223 #endif // AttributeCollection_h | 223 #endif // AttributeCollection_h |
| OLD | NEW |