| 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 16 matching lines...) Expand all Loading... |
| 27 #ifndef LifecycleObserver_h | 27 #ifndef LifecycleObserver_h |
| 28 #define LifecycleObserver_h | 28 #define LifecycleObserver_h |
| 29 | 29 |
| 30 #include "platform/heap/Handle.h" | 30 #include "platform/heap/Handle.h" |
| 31 #include "wtf/Assertions.h" | 31 #include "wtf/Assertions.h" |
| 32 | 32 |
| 33 namespace blink { | 33 namespace blink { |
| 34 | 34 |
| 35 template<typename T> | 35 template<typename T> |
| 36 class LifecycleObserver : public WillBeGarbageCollectedMixin { | 36 class LifecycleObserver : public WillBeGarbageCollectedMixin { |
| 37 // FIXME: Oilpan: Remove the pre-finalizer by moving LifecycleNotifer | 37 // FIXME: Oilpan: Remove the pre-finalizer by moving LifecycleNotifier |
| 38 // to Oilpan's heap and making LifecycleNotifer::m_observers | 38 // to Oilpan's heap and making LifecycleNotifier::m_observers |
| 39 // a hash set of weak members. | 39 // a hash set of weak members. |
| 40 #if ENABLE(OILPAN) | 40 WILL_BE_USING_PRE_FINALIZER(LifecycleObserver, dispose); |
| 41 USING_PRE_FINALIZER(LifecycleObserver, dispose); | |
| 42 #endif | |
| 43 public: | 41 public: |
| 44 typedef T Context; | 42 typedef T Context; |
| 45 | 43 |
| 46 enum Type { | 44 enum Type { |
| 47 ActiveDOMObjectType, | 45 ActiveDOMObjectType, |
| 48 DocumentLifecycleObserverType, | 46 DocumentLifecycleObserverType, |
| 49 GenericType, | 47 GenericType, |
| 50 PageLifecycleObserverType, | 48 PageLifecycleObserverType, |
| 51 DOMWindowLifecycleObserverType | 49 DOMWindowLifecycleObserverType |
| 52 }; | 50 }; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 | 101 |
| 104 m_lifecycleContext = context; | 102 m_lifecycleContext = context; |
| 105 | 103 |
| 106 if (m_lifecycleContext) | 104 if (m_lifecycleContext) |
| 107 observerContext(m_lifecycleContext.get(), this); | 105 observerContext(m_lifecycleContext.get(), this); |
| 108 } | 106 } |
| 109 | 107 |
| 110 } // namespace blink | 108 } // namespace blink |
| 111 | 109 |
| 112 #endif // LifecycleObserver_h | 110 #endif // LifecycleObserver_h |
| OLD | NEW |