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

Side by Side Diff: Source/modules/presentation/PresentationAvailability.cpp

Issue 1322493006: Presentation API: ignore page visibility changes if ExecutionContext is destoyed. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: forgot file Created 5 years, 3 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
OLDNEW
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 "config.h" 5 #include "config.h"
6 #include "modules/presentation/PresentationAvailability.h" 6 #include "modules/presentation/PresentationAvailability.h"
7 7
8 #include "bindings/core/v8/ScriptPromiseResolver.h" 8 #include "bindings/core/v8/ScriptPromiseResolver.h"
9 #include "core/dom/Document.h" 9 #include "core/dom/Document.h"
10 #include "core/events/Event.h" 10 #include "core/events/Event.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 setState(State::Suspended); 96 setState(State::Suspended);
97 } 97 }
98 98
99 void PresentationAvailability::stop() 99 void PresentationAvailability::stop()
100 { 100 {
101 setState(State::Inactive); 101 setState(State::Inactive);
102 } 102 }
103 103
104 void PresentationAvailability::pageVisibilityChanged() 104 void PresentationAvailability::pageVisibilityChanged()
105 { 105 {
106 if (m_state == State::Inactive)
107 return;
106 updateListening(); 108 updateListening();
107 } 109 }
108 110
109 void PresentationAvailability::setState(State state) 111 void PresentationAvailability::setState(State state)
110 { 112 {
111 m_state = state; 113 m_state = state;
112 updateListening(); 114 updateListening();
113 } 115 }
114 116
115 void PresentationAvailability::updateListening() 117 void PresentationAvailability::updateListening()
(...skipping 18 matching lines...) Expand all
134 return m_value; 136 return m_value;
135 } 137 }
136 138
137 DEFINE_TRACE(PresentationAvailability) 139 DEFINE_TRACE(PresentationAvailability)
138 { 140 {
139 RefCountedGarbageCollectedEventTargetWithInlineData<PresentationAvailability >::trace(visitor); 141 RefCountedGarbageCollectedEventTargetWithInlineData<PresentationAvailability >::trace(visitor);
140 PageLifecycleObserver::trace(visitor); 142 PageLifecycleObserver::trace(visitor);
141 ActiveDOMObject::trace(visitor); 143 ActiveDOMObject::trace(visitor);
142 } 144 }
143 145
144 } // namespace 146 } // blink namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698