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 29 matching lines...) Expand all Loading... |
40 class ContextLifecycleNotifier : public LifecycleNotifier<ExecutionContext> { | 40 class ContextLifecycleNotifier : public LifecycleNotifier<ExecutionContext> { |
41 public: | 41 public: |
42 static PassOwnPtr<ContextLifecycleNotifier> create(ExecutionContext*); | 42 static PassOwnPtr<ContextLifecycleNotifier> create(ExecutionContext*); |
43 | 43 |
44 virtual ~ContextLifecycleNotifier(); | 44 virtual ~ContextLifecycleNotifier(); |
45 | 45 |
46 typedef HashSet<ActiveDOMObject*> ActiveDOMObjectSet; | 46 typedef HashSet<ActiveDOMObject*> ActiveDOMObjectSet; |
47 | 47 |
48 const ActiveDOMObjectSet& activeDOMObjects() const { return m_activeDOMObjec
ts; } | 48 const ActiveDOMObjectSet& activeDOMObjects() const { return m_activeDOMObjec
ts; } |
49 | 49 |
50 virtual void addObserver(Observer*) OVERRIDE; | 50 virtual void addObserver(Observer*) override; |
51 virtual void removeObserver(Observer*) OVERRIDE; | 51 virtual void removeObserver(Observer*) override; |
52 | 52 |
53 void notifyResumingActiveDOMObjects(); | 53 void notifyResumingActiveDOMObjects(); |
54 void notifySuspendingActiveDOMObjects(); | 54 void notifySuspendingActiveDOMObjects(); |
55 void notifyStoppingActiveDOMObjects(); | 55 void notifyStoppingActiveDOMObjects(); |
56 | 56 |
57 bool contains(ActiveDOMObject* object) const { return m_activeDOMObjects.con
tains(object); } | 57 bool contains(ActiveDOMObject* object) const { return m_activeDOMObjects.con
tains(object); } |
58 bool hasPendingActivity() const; | 58 bool hasPendingActivity() const; |
59 | 59 |
60 protected: | 60 protected: |
61 explicit ContextLifecycleNotifier(ExecutionContext*); | 61 explicit ContextLifecycleNotifier(ExecutionContext*); |
62 | 62 |
63 private: | 63 private: |
64 ActiveDOMObjectSet m_activeDOMObjects; | 64 ActiveDOMObjectSet m_activeDOMObjects; |
65 }; | 65 }; |
66 | 66 |
67 inline PassOwnPtr<ContextLifecycleNotifier> ContextLifecycleNotifier::create(Exe
cutionContext* context) | 67 inline PassOwnPtr<ContextLifecycleNotifier> ContextLifecycleNotifier::create(Exe
cutionContext* context) |
68 { | 68 { |
69 return adoptPtr(new ContextLifecycleNotifier(context)); | 69 return adoptPtr(new ContextLifecycleNotifier(context)); |
70 } | 70 } |
71 | 71 |
72 } // namespace blink | 72 } // namespace blink |
73 | 73 |
74 #endif // ContextLifecycleNotifier_h | 74 #endif // ContextLifecycleNotifier_h |
OLD | NEW |