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

Unified Diff: Source/core/dom/ContextLifecycleNotifier.h

Issue 968633002: Simplify lifecycle notifiers and observers. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/dom/ContextLifecycleNotifier.h
diff --git a/Source/core/dom/ContextLifecycleNotifier.h b/Source/core/dom/ContextLifecycleNotifier.h
index 178bf676ddc25d37917f03c261bbf2d8a4fd5fb1..3a4c914d973973124d58621585e1faf8e4ea69fb 100644
--- a/Source/core/dom/ContextLifecycleNotifier.h
+++ b/Source/core/dom/ContextLifecycleNotifier.h
@@ -30,26 +30,25 @@
#include "platform/LifecycleNotifier.h"
#include "wtf/HashSet.h"
-#include "wtf/PassOwnPtr.h"
namespace blink {
class ActiveDOMObject;
+class ContextLifecycleObserver;
class ExecutionContext;
-class ContextLifecycleNotifier : public LifecycleNotifier<ExecutionContext> {
+class ContextLifecycleNotifier : public LifecycleNotifier<ExecutionContext, ContextLifecycleObserver> {
public:
- typedef HashSet<ActiveDOMObject*> ActiveDOMObjectSet;
-
- const ActiveDOMObjectSet& activeDOMObjects() const { return m_activeDOMObjects; }
-
- virtual void addObserver(Observer*) override;
- virtual void removeObserver(Observer*) override;
+ void addObserver(ContextLifecycleObserver*);
+ void removeObserver(ContextLifecycleObserver*);
void notifyResumingActiveDOMObjects();
void notifySuspendingActiveDOMObjects();
void notifyStoppingActiveDOMObjects();
+ using ActiveDOMObjectSet = HashSet<ActiveDOMObject*>;
+
+ const ActiveDOMObjectSet& activeDOMObjects() const { return m_activeDOMObjects; }
haraken 2015/03/01 09:18:39 Why do we need to keep m_activeDOMObjects while we
sof 2015/03/01 10:00:39 We can remove it also if we accept iterating over
haraken 2015/03/01 10:47:56 Sure. Also I'm wondering if a right fix would be t
sof 2015/03/01 17:21:37 Once this change has proven itself and settled wel
bool contains(ActiveDOMObject* object) const { return m_activeDOMObjects.contains(object); }
bool hasPendingActivity() const;
« no previous file with comments | « no previous file | Source/core/dom/ContextLifecycleNotifier.cpp » ('j') | Source/core/frame/DOMWindowLifecycleNotifier.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698