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

Unified Diff: third_party/WebKit/Source/platform/LifecycleContextTest.cpp

Issue 1686483002: Oilpan: Remove most WillBe types from the code base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/LifecycleContextTest.cpp
diff --git a/third_party/WebKit/Source/platform/LifecycleContextTest.cpp b/third_party/WebKit/Source/platform/LifecycleContextTest.cpp
index f89f0f50de186132eca85677ca5f84a11b10ee27..50c1e10f0be8b63cfb9aefa3176ecffaecf3188c 100644
--- a/third_party/WebKit/Source/platform/LifecycleContextTest.cpp
+++ b/third_party/WebKit/Source/platform/LifecycleContextTest.cpp
@@ -33,12 +33,12 @@ namespace blink {
class TestingObserver;
-class DummyContext final : public NoBaseWillBeGarbageCollectedFinalized<DummyContext>, public LifecycleNotifier<DummyContext, TestingObserver> {
- WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(DummyContext);
+class DummyContext final : public GarbageCollectedFinalized<DummyContext>, public LifecycleNotifier<DummyContext, TestingObserver> {
+ USING_GARBAGE_COLLECTED_MIXIN(DummyContext);
public:
- static PassOwnPtrWillBeRawPtr<DummyContext> create()
+ static RawPtr<DummyContext> create()
{
- return adoptPtrWillBeNoop(new DummyContext());
+ return new DummyContext();
}
DEFINE_INLINE_TRACE()
@@ -47,12 +47,12 @@ public:
}
};
-class TestingObserver final : public NoBaseWillBeGarbageCollectedFinalized<TestingObserver>, public LifecycleObserver<DummyContext, TestingObserver, DummyContext> {
- WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(TestingObserver);
+class TestingObserver final : public GarbageCollectedFinalized<TestingObserver>, public LifecycleObserver<DummyContext, TestingObserver, DummyContext> {
+ USING_GARBAGE_COLLECTED_MIXIN(TestingObserver);
public:
- static PassOwnPtrWillBeRawPtr<TestingObserver> create(DummyContext* context)
+ static RawPtr<TestingObserver> create(DummyContext* context)
{
- return adoptPtrWillBeNoop(new TestingObserver(context));
+ return new TestingObserver(context);
}
void contextDestroyed() override
@@ -73,7 +73,7 @@ public:
void unobserve() { setContext(nullptr); }
- void setObserverToRemoveAndDestroy(PassOwnPtrWillBeRawPtr<TestingObserver> observerToRemoveOnDestruct)
+ void setObserverToRemoveAndDestroy(RawPtr<TestingObserver> observerToRemoveOnDestruct)
{
ASSERT(!m_observerToRemoveOnDestruct);
m_observerToRemoveOnDestruct = observerToRemoveOnDestruct;
@@ -89,14 +89,14 @@ private:
{
}
- OwnPtrWillBeMember<TestingObserver> m_observerToRemoveOnDestruct;
+ Member<TestingObserver> m_observerToRemoveOnDestruct;
bool m_contextDestroyedCalled;
};
TEST(LifecycleContextTest, shouldObserveContextDestroyed)
{
- OwnPtrWillBeRawPtr<DummyContext> context = DummyContext::create();
- OwnPtrWillBePersistent<TestingObserver> observer = TestingObserver::create(context.get());
+ RawPtr<DummyContext> context = DummyContext::create();
+ Persistent<TestingObserver> observer = TestingObserver::create(context.get());
EXPECT_EQ(observer->lifecycleContext(), context.get());
EXPECT_FALSE(observer->contextDestroyedCalled());
@@ -109,8 +109,8 @@ TEST(LifecycleContextTest, shouldObserveContextDestroyed)
TEST(LifecycleContextTest, shouldNotObserveContextDestroyedIfUnobserve)
{
- OwnPtrWillBeRawPtr<DummyContext> context = DummyContext::create();
- OwnPtrWillBePersistent<TestingObserver> observer = TestingObserver::create(context.get());
+ RawPtr<DummyContext> context = DummyContext::create();
+ Persistent<TestingObserver> observer = TestingObserver::create(context.get());
observer->unobserve();
context->notifyContextDestroyed();
context = nullptr;
@@ -123,9 +123,9 @@ TEST(LifecycleContextTest, observerRemovedDuringNotifyDestroyed)
{
// FIXME: Oilpan: this test can be removed when the LifecycleNotifier<T>::m_observers
// hash set is on the heap and membership is handled implicitly by the garbage collector.
- OwnPtrWillBeRawPtr<DummyContext> context = DummyContext::create();
- OwnPtrWillBePersistent<TestingObserver> observer = TestingObserver::create(context.get());
- OwnPtrWillBeRawPtr<TestingObserver> innerObserver = TestingObserver::create(context.get());
+ RawPtr<DummyContext> context = DummyContext::create();
+ Persistent<TestingObserver> observer = TestingObserver::create(context.get());
+ RawPtr<TestingObserver> innerObserver = TestingObserver::create(context.get());
// Attach the observer to the other. When 'observer' is notified
// of destruction, it will remove & destroy 'innerObserver'.
observer->setObserverToRemoveAndDestroy(innerObserver.release());
« no previous file with comments | « third_party/WebKit/Source/platform/HostWindow.h ('k') | third_party/WebKit/Source/platform/LifecycleNotifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698