OLD | NEW |
---|---|
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 Loading... | |
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 |
OLD | NEW |