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

Side by Side Diff: third_party/WebKit/Source/platform/LifecycleContextTest.cpp

Issue 1929493002: Remove unnecessary uses of GarbageCollectedFinalized<>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add two leftover classes needing same treatment Created 4 years, 7 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) 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 29 matching lines...) Expand all
40 { 40 {
41 return new DummyContext; 41 return new DummyContext;
42 } 42 }
43 43
44 DEFINE_INLINE_TRACE() 44 DEFINE_INLINE_TRACE()
45 { 45 {
46 LifecycleNotifier<DummyContext, TestingObserver>::trace(visitor); 46 LifecycleNotifier<DummyContext, TestingObserver>::trace(visitor);
47 } 47 }
48 }; 48 };
49 49
50 class TestingObserver final : public GarbageCollectedFinalized<TestingObserver>, public LifecycleObserver<DummyContext, TestingObserver, DummyContext> { 50 class TestingObserver final : public GarbageCollected<TestingObserver>, public L ifecycleObserver<DummyContext, TestingObserver, DummyContext> {
51 USING_GARBAGE_COLLECTED_MIXIN(TestingObserver); 51 USING_GARBAGE_COLLECTED_MIXIN(TestingObserver);
52 public: 52 public:
53 static TestingObserver* create(DummyContext* context) 53 static TestingObserver* create(DummyContext* context)
54 { 54 {
55 return new TestingObserver(context); 55 return new TestingObserver(context);
56 } 56 }
57 57
58 void contextDestroyed() override 58 void contextDestroyed() override
59 { 59 {
60 LifecycleObserver::contextDestroyed(); 60 LifecycleObserver::contextDestroyed();
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 135
136 context->notifyContextDestroyed(); 136 context->notifyContextDestroyed();
137 EXPECT_EQ(observer->innerObserver(), nullptr); 137 EXPECT_EQ(observer->innerObserver(), nullptr);
138 context = nullptr; 138 context = nullptr;
139 ThreadHeap::collectAllGarbage(); 139 ThreadHeap::collectAllGarbage();
140 EXPECT_EQ(observer->lifecycleContext(), static_cast<DummyContext*>(0)); 140 EXPECT_EQ(observer->lifecycleContext(), static_cast<DummyContext*>(0));
141 EXPECT_TRUE(observer->contextDestroyedCalled()); 141 EXPECT_TRUE(observer->contextDestroyedCalled());
142 } 142 }
143 143
144 } // namespace blink 144 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698