| 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 { | 79 { |
| 80 TemporaryChange<IterationType> scope(this->m_iterating, IteratingOverActiveD
OMObjects); | 80 TemporaryChange<IterationType> scope(this->m_iterating, IteratingOverActiveD
OMObjects); |
| 81 ActiveDOMObjectSet::iterator activeObjectsEnd = m_activeDOMObjects.end(); | 81 ActiveDOMObjectSet::iterator activeObjectsEnd = m_activeDOMObjects.end(); |
| 82 for (ActiveDOMObjectSet::iterator iter = m_activeDOMObjects.begin(); iter !=
activeObjectsEnd; ++iter) { | 82 for (ActiveDOMObjectSet::iterator iter = m_activeDOMObjects.begin(); iter !=
activeObjectsEnd; ++iter) { |
| 83 ASSERT((*iter)->executionContext() == context()); | 83 ASSERT((*iter)->executionContext() == context()); |
| 84 ASSERT((*iter)->suspendIfNeededCalled()); | 84 ASSERT((*iter)->suspendIfNeededCalled()); |
| 85 (*iter)->suspend(); | 85 (*iter)->suspend(); |
| 86 } | 86 } |
| 87 } | 87 } |
| 88 | 88 |
| 89 void ContextLifecycleNotifier::notifyWillStopActiveDOMObjects() |
| 90 { |
| 91 TemporaryChange<IterationType> scope(this->m_iterating, IteratingOverActiveD
OMObjects); |
| 92 ActiveDOMObjectSet::iterator activeObjectsEnd = m_activeDOMObjects.end(); |
| 93 for (ActiveDOMObjectSet::iterator iter = m_activeDOMObjects.begin(); iter !=
activeObjectsEnd; ++iter) { |
| 94 ASSERT((*iter)->executionContext() == context()); |
| 95 ASSERT((*iter)->suspendIfNeededCalled()); |
| 96 (*iter)->willStop(); |
| 97 } |
| 98 } |
| 99 |
| 89 void ContextLifecycleNotifier::notifyStoppingActiveDOMObjects() | 100 void ContextLifecycleNotifier::notifyStoppingActiveDOMObjects() |
| 90 { | 101 { |
| 91 TemporaryChange<IterationType> scope(this->m_iterating, IteratingOverActiveD
OMObjects); | 102 TemporaryChange<IterationType> scope(this->m_iterating, IteratingOverActiveD
OMObjects); |
| 92 ActiveDOMObjectSet::iterator activeObjectsEnd = m_activeDOMObjects.end(); | 103 ActiveDOMObjectSet::iterator activeObjectsEnd = m_activeDOMObjects.end(); |
| 93 for (ActiveDOMObjectSet::iterator iter = m_activeDOMObjects.begin(); iter !=
activeObjectsEnd; ++iter) { | 104 for (ActiveDOMObjectSet::iterator iter = m_activeDOMObjects.begin(); iter !=
activeObjectsEnd; ++iter) { |
| 94 ASSERT((*iter)->executionContext() == context()); | 105 ASSERT((*iter)->executionContext() == context()); |
| 95 ASSERT((*iter)->suspendIfNeededCalled()); | 106 ASSERT((*iter)->suspendIfNeededCalled()); |
| 96 (*iter)->stop(); | 107 (*iter)->stop(); |
| 97 } | 108 } |
| 98 } | 109 } |
| 99 | 110 |
| 100 bool ContextLifecycleNotifier::hasPendingActivity() const | 111 bool ContextLifecycleNotifier::hasPendingActivity() const |
| 101 { | 112 { |
| 102 ActiveDOMObjectSet::const_iterator activeObjectsEnd = activeDOMObjects().end
(); | 113 ActiveDOMObjectSet::const_iterator activeObjectsEnd = activeDOMObjects().end
(); |
| 103 for (ActiveDOMObjectSet::const_iterator iter = activeDOMObjects().begin(); i
ter != activeObjectsEnd; ++iter) { | 114 for (ActiveDOMObjectSet::const_iterator iter = activeDOMObjects().begin(); i
ter != activeObjectsEnd; ++iter) { |
| 104 if ((*iter)->hasPendingActivity()) | 115 if ((*iter)->hasPendingActivity()) |
| 105 return true; | 116 return true; |
| 106 } | 117 } |
| 107 | 118 |
| 108 return false; | 119 return false; |
| 109 } | 120 } |
| 110 | 121 |
| 111 } // namespace WebCore | 122 } // namespace WebCore |
| OLD | NEW |