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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 { | 97 { |
98 unsigned activeDOMObjects = 0; | 98 unsigned activeDOMObjects = 0; |
99 for (ContextLifecycleObserver* observer : m_observers) { | 99 for (ContextLifecycleObserver* observer : m_observers) { |
100 if (observer->observerType() != ContextLifecycleObserver::ActiveDOMObjec
tType) | 100 if (observer->observerType() != ContextLifecycleObserver::ActiveDOMObjec
tType) |
101 continue; | 101 continue; |
102 activeDOMObjects++; | 102 activeDOMObjects++; |
103 } | 103 } |
104 return activeDOMObjects; | 104 return activeDOMObjects; |
105 } | 105 } |
106 | 106 |
107 bool ContextLifecycleNotifier::hasPendingActivity() const | |
108 { | |
109 for (ContextLifecycleObserver* observer : m_observers) { | |
110 if (observer->observerType() != ContextLifecycleObserver::ActiveDOMObjec
tType) | |
111 continue; | |
112 ActiveDOMObject* activeDOMObject = static_cast<ActiveDOMObject*>(observe
r); | |
113 if (activeDOMObject->hasPendingActivity()) | |
114 return true; | |
115 } | |
116 return false; | |
117 } | |
118 | |
119 #if ENABLE(ASSERT) | 107 #if ENABLE(ASSERT) |
120 bool ContextLifecycleNotifier::contains(ActiveDOMObject* object) const | 108 bool ContextLifecycleNotifier::contains(ActiveDOMObject* object) const |
121 { | 109 { |
122 for (ContextLifecycleObserver* observer : m_observers) { | 110 for (ContextLifecycleObserver* observer : m_observers) { |
123 if (observer->observerType() != ContextLifecycleObserver::ActiveDOMObjec
tType) | 111 if (observer->observerType() != ContextLifecycleObserver::ActiveDOMObjec
tType) |
124 continue; | 112 continue; |
125 ActiveDOMObject* activeDOMObject = static_cast<ActiveDOMObject*>(observe
r); | 113 ActiveDOMObject* activeDOMObject = static_cast<ActiveDOMObject*>(observe
r); |
126 if (activeDOMObject == object) | 114 if (activeDOMObject == object) |
127 return true; | 115 return true; |
128 } | 116 } |
129 return false; | 117 return false; |
130 } | 118 } |
131 #endif | 119 #endif |
132 | 120 |
133 } // namespace blink | 121 } // namespace blink |
OLD | NEW |