| 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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 | 150 |
| 151 template <typename T, typename Observer> | 151 template <typename T, typename Observer> |
| 152 inline void LifecycleNotifier<T, Observer>::removeObserver(Observer* observer) { | 152 inline void LifecycleNotifier<T, Observer>::removeObserver(Observer* observer) { |
| 153 // If immediate removal isn't currently allowed, | 153 // If immediate removal isn't currently allowed, |
| 154 // |observer| is recorded for pending removal. | 154 // |observer| is recorded for pending removal. |
| 155 if (m_iterationState & AllowPendingRemoval) { | 155 if (m_iterationState & AllowPendingRemoval) { |
| 156 m_observers.insert(observer); | 156 m_observers.insert(observer); |
| 157 return; | 157 return; |
| 158 } | 158 } |
| 159 RELEASE_ASSERT(m_iterationState & AllowingRemoval); | 159 RELEASE_ASSERT(m_iterationState & AllowingRemoval); |
| 160 m_observers.remove(observer); | 160 m_observers.erase(observer); |
| 161 } | 161 } |
| 162 | 162 |
| 163 } // namespace blink | 163 } // namespace blink |
| 164 | 164 |
| 165 #endif // LifecycleNotifier_h | 165 #endif // LifecycleNotifier_h |
| OLD | NEW |