| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All Rights Reserved. | 2 * Copyright (C) 2013 Google 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 18 matching lines...) Expand all Loading... |
| 29 #include "core/frame/DOMWindowLifecycleObserver.h" | 29 #include "core/frame/DOMWindowLifecycleObserver.h" |
| 30 #include "platform/LifecycleNotifier.h" | 30 #include "platform/LifecycleNotifier.h" |
| 31 #include "wtf/PassOwnPtr.h" | 31 #include "wtf/PassOwnPtr.h" |
| 32 #include "wtf/TemporaryChange.h" | 32 #include "wtf/TemporaryChange.h" |
| 33 #include "wtf/text/WTFString.h" | 33 #include "wtf/text/WTFString.h" |
| 34 | 34 |
| 35 namespace blink { | 35 namespace blink { |
| 36 | 36 |
| 37 class LocalDOMWindow; | 37 class LocalDOMWindow; |
| 38 | 38 |
| 39 class DOMWindowLifecycleNotifier FINAL : public LifecycleNotifier<LocalDOMWindow
> { | 39 class DOMWindowLifecycleNotifier final : public LifecycleNotifier<LocalDOMWindow
> { |
| 40 public: | 40 public: |
| 41 static PassOwnPtr<DOMWindowLifecycleNotifier> create(LocalDOMWindow*); | 41 static PassOwnPtr<DOMWindowLifecycleNotifier> create(LocalDOMWindow*); |
| 42 | 42 |
| 43 void notifyAddEventListener(LocalDOMWindow*, const AtomicString& eventType); | 43 void notifyAddEventListener(LocalDOMWindow*, const AtomicString& eventType); |
| 44 void notifyRemoveEventListener(LocalDOMWindow*, const AtomicString& eventTyp
e); | 44 void notifyRemoveEventListener(LocalDOMWindow*, const AtomicString& eventTyp
e); |
| 45 void notifyRemoveAllEventListeners(LocalDOMWindow*); | 45 void notifyRemoveAllEventListeners(LocalDOMWindow*); |
| 46 | 46 |
| 47 virtual void addObserver(Observer*) OVERRIDE; | 47 virtual void addObserver(Observer*) override; |
| 48 virtual void removeObserver(Observer*) OVERRIDE; | 48 virtual void removeObserver(Observer*) override; |
| 49 | 49 |
| 50 private: | 50 private: |
| 51 explicit DOMWindowLifecycleNotifier(LocalDOMWindow*); | 51 explicit DOMWindowLifecycleNotifier(LocalDOMWindow*); |
| 52 | 52 |
| 53 typedef HashSet<DOMWindowLifecycleObserver*> DOMWindowObserverSet; | 53 typedef HashSet<DOMWindowLifecycleObserver*> DOMWindowObserverSet; |
| 54 DOMWindowObserverSet m_windowObservers; | 54 DOMWindowObserverSet m_windowObservers; |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 } // namespace blink | 57 } // namespace blink |
| 58 | 58 |
| 59 #endif // DOMWindowLifecycleNotifier_h | 59 #endif // DOMWindowLifecycleNotifier_h |
| OLD | NEW |