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

Side by Side Diff: third_party/WebKit/Source/platform/heap/Heap.cpp

Issue 2494333002: Replace wrapUnique(new T(args)) by makeUnique<T>(args) in Blink (Closed)
Patch Set: Drop redundant WTF:: Created 4 years, 1 month 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 atomicAdd(&m_allocatedSpace, static_cast<long>(delta)); 198 atomicAdd(&m_allocatedSpace, static_cast<long>(delta));
199 ProcessHeap::increaseTotalAllocatedSpace(delta); 199 ProcessHeap::increaseTotalAllocatedSpace(delta);
200 } 200 }
201 201
202 void ThreadHeapStats::decreaseAllocatedSpace(size_t delta) { 202 void ThreadHeapStats::decreaseAllocatedSpace(size_t delta) {
203 atomicSubtract(&m_allocatedSpace, static_cast<long>(delta)); 203 atomicSubtract(&m_allocatedSpace, static_cast<long>(delta));
204 ProcessHeap::decreaseTotalAllocatedSpace(delta); 204 ProcessHeap::decreaseTotalAllocatedSpace(delta);
205 } 205 }
206 206
207 ThreadHeap::ThreadHeap() 207 ThreadHeap::ThreadHeap()
208 : m_regionTree(wrapUnique(new RegionTree())), 208 : m_regionTree(makeUnique<RegionTree>()),
209 m_heapDoesNotContainCache(wrapUnique(new HeapDoesNotContainCache)), 209 m_heapDoesNotContainCache(wrapUnique(new HeapDoesNotContainCache)),
210 m_safePointBarrier(wrapUnique(new SafePointBarrier())), 210 m_safePointBarrier(makeUnique<SafePointBarrier>()),
211 m_freePagePool(wrapUnique(new FreePagePool)), 211 m_freePagePool(wrapUnique(new FreePagePool)),
212 m_orphanedPagePool(wrapUnique(new OrphanedPagePool)), 212 m_orphanedPagePool(wrapUnique(new OrphanedPagePool)),
213 m_markingStack(CallbackStack::create()), 213 m_markingStack(CallbackStack::create()),
214 m_postMarkingCallbackStack(CallbackStack::create()), 214 m_postMarkingCallbackStack(CallbackStack::create()),
215 m_globalWeakCallbackStack(CallbackStack::create()), 215 m_globalWeakCallbackStack(CallbackStack::create()),
216 m_ephemeronStack(CallbackStack::create()) { 216 m_ephemeronStack(CallbackStack::create()) {
217 if (ThreadState::current()->isMainThread()) 217 if (ThreadState::current()->isMainThread())
218 s_mainThreadHeap = this; 218 s_mainThreadHeap = this;
219 219
220 MutexLocker locker(ThreadHeap::allHeapsMutex()); 220 MutexLocker locker(ThreadHeap::allHeapsMutex());
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
644 ProcessHeap::decreaseTotalMarkedObjectSize(m_stats.markedObjectSize()); 644 ProcessHeap::decreaseTotalMarkedObjectSize(m_stats.markedObjectSize());
645 645
646 m_stats.reset(); 646 m_stats.reset();
647 for (ThreadState* state : m_threads) 647 for (ThreadState* state : m_threads)
648 state->resetHeapCounters(); 648 state->resetHeapCounters();
649 } 649 }
650 650
651 ThreadHeap* ThreadHeap::s_mainThreadHeap = nullptr; 651 ThreadHeap* ThreadHeap::s_mainThreadHeap = nullptr;
652 652
653 } // namespace blink 653 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698