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

Side by Side Diff: third_party/WebKit/Source/core/html/CollectionIndexCache.h

Issue 1406923009: Rename DISALLOW_ALLOCATION and ALLOW_ONLY_INLINE_ALLOCATION (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 /* 1 /*
2 * Copyright (C) 2013 Apple Inc. All rights reserved. 2 * Copyright (C) 2013 Apple Inc. All rights reserved.
3 * Copyright (C) 2014 Samsung Electronics. All rights reserved. 3 * Copyright (C) 2014 Samsung Electronics. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 18 matching lines...) Expand all
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32 #ifndef CollectionIndexCache_h 32 #ifndef CollectionIndexCache_h
33 #define CollectionIndexCache_h 33 #define CollectionIndexCache_h
34 34
35 namespace blink { 35 namespace blink {
36 36
37 template <typename Collection, typename NodeType> 37 template <typename Collection, typename NodeType>
38 class CollectionIndexCache { 38 class CollectionIndexCache {
39 DISALLOW_ALLOCATION(); 39 DISALLOW_NEW();
40 public: 40 public:
41 CollectionIndexCache(); 41 CollectionIndexCache();
42 42
43 bool isEmpty(const Collection& collection) 43 bool isEmpty(const Collection& collection)
44 { 44 {
45 if (isCachedNodeCountValid()) 45 if (isCachedNodeCountValid())
46 return !cachedNodeCount(); 46 return !cachedNodeCount();
47 if (cachedNode()) 47 if (cachedNode())
48 return false; 48 return false;
49 return !nodeAt(collection, 0); 49 return !nodeAt(collection, 0);
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 setCachedNodeCount(currentIndex + 1); 198 setCachedNodeCount(currentIndex + 1);
199 return nullptr; 199 return nullptr;
200 } 200 }
201 setCachedNode(currentNode, currentIndex); 201 setCachedNode(currentNode, currentIndex);
202 return currentNode; 202 return currentNode;
203 } 203 }
204 204
205 } // namespace blink 205 } // namespace blink
206 206
207 #endif // CollectionIndexCache_h 207 #endif // CollectionIndexCache_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/csp/CSPSourceList.h ('k') | third_party/WebKit/Source/core/html/CollectionItemsCache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698