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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/ContiguousContainer.h

Issue 2419663009: Convert a few more CFI blacklist entries into DISABLE_CFI_PERF attributes. (Closed)
Patch Set: Created 4 years, 2 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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 ContiguousContainer_h 5 #ifndef ContiguousContainer_h
6 #define ContiguousContainer_h 6 #define ContiguousContainer_h
7 7
8 #include "base/compiler_specific.h"
8 #include "platform/PlatformExport.h" 9 #include "platform/PlatformExport.h"
9 #include "wtf/Alignment.h" 10 #include "wtf/Alignment.h"
10 #include "wtf/Allocator.h" 11 #include "wtf/Allocator.h"
11 #include "wtf/Compiler.h" 12 #include "wtf/Compiler.h"
12 #include "wtf/Noncopyable.h" 13 #include "wtf/Noncopyable.h"
13 #include "wtf/TypeTraits.h" 14 #include "wtf/TypeTraits.h"
14 #include "wtf/Vector.h" 15 #include "wtf/Vector.h"
15 #include <cstddef> 16 #include <cstddef>
16 #include <iterator> 17 #include <iterator>
17 #include <memory> 18 #include <memory>
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 return *new (alignedAllocate(sizeof(DerivedElementType))) 202 return *new (alignedAllocate(sizeof(DerivedElementType)))
202 DerivedElementType(std::forward<Args>(args)...); 203 DerivedElementType(std::forward<Args>(args)...);
203 } 204 }
204 205
205 void removeLast() { 206 void removeLast() {
206 ASSERT(!isEmpty()); 207 ASSERT(!isEmpty());
207 last().~BaseElementType(); 208 last().~BaseElementType();
208 ContiguousContainerBase::removeLast(); 209 ContiguousContainerBase::removeLast();
209 } 210 }
210 211
212 DISABLE_CFI_PERF
211 void clear() { 213 void clear() {
212 for (auto& element : *this) { 214 for (auto& element : *this) {
213 (void)element; // MSVC incorrectly reports this variable as unused. 215 (void)element; // MSVC incorrectly reports this variable as unused.
214 element.~BaseElementType(); 216 element.~BaseElementType();
215 } 217 }
216 ContiguousContainerBase::clear(); 218 ContiguousContainerBase::clear();
217 } 219 }
218 220
219 void swap(ContiguousContainer& other) { 221 void swap(ContiguousContainer& other) {
220 ContiguousContainerBase::swap(other); 222 ContiguousContainerBase::swap(other);
(...skipping 22 matching lines...) Expand all
243 DCHECK_EQ(alignedSize % alignment, 0u); 245 DCHECK_EQ(alignedSize % alignment, 0u);
244 DCHECK_GE(alignedSize, size); 246 DCHECK_GE(alignedSize, size);
245 DCHECK_LT(alignedSize, size + alignment); 247 DCHECK_LT(alignedSize, size + alignment);
246 return alignedSize; 248 return alignedSize;
247 } 249 }
248 }; 250 };
249 251
250 } // namespace blink 252 } // namespace blink
251 253
252 #endif // ContiguousContainer_h 254 #endif // ContiguousContainer_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/PODIntervalTree.h ('k') | third_party/WebKit/Source/platform/graphics/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698