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

Side by Side Diff: Source/core/dom/ContextLifecycleNotifier.h

Issue 965393002: Simplify ContextLifecycleNotifier's handling of ActiveDOMObjects. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: simplify ContextLifecycleNotifier Created 5 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/core/dom/ContextLifecycleNotifier.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 28 matching lines...) Expand all
39 39
40 class ContextLifecycleNotifier : public LifecycleNotifier<ExecutionContext, Cont extLifecycleObserver> { 40 class ContextLifecycleNotifier : public LifecycleNotifier<ExecutionContext, Cont extLifecycleObserver> {
41 public: 41 public:
42 void addObserver(ContextLifecycleObserver*); 42 void addObserver(ContextLifecycleObserver*);
43 void removeObserver(ContextLifecycleObserver*); 43 void removeObserver(ContextLifecycleObserver*);
44 44
45 void notifyResumingActiveDOMObjects(); 45 void notifyResumingActiveDOMObjects();
46 void notifySuspendingActiveDOMObjects(); 46 void notifySuspendingActiveDOMObjects();
47 void notifyStoppingActiveDOMObjects(); 47 void notifyStoppingActiveDOMObjects();
48 48
49 using ActiveDOMObjectSet = HashSet<ActiveDOMObject*>; 49 unsigned activeDOMObjectCount() const { return m_activeDOMObjectCount; }
haraken 2015/03/03 04:46:21 This is used only in window.internals to count the
sof 2015/03/03 07:26:18 Agreed, iterating over the set to count them up is
50
51 const ActiveDOMObjectSet& activeDOMObjects() const { return m_activeDOMObjec ts; }
52 bool contains(ActiveDOMObject* object) const { return m_activeDOMObjects.con tains(object); }
53 bool hasPendingActivity() const; 50 bool hasPendingActivity() const;
54 51
55 protected: 52 protected:
56 explicit ContextLifecycleNotifier(ExecutionContext*); 53 explicit ContextLifecycleNotifier(ExecutionContext*);
57 54
55 #if ENABLE(ASSERT)
56 bool contains(ActiveDOMObject*) const;
57 #endif
58
58 private: 59 private:
59 ActiveDOMObjectSet m_activeDOMObjects; 60 unsigned m_activeDOMObjectCount;
60 }; 61 };
61 62
62 } // namespace blink 63 } // namespace blink
63 64
64 #endif // ContextLifecycleNotifier_h 65 #endif // ContextLifecycleNotifier_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/dom/ContextLifecycleNotifier.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698