| 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 28 matching lines...) Expand all Loading... |
| 39 DocumentLifecycleObserver::~DocumentLifecycleObserver() | 39 DocumentLifecycleObserver::~DocumentLifecycleObserver() |
| 40 { | 40 { |
| 41 observeContext(0, DocumentLifecycleObserverType); | 41 observeContext(0, DocumentLifecycleObserverType); |
| 42 } | 42 } |
| 43 | 43 |
| 44 DocumentLifecycleNotifier::DocumentLifecycleNotifier(ScriptExecutionContext* con
text) | 44 DocumentLifecycleNotifier::DocumentLifecycleNotifier(ScriptExecutionContext* con
text) |
| 45 : ContextLifecycleNotifier(context) | 45 : ContextLifecycleNotifier(context) |
| 46 { | 46 { |
| 47 } | 47 } |
| 48 | 48 |
| 49 void DocumentLifecycleNotifier::addObserver(ContextLifecycleObserver* observer,
ContextLifecycleObserver::Type as) | 49 void DocumentLifecycleNotifier::addObserver(LifecycleObserver* observer, Lifecyc
leObserver::Type type) |
| 50 { | 50 { |
| 51 if (as == ContextLifecycleObserver::DocumentLifecycleObserverType) { | 51 if (type == LifecycleObserver::DocumentLifecycleObserverType) { |
| 52 RELEASE_ASSERT(m_iterating != IteratingOverDocumentObservers); | 52 RELEASE_ASSERT(m_iterating != IteratingOverDocumentObservers); |
| 53 m_documentObservers.add(static_cast<DocumentLifecycleObserver*>(observer
)); | 53 m_documentObservers.add(static_cast<DocumentLifecycleObserver*>(observer
)); |
| 54 } | 54 } |
| 55 | 55 |
| 56 ContextLifecycleNotifier::addObserver(observer, as); | 56 ContextLifecycleNotifier::addObserver(observer, type); |
| 57 } | 57 } |
| 58 | 58 |
| 59 void DocumentLifecycleNotifier::removeObserver(ContextLifecycleObserver* observe
r, ContextLifecycleObserver::Type as) | 59 void DocumentLifecycleNotifier::removeObserver(LifecycleObserver* observer, Life
cycleObserver::Type type) |
| 60 { | 60 { |
| 61 if (as == ContextLifecycleObserver::DocumentLifecycleObserverType) { | 61 if (type == LifecycleObserver::DocumentLifecycleObserverType) { |
| 62 RELEASE_ASSERT(m_iterating != IteratingOverDocumentObservers); | 62 RELEASE_ASSERT(m_iterating != IteratingOverDocumentObservers); |
| 63 m_documentObservers.remove(static_cast<DocumentLifecycleObserver*>(obser
ver)); | 63 m_documentObservers.remove(static_cast<DocumentLifecycleObserver*>(obser
ver)); |
| 64 } | 64 } |
| 65 | 65 |
| 66 ContextLifecycleNotifier::removeObserver(observer, as); | 66 ContextLifecycleNotifier::removeObserver(observer, type); |
| 67 } | 67 } |
| 68 | 68 |
| 69 } // namespace WebCore | 69 } // namespace WebCore |
| OLD | NEW |