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 14 matching lines...) Expand all Loading... |
25 * | 25 * |
26 */ | 26 */ |
27 #ifndef LifecycleNotifier_h | 27 #ifndef LifecycleNotifier_h |
28 #define LifecycleNotifier_h | 28 #define LifecycleNotifier_h |
29 | 29 |
30 #include "platform/LifecycleObserver.h" | 30 #include "platform/LifecycleObserver.h" |
31 #include "wtf/HashSet.h" | 31 #include "wtf/HashSet.h" |
32 #include "wtf/PassOwnPtr.h" | 32 #include "wtf/PassOwnPtr.h" |
33 #include "wtf/TemporaryChange.h" | 33 #include "wtf/TemporaryChange.h" |
34 | 34 |
35 namespace WebCore { | 35 namespace blink { |
36 | 36 |
37 template<typename T> class LifecycleContext; | 37 template<typename T> class LifecycleContext; |
38 | 38 |
39 template<typename T> | 39 template<typename T> |
40 class LifecycleNotifier { | 40 class LifecycleNotifier { |
41 public: | 41 public: |
42 typedef LifecycleObserver<T> Observer; | 42 typedef LifecycleObserver<T> Observer; |
43 typedef T Context; | 43 typedef T Context; |
44 | 44 |
45 static PassOwnPtr<LifecycleNotifier> create(Context* context) | 45 static PassOwnPtr<LifecycleNotifier> create(Context* context) |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 | 106 |
107 template<typename T> | 107 template<typename T> |
108 inline void LifecycleNotifier<T>::removeObserver(typename LifecycleNotifier<T>::
Observer* observer) | 108 inline void LifecycleNotifier<T>::removeObserver(typename LifecycleNotifier<T>::
Observer* observer) |
109 { | 109 { |
110 RELEASE_ASSERT(m_iterating != IteratingOverAll); | 110 RELEASE_ASSERT(m_iterating != IteratingOverAll); |
111 m_observers.remove(observer); | 111 m_observers.remove(observer); |
112 } | 112 } |
113 | 113 |
114 | 114 |
115 | 115 |
116 } // namespace WebCore | 116 } // namespace blink |
117 | 117 |
118 #endif // LifecycleNotifier_h | 118 #endif // LifecycleNotifier_h |
OLD | NEW |