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

Side by Side Diff: base/observer_list.h

Issue 2451933003: base: Erase unused FOR_EACH_OBSERVER macro. (Closed)
Patch Set: Created 4 years, 1 month 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 BASE_OBSERVER_LIST_H_ 5 #ifndef BASE_OBSERVER_LIST_H_
6 #define BASE_OBSERVER_LIST_H_ 6 #define BASE_OBSERVER_LIST_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 ObserverListBase<ObserverType>::Compact(); 337 ObserverListBase<ObserverType>::Compact();
338 DCHECK_EQ(ObserverListBase<ObserverType>::size(), 0U); 338 DCHECK_EQ(ObserverListBase<ObserverType>::size(), 0U);
339 } 339 }
340 } 340 }
341 341
342 bool might_have_observers() const { 342 bool might_have_observers() const {
343 return ObserverListBase<ObserverType>::size() != 0; 343 return ObserverListBase<ObserverType>::size() != 0;
344 } 344 }
345 }; 345 };
346 346
347 // Deprecated. Use the range-based for loop instead.
348 #define FOR_EACH_OBSERVER(ObserverType, observer_list, func) \
349 do { \
350 for (ObserverType & o : observer_list) \
351 o.func; \
352 } while (0)
353
354 } // namespace base 347 } // namespace base
355 348
356 #endif // BASE_OBSERVER_LIST_H_ 349 #endif // BASE_OBSERVER_LIST_H_
OLDNEW
« no previous file with comments | « base/android/java/src/org/chromium/base/ObserverList.java ('k') | base/observer_list_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698