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

Side by Side Diff: 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: Created 5 years, 7 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/ScriptWrappable.h ('k') | Source/core/workers/DedicatedWorkerGlobalScope.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698