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

Side by Side Diff: third_party/WebKit/public/platform/WebVector.h

Issue 2799563002: Replace usage of WebVector::isEmpty with WebVector::empty().
Patch Set: Created 3 years, 8 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 | « third_party/WebKit/Source/web/tests/WebImageTest.cpp ('k') | no next file » | 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) 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 m_data.assign(other.begin(), other.end()); 105 m_data.assign(other.begin(), other.end());
106 } 106 }
107 107
108 template <typename U> 108 template <typename U>
109 void assign(const U* values, size_t size) { 109 void assign(const U* values, size_t size) {
110 m_data.assign(values, values + size); 110 m_data.assign(values, values + size);
111 } 111 }
112 112
113 size_t size() const { return m_data.size(); } 113 size_t size() const { return m_data.size(); }
114 bool empty() const { return m_data.empty(); } 114 bool empty() const { return m_data.empty(); }
115 // TODO(slangley): Remove all uses of isEmpty.
116 bool isEmpty() const { return empty(); }
117 115
118 T& operator[](size_t i) { 116 T& operator[](size_t i) {
119 DCHECK_LT(i, m_data.size()); 117 DCHECK_LT(i, m_data.size());
120 return m_data[i]; 118 return m_data[i];
121 } 119 }
122 120
123 const T& operator[](size_t i) const { 121 const T& operator[](size_t i) const {
124 DCHECK_LT(i, m_data.size()); 122 DCHECK_LT(i, m_data.size());
125 return m_data[i]; 123 return m_data[i];
126 } 124 }
127 125
128 T* data() { return m_data.data(); } 126 T* data() { return m_data.data(); }
129 const T* data() const { return m_data.data(); } 127 const T* data() const { return m_data.data(); }
130 128
131 iterator begin() { return m_data.begin(); } 129 iterator begin() { return m_data.begin(); }
132 iterator end() { return m_data.end(); } 130 iterator end() { return m_data.end(); }
133 const_iterator begin() const { return m_data.begin(); } 131 const_iterator begin() const { return m_data.begin(); }
134 const_iterator end() const { return m_data.end(); } 132 const_iterator end() const { return m_data.end(); }
135 133
136 void swap(WebVector<T>& other) { m_data.swap(other.m_data); } 134 void swap(WebVector<T>& other) { m_data.swap(other.m_data); }
137 135
138 private: 136 private:
139 std::vector<T> m_data; 137 std::vector<T> m_data;
140 }; 138 };
141 139
142 } // namespace blink 140 } // namespace blink
143 141
144 #endif 142 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/tests/WebImageTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698