OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "modules/presentation/PresentationAvailability.h" | 5 #include "modules/presentation/PresentationAvailability.h" |
6 | 6 |
7 #include "bindings/core/v8/ScriptPromiseResolver.h" | 7 #include "bindings/core/v8/ScriptPromiseResolver.h" |
8 #include "core/dom/Document.h" | 8 #include "core/dom/Document.h" |
9 #include "core/events/Event.h" | 9 #include "core/events/Event.h" |
10 #include "core/frame/UseCounter.h" | 10 #include "core/frame/UseCounter.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 } | 91 } |
92 | 92 |
93 void PresentationAvailability::suspend() { | 93 void PresentationAvailability::suspend() { |
94 setState(State::Suspended); | 94 setState(State::Suspended); |
95 } | 95 } |
96 | 96 |
97 void PresentationAvailability::contextDestroyed(ExecutionContext*) { | 97 void PresentationAvailability::contextDestroyed(ExecutionContext*) { |
98 setState(State::Inactive); | 98 setState(State::Inactive); |
99 } | 99 } |
100 | 100 |
101 void PresentationAvailability::contextDestroyed(Page*) {} | |
102 | |
103 void PresentationAvailability::pageVisibilityChanged() { | 101 void PresentationAvailability::pageVisibilityChanged() { |
104 if (m_state == State::Inactive) | 102 if (m_state == State::Inactive) |
105 return; | 103 return; |
106 updateListening(); | 104 updateListening(); |
107 } | 105 } |
108 | 106 |
109 void PresentationAvailability::setState(State state) { | 107 void PresentationAvailability::setState(State state) { |
110 m_state = state; | 108 m_state = state; |
111 updateListening(); | 109 updateListening(); |
112 } | 110 } |
(...skipping 19 matching lines...) Expand all Loading... |
132 return m_value; | 130 return m_value; |
133 } | 131 } |
134 | 132 |
135 DEFINE_TRACE(PresentationAvailability) { | 133 DEFINE_TRACE(PresentationAvailability) { |
136 EventTargetWithInlineData::trace(visitor); | 134 EventTargetWithInlineData::trace(visitor); |
137 PageVisibilityObserver::trace(visitor); | 135 PageVisibilityObserver::trace(visitor); |
138 SuspendableObject::trace(visitor); | 136 SuspendableObject::trace(visitor); |
139 } | 137 } |
140 | 138 |
141 } // namespace blink | 139 } // namespace blink |
OLD | NEW |