| OLD | NEW |
| 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/PassOwnPtr.h" | 9 #include "wtf/PassOwnPtr.h" |
| 10 #include "wtf/allocator/PartitionAlloc.h" | 10 #include "wtf/allocator/PartitionAlloc.h" |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 std::swap(m_endIndex, other.m_endIndex); | 169 std::swap(m_endIndex, other.m_endIndex); |
| 170 std::swap(m_maxObjectSize, other.m_maxObjectSize); | 170 std::swap(m_maxObjectSize, other.m_maxObjectSize); |
| 171 } | 171 } |
| 172 | 172 |
| 173 ContiguousContainerBase::Buffer* | 173 ContiguousContainerBase::Buffer* |
| 174 ContiguousContainerBase::allocateNewBufferForNextAllocation(size_t bufferSize, c
onst char* typeName) | 174 ContiguousContainerBase::allocateNewBufferForNextAllocation(size_t bufferSize, c
onst char* typeName) |
| 175 { | 175 { |
| 176 ASSERT(m_buffers.isEmpty() || m_endIndex == m_buffers.size() - 1); | 176 ASSERT(m_buffers.isEmpty() || m_endIndex == m_buffers.size() - 1); |
| 177 OwnPtr<Buffer> newBuffer = adoptPtr(new Buffer(bufferSize, typeName)); | 177 OwnPtr<Buffer> newBuffer = adoptPtr(new Buffer(bufferSize, typeName)); |
| 178 Buffer* bufferToReturn = newBuffer.get(); | 178 Buffer* bufferToReturn = newBuffer.get(); |
| 179 m_buffers.append(newBuffer.release()); | 179 m_buffers.append(std::move(newBuffer)); |
| 180 m_endIndex = m_buffers.size() - 1; | 180 m_endIndex = m_buffers.size() - 1; |
| 181 return bufferToReturn; | 181 return bufferToReturn; |
| 182 } | 182 } |
| 183 | 183 |
| 184 } // namespace blink | 184 } // namespace blink |
| OLD | NEW |