Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: third_party/WebKit/Source/core/dom/ContextLifecycleNotifier.cpp

Issue 1609343002: Move hasPendingActivity from ActiveDOMObject to ScriptWrappable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698