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

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

Issue 2258033002: Replace ASSERT()s with DCHECK*() in core/html/*.{cpp,h}. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Replace ASSERT()s with DCHECK*() in core/html/*.{cpp,h}. Created 4 years, 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012,2013 Google Inc. All rights reserved. 2 * Copyright (C) 2012,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 * 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 98
99 this->setCachedNodeCount(m_cachedList.size()); 99 this->setCachedNodeCount(m_cachedList.size());
100 m_listValid = true; 100 m_listValid = true;
101 return this->cachedNodeCount(); 101 return this->cachedNodeCount();
102 } 102 }
103 103
104 template <typename Collection, typename NodeType> 104 template <typename Collection, typename NodeType>
105 inline NodeType* CollectionItemsCache<Collection, NodeType>::nodeAt(const Collec tion& collection, unsigned index) 105 inline NodeType* CollectionItemsCache<Collection, NodeType>::nodeAt(const Collec tion& collection, unsigned index)
106 { 106 {
107 if (m_listValid) { 107 if (m_listValid) {
108 ASSERT(this->isCachedNodeCountValid()); 108 DCHECK(this->isCachedNodeCountValid());
109 return index < this->cachedNodeCount() ? m_cachedList[index] : nullptr; 109 return index < this->cachedNodeCount() ? m_cachedList[index] : nullptr;
110 } 110 }
111 return Base::nodeAt(collection, index); 111 return Base::nodeAt(collection, index);
112 } 112 }
113 113
114 } // namespace blink 114 } // namespace blink
115 115
116 #endif // CollectionItemsCache_h 116 #endif // CollectionItemsCache_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698