OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
3 * Copyright (C) 2013 Google Inc. All Rights Reserved. | 3 * Copyright (C) 2013 Google Inc. All Rights Reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 | 86 |
87 template<typename T, typename Observer> | 87 template<typename T, typename Observer> |
88 inline LifecycleNotifier<T, Observer>::~LifecycleNotifier() | 88 inline LifecycleNotifier<T, Observer>::~LifecycleNotifier() |
89 { | 89 { |
90 // FIXME: Enable the following ASSERT. Also see a FIXME in Document::detach(
). | 90 // FIXME: Enable the following ASSERT. Also see a FIXME in Document::detach(
). |
91 // ASSERT(!m_observers.size() || m_didCallContextDestroyed); | 91 // ASSERT(!m_observers.size() || m_didCallContextDestroyed); |
92 | 92 |
93 #if !ENABLE(OILPAN) | 93 #if !ENABLE(OILPAN) |
94 TemporaryChange<IterationType> scope(m_iterating, IteratingOverAll); | 94 TemporaryChange<IterationType> scope(m_iterating, IteratingOverAll); |
95 for (Observer* observer : m_observers) { | 95 for (Observer* observer : m_observers) { |
96 ASSERT(observer->lifecycleContext() == context()); | |
97 observer->clearLifecycleContext(); | 96 observer->clearLifecycleContext(); |
98 } | 97 } |
99 #endif | 98 #endif |
100 } | 99 } |
101 | 100 |
102 template<typename T, typename Observer> | 101 template<typename T, typename Observer> |
103 inline void LifecycleNotifier<T, Observer>::notifyContextDestroyed() | 102 inline void LifecycleNotifier<T, Observer>::notifyContextDestroyed() |
104 { | 103 { |
105 // Don't notify contextDestroyed() twice. | 104 // Don't notify contextDestroyed() twice. |
106 if (m_didCallContextDestroyed) | 105 if (m_didCallContextDestroyed) |
(...skipping 25 matching lines...) Expand all Loading... |
132 | 131 |
133 template<typename T, typename Observer> | 132 template<typename T, typename Observer> |
134 inline void LifecycleNotifier<T, Observer>::removeObserver(Observer* observer) | 133 inline void LifecycleNotifier<T, Observer>::removeObserver(Observer* observer) |
135 { | 134 { |
136 m_observers.remove(observer); | 135 m_observers.remove(observer); |
137 } | 136 } |
138 | 137 |
139 } // namespace blink | 138 } // namespace blink |
140 | 139 |
141 #endif // LifecycleNotifier_h | 140 #endif // LifecycleNotifier_h |
OLD | NEW |