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

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

Issue 1133713008: [WIP] Migrate hasPendingActivity from ActiveDOMObject to ScriptWrappable. Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 2 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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 for (ContextLifecycleObserver* observer : m_observers) { 110 for (ContextLifecycleObserver* observer : m_observers) {
111 if (observer->observerType() != ContextLifecycleObserver::ActiveDOMObjec tType) 111 if (observer->observerType() != ContextLifecycleObserver::ActiveDOMObjec tType)
112 continue; 112 continue;
113 ActiveDOMObject* activeDOMObject = static_cast<ActiveDOMObject*>(observe r); 113 // ActiveDOMObject* activeDOMObject = static_cast<ActiveDOMObject*>(obse rver);
114 if (activeDOMObject->hasPendingActivity()) 114 // if (activeDOMObject->hasPendingActivity())
115 return true; 115 return true;
116 } 116 }
117 return false; 117 return false;
118 } 118 }
119 119
120 #if ENABLE(ASSERT) 120 #if ENABLE(ASSERT)
121 bool ContextLifecycleNotifier::contains(ActiveDOMObject* object) const 121 bool ContextLifecycleNotifier::contains(ActiveDOMObject* object) const
122 { 122 {
123 for (ContextLifecycleObserver* observer : m_observers) { 123 for (ContextLifecycleObserver* observer : m_observers) {
124 if (observer->observerType() != ContextLifecycleObserver::ActiveDOMObjec tType) 124 if (observer->observerType() != ContextLifecycleObserver::ActiveDOMObjec tType)
125 continue; 125 continue;
126 ActiveDOMObject* activeDOMObject = static_cast<ActiveDOMObject*>(observe r); 126 ActiveDOMObject* activeDOMObject = static_cast<ActiveDOMObject*>(observe r);
127 if (activeDOMObject == object) 127 if (activeDOMObject == object)
128 return true; 128 return true;
129 } 129 }
130 return false; 130 return false;
131 } 131 }
132 #endif 132 #endif
133 133
134 } // namespace blink 134 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698