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

Unified Diff: third_party/WebKit/Source/platform/heap/HeapTest.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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/heap/HeapTest.cpp
diff --git a/third_party/WebKit/Source/platform/heap/HeapTest.cpp b/third_party/WebKit/Source/platform/heap/HeapTest.cpp
index 40068ee58c430367cffad2485c479497c16d3b58..0cb7a06014f512634b0b52a70df052e26d19fece 100644
--- a/third_party/WebKit/Source/platform/heap/HeapTest.cpp
+++ b/third_party/WebKit/Source/platform/heap/HeapTest.cpp
@@ -1291,11 +1291,12 @@ class FinalizationObserverWithHashMap {
static ObserverMap& observe(Observable& target) {
ObserverMap& map = observers();
ObserverMap::AddResult result = map.add(&target, nullptr);
- if (result.isNewEntry)
+ if (result.isNewEntry) {
result.storedValue->value =
- wrapUnique(new FinalizationObserverWithHashMap(target));
- else
+ makeUnique<FinalizationObserverWithHashMap>(target);
+ } else {
ASSERT(result.storedValue->value);
+ }
return map;
}
@@ -6488,7 +6489,7 @@ class WeakPersistentHolder final {
TEST(HeapTest, WeakPersistent) {
Persistent<IntWrapper> object = new IntWrapper(20);
std::unique_ptr<WeakPersistentHolder> holder =
- wrapUnique(new WeakPersistentHolder(object));
+ makeUnique<WeakPersistentHolder>(object);
preciselyCollectGarbage();
EXPECT_TRUE(holder->object());
object = nullptr;
« no previous file with comments | « third_party/WebKit/Source/platform/heap/Heap.cpp ('k') | third_party/WebKit/Source/platform/heap/ThreadState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698