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

Side by Side Diff: third_party/WebKit/Source/platform/PODArena.h

Issue 2306293002: Replaced PassRefPtr copies with moves in Source/platform. (Closed)
Patch Set: Created 4 years, 3 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) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 74
75 // Creates a new PODArena configured with a FastMallocAllocator. 75 // Creates a new PODArena configured with a FastMallocAllocator.
76 static PassRefPtr<PODArena> create() 76 static PassRefPtr<PODArena> create()
77 { 77 {
78 return adoptRef(new PODArena); 78 return adoptRef(new PODArena);
79 } 79 }
80 80
81 // Creates a new PODArena configured with the given Allocator. 81 // Creates a new PODArena configured with the given Allocator.
82 static PassRefPtr<PODArena> create(PassRefPtr<Allocator> allocator) 82 static PassRefPtr<PODArena> create(PassRefPtr<Allocator> allocator)
83 { 83 {
84 return adoptRef(new PODArena(allocator)); 84 return adoptRef(new PODArena(std::move(allocator)));
85 } 85 }
86 86
87 // Allocates an object from the arena. 87 // Allocates an object from the arena.
88 template<class T> T* allocateObject() 88 template<class T> T* allocateObject()
89 { 89 {
90 return new (allocateBase<T>()) T(); 90 return new (allocateBase<T>()) T();
91 } 91 }
92 92
93 // Allocates an object from the arena, calling a single-argument constructor . 93 // Allocates an object from the arena, calling a single-argument constructor .
94 template<class T, class Argument1Type> T* allocateObject(const Argument1Type & argument1) 94 template<class T, class Argument1Type> T* allocateObject(const Argument1Type & argument1)
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 193
194 RefPtr<Allocator> m_allocator; 194 RefPtr<Allocator> m_allocator;
195 Chunk* m_current; 195 Chunk* m_current;
196 size_t m_currentChunkSize; 196 size_t m_currentChunkSize;
197 Vector<std::unique_ptr<Chunk>> m_chunks; 197 Vector<std::unique_ptr<Chunk>> m_chunks;
198 }; 198 };
199 199
200 } // namespace blink 200 } // namespace blink
201 201
202 #endif // PODArena_h 202 #endif // PODArena_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/Length.cpp ('k') | third_party/WebKit/Source/platform/PODFreeListArena.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698