| 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 16 matching lines...) Expand all Loading... |
| 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 blink { | 35 namespace blink { |
| 36 | 36 |
| 37 template<typename T> class LifecycleContext; | |
| 38 | |
| 39 template<typename T> | 37 template<typename T> |
| 40 class LifecycleNotifier { | 38 class LifecycleNotifier { |
| 41 public: | 39 public: |
| 42 typedef LifecycleObserver<T> Observer; | 40 typedef LifecycleObserver<T> Observer; |
| 43 typedef T Context; | 41 typedef T Context; |
| 44 | 42 |
| 45 static PassOwnPtr<LifecycleNotifier> create(Context* context) | 43 static PassOwnPtr<LifecycleNotifier> create(Context* context) |
| 46 { | 44 { |
| 47 return adoptPtr(new LifecycleNotifier(context)); | 45 return adoptPtr(new LifecycleNotifier(context)); |
| 48 } | 46 } |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 { | 107 { |
| 110 RELEASE_ASSERT(m_iterating != IteratingOverAll); | 108 RELEASE_ASSERT(m_iterating != IteratingOverAll); |
| 111 m_observers.remove(observer); | 109 m_observers.remove(observer); |
| 112 } | 110 } |
| 113 | 111 |
| 114 | 112 |
| 115 | 113 |
| 116 } // namespace blink | 114 } // namespace blink |
| 117 | 115 |
| 118 #endif // LifecycleNotifier_h | 116 #endif // LifecycleNotifier_h |
| OLD | NEW |