Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(123)

Side by Side Diff: third_party/WebKit/Source/core/dom/AttributeCollection.h

Issue 2727843003: Replace RELEASE_ASSERT with CHECK in core/{dom,editing,html} (Closed)
Patch Set: Add a comment Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/DOMDataView.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/DOMDataView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698