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

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

Issue 2518253002: Move Partition Allocator into Chromium base. (Closed)
Patch Set: Move OOM_CRASH into its own, more specific header. Fixes Windows build. Created 4 years 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 #include "platform/graphics/ContiguousContainer.h" 5 #include "platform/graphics/ContiguousContainer.h"
6 6
7 #include "wtf/Allocator.h" 7 #include "wtf/Allocator.h"
8 #include "wtf/ContainerAnnotations.h" 8 #include "wtf/ContainerAnnotations.h"
9 #include "wtf/PtrUtil.h" 9 #include "wtf/PtrUtil.h"
10 #include "wtf/allocator/PartitionAlloc.h"
11 #include "wtf/allocator/Partitions.h" 10 #include "wtf/allocator/Partitions.h"
12 #include <algorithm> 11 #include <algorithm>
13 #include <memory> 12 #include <memory>
14 13
15 namespace blink { 14 namespace blink {
16 15
17 // Default number of max-sized elements to allocate space for, if there is no 16 // Default number of max-sized elements to allocate space for, if there is no
18 // initial buffer. 17 // initial buffer.
19 static const unsigned kDefaultInitialBufferSize = 32; 18 static const unsigned kDefaultInitialBufferSize = 32;
20 19
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 ASSERT(m_buffers.isEmpty() || m_endIndex == m_buffers.size() - 1); 171 ASSERT(m_buffers.isEmpty() || m_endIndex == m_buffers.size() - 1);
173 std::unique_ptr<Buffer> newBuffer = 172 std::unique_ptr<Buffer> newBuffer =
174 WTF::makeUnique<Buffer>(bufferSize, typeName); 173 WTF::makeUnique<Buffer>(bufferSize, typeName);
175 Buffer* bufferToReturn = newBuffer.get(); 174 Buffer* bufferToReturn = newBuffer.get();
176 m_buffers.append(std::move(newBuffer)); 175 m_buffers.append(std::move(newBuffer));
177 m_endIndex = m_buffers.size() - 1; 176 m_endIndex = m_buffers.size() - 1;
178 return bufferToReturn; 177 return bufferToReturn;
179 } 178 }
180 179
181 } // namespace blink 180 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698