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

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

Issue 916033002: Oilpan: Move LifecycleNotifier's hierarchy to Oilpan's heap Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « Source/modules/webmidi/MIDIAccessInitializer.cpp ('k') | Source/platform/LifecycleNotifier.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 17 matching lines...) Expand all
28 28
29 #include "platform/LifecycleNotifier.h" 29 #include "platform/LifecycleNotifier.h"
30 #include "platform/heap/Handle.h" 30 #include "platform/heap/Handle.h"
31 #include <gtest/gtest.h> 31 #include <gtest/gtest.h>
32 32
33 using namespace blink; 33 using namespace blink;
34 34
35 namespace blink { 35 namespace blink {
36 36
37 class DummyContext final : public NoBaseWillBeGarbageCollectedFinalized<DummyCon text>, public LifecycleNotifier<DummyContext> { 37 class DummyContext final : public NoBaseWillBeGarbageCollectedFinalized<DummyCon text>, public LifecycleNotifier<DummyContext> {
38 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(DummyContext);
38 public: 39 public:
39 DummyContext() 40 DummyContext()
40 : LifecycleNotifier<DummyContext>(this) 41 : LifecycleNotifier<DummyContext>(this)
41 { 42 {
42 } 43 }
43 44
44 void trace(Visitor* visitor) 45 void trace(Visitor* visitor)
45 { 46 {
46 LifecycleNotifier<DummyContext>::trace(visitor); 47 LifecycleNotifier<DummyContext>::trace(visitor);
47 } 48 }
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 Persistent<TestingObserver> observer = new TestingObserver(context.get()); 102 Persistent<TestingObserver> observer = new TestingObserver(context.get());
102 observer->unobserve(); 103 observer->unobserve();
103 context->notifyContextDestroyed(); 104 context->notifyContextDestroyed();
104 context = nullptr; 105 context = nullptr;
105 Heap::collectAllGarbage(); 106 Heap::collectAllGarbage();
106 EXPECT_EQ(observer->lifecycleContext(), static_cast<DummyContext*>(0)); 107 EXPECT_EQ(observer->lifecycleContext(), static_cast<DummyContext*>(0));
107 EXPECT_FALSE(observer->m_contextDestroyedCalled); 108 EXPECT_FALSE(observer->m_contextDestroyedCalled);
108 } 109 }
109 110
110 } 111 }
OLDNEW
« no previous file with comments | « Source/modules/webmidi/MIDIAccessInitializer.cpp ('k') | Source/platform/LifecycleNotifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698