Chromium Code Reviews| 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 100 for (ContextLifecycleObserver* observer : m_observers) { | 100 for (ContextLifecycleObserver* observer : m_observers) { |
| 101 if (observer->observerType() != ContextLifecycleObserver::ActiveDOMObjec tType) | 101 if (observer->observerType() != ContextLifecycleObserver::ActiveDOMObjec tType) |
| 102 continue; | 102 continue; |
| 103 activeDOMObjects++; | 103 activeDOMObjects++; |
| 104 } | 104 } |
| 105 return activeDOMObjects; | 105 return activeDOMObjects; |
| 106 } | 106 } |
| 107 | 107 |
| 108 bool ContextLifecycleNotifier::hasPendingActivity() const | 108 bool ContextLifecycleNotifier::hasPendingActivity() const |
| 109 { | 109 { |
| 110 // Any idea on how to handle this usage of ActiveDOMObject::hasPendingActivi ty? | |
|
haraken
2015/05/15 12:14:25
It seems that ContextLifecycleNotifier::hasPending
kinuko
2015/05/19 16:02:30
My old memory tells me that this code is (was?) us
| |
| 110 for (ContextLifecycleObserver* observer : m_observers) { | 111 for (ContextLifecycleObserver* observer : m_observers) { |
| 111 if (observer->observerType() != ContextLifecycleObserver::ActiveDOMObjec tType) | 112 if (observer->observerType() != ContextLifecycleObserver::ActiveDOMObjec tType) |
| 112 continue; | 113 continue; |
| 113 ActiveDOMObject* activeDOMObject = static_cast<ActiveDOMObject*>(observe r); | 114 ActiveDOMObject* activeDOMObject = static_cast<ActiveDOMObject*>(observe r); |
| 114 if (activeDOMObject->hasPendingActivity()) | 115 if (activeDOMObject->hasPendingActivity()) |
| 115 return true; | 116 return true; |
| 116 } | 117 } |
| 117 return false; | 118 return false; |
| 118 } | 119 } |
| 119 | 120 |
| 120 #if ENABLE(ASSERT) | 121 #if ENABLE(ASSERT) |
| 121 bool ContextLifecycleNotifier::contains(ActiveDOMObject* object) const | 122 bool ContextLifecycleNotifier::contains(ActiveDOMObject* object) const |
| 122 { | 123 { |
| 123 for (ContextLifecycleObserver* observer : m_observers) { | 124 for (ContextLifecycleObserver* observer : m_observers) { |
| 124 if (observer->observerType() != ContextLifecycleObserver::ActiveDOMObjec tType) | 125 if (observer->observerType() != ContextLifecycleObserver::ActiveDOMObjec tType) |
| 125 continue; | 126 continue; |
| 126 ActiveDOMObject* activeDOMObject = static_cast<ActiveDOMObject*>(observe r); | 127 ActiveDOMObject* activeDOMObject = static_cast<ActiveDOMObject*>(observe r); |
| 127 if (activeDOMObject == object) | 128 if (activeDOMObject == object) |
| 128 return true; | 129 return true; |
| 129 } | 130 } |
| 130 return false; | 131 return false; |
| 131 } | 132 } |
| 132 #endif | 133 #endif |
| 133 | 134 |
| 134 } // namespace blink | 135 } // namespace blink |
| OLD | NEW |