| 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 | 29 |
| 30 #include "core/dom/DocumentLifecycleObserver.h" | 30 #include "core/dom/DocumentLifecycleObserver.h" |
| 31 | 31 |
| 32 namespace blink { | 32 namespace blink { |
| 33 | 33 |
| 34 DocumentLifecycleNotifier::DocumentLifecycleNotifier(Document* document) | 34 DocumentLifecycleNotifier::DocumentLifecycleNotifier(Document* document) |
| 35 : LifecycleNotifier<Document, DocumentLifecycleObserver>(document) | 35 : LifecycleNotifier<Document, DocumentLifecycleObserver>(document) |
| 36 { | 36 { |
| 37 } | 37 } |
| 38 | 38 |
| 39 void DocumentLifecycleNotifier::addObserver(DocumentLifecycleObserver* observer) | |
| 40 { | |
| 41 LifecycleNotifier<Document, DocumentLifecycleObserver>::addObserver(observer
); | |
| 42 } | |
| 43 | |
| 44 void DocumentLifecycleNotifier::removeObserver(DocumentLifecycleObserver* observ
er) | |
| 45 { | |
| 46 LifecycleNotifier<Document, DocumentLifecycleObserver>::removeObserver(obser
ver); | |
| 47 } | |
| 48 | |
| 49 void DocumentLifecycleNotifier::notifyDocumentWasDetached() | 39 void DocumentLifecycleNotifier::notifyDocumentWasDetached() |
| 50 { | 40 { |
| 51 TemporaryChange<IterationType> scope(m_iterating, IteratingOverAll); | 41 TemporaryChange<IterationType> scope(m_iterating, IteratingOverAll); |
| 52 for (DocumentLifecycleObserver* observer : m_observers) | 42 for (DocumentLifecycleObserver* observer : m_observers) |
| 53 observer->documentWasDetached(); | 43 observer->documentWasDetached(); |
| 54 } | 44 } |
| 55 | 45 |
| 56 #if !ENABLE(OILPAN) | 46 #if !ENABLE(OILPAN) |
| 57 void DocumentLifecycleNotifier::notifyDocumentWasDisposed() | 47 void DocumentLifecycleNotifier::notifyDocumentWasDisposed() |
| 58 { | 48 { |
| 59 TemporaryChange<IterationType> scope(m_iterating, IteratingOverAll); | 49 TemporaryChange<IterationType> scope(m_iterating, IteratingOverAll); |
| 60 for (DocumentLifecycleObserver* observer : m_observers) | 50 for (DocumentLifecycleObserver* observer : m_observers) |
| 61 observer->documentWasDisposed(); | 51 observer->documentWasDisposed(); |
| 62 } | 52 } |
| 63 #endif | 53 #endif |
| 64 | 54 |
| 65 } // namespace blink | 55 } // namespace blink |
| OLD | NEW |