OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple 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 26 matching lines...) Expand all Loading... |
37 public: | 37 public: |
38 using Context = T; | 38 using Context = T; |
39 | 39 |
40 #if !ENABLE(OILPAN) | 40 #if !ENABLE(OILPAN) |
41 virtual ~LifecycleObserver() | 41 virtual ~LifecycleObserver() |
42 { | 42 { |
43 dispose(); | 43 dispose(); |
44 } | 44 } |
45 #endif | 45 #endif |
46 | 46 |
47 // TODO(Oilpan): remove eager sweeping once LifecycleObserver is | 47 EAGERLY_FINALIZE_WILL_BE_REMOVED(); |
48 // always on the heap. | |
49 EAGERLY_SWEEP(); | |
50 DEFINE_INLINE_VIRTUAL_TRACE() | 48 DEFINE_INLINE_VIRTUAL_TRACE() |
51 { | 49 { |
52 visitor->trace(m_lifecycleContext); | 50 visitor->trace(m_lifecycleContext); |
53 } | 51 } |
54 | 52 |
55 virtual void contextDestroyed() { } | 53 virtual void contextDestroyed() { } |
56 | 54 |
57 void dispose() | 55 void dispose() |
58 { | 56 { |
59 setContext(nullptr); | 57 setContext(nullptr); |
(...skipping 23 matching lines...) Expand all Loading... |
83 | 81 |
84 m_lifecycleContext = context; | 82 m_lifecycleContext = context; |
85 | 83 |
86 if (m_lifecycleContext) | 84 if (m_lifecycleContext) |
87 static_cast<Notifier*>(m_lifecycleContext.get())->addObserver(static_cas
t<Observer*>(this)); | 85 static_cast<Notifier*>(m_lifecycleContext.get())->addObserver(static_cas
t<Observer*>(this)); |
88 } | 86 } |
89 | 87 |
90 } // namespace blink | 88 } // namespace blink |
91 | 89 |
92 #endif // LifecycleObserver_h | 90 #endif // LifecycleObserver_h |
OLD | NEW |