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

Unified Diff: third_party/WebKit/Source/modules/remoteplayback/RemotePlayback.cpp

Issue 2559673002: Remove ContextLifecycleObserver from RemotePlayback (Closed)
Patch Set: Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/modules/remoteplayback/RemotePlayback.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/remoteplayback/RemotePlayback.cpp
diff --git a/third_party/WebKit/Source/modules/remoteplayback/RemotePlayback.cpp b/third_party/WebKit/Source/modules/remoteplayback/RemotePlayback.cpp
index 95db13e012064578e1867c8c0e97e24d9a007020..064031f0bd16ee9b61ac4b0454d3ad14f621648a 100644
--- a/third_party/WebKit/Source/modules/remoteplayback/RemotePlayback.cpp
+++ b/third_party/WebKit/Source/modules/remoteplayback/RemotePlayback.cpp
@@ -47,7 +47,6 @@ RemotePlayback* RemotePlayback::create(HTMLMediaElement& element) {
RemotePlayback::RemotePlayback(HTMLMediaElement& element)
: ActiveScriptWrappable(this),
- ContextLifecycleObserver(&element.document()),
m_state(element.isPlayingRemotely()
? WebRemotePlaybackState::Connected
: WebRemotePlaybackState::Disconnected),
@@ -202,15 +201,13 @@ String RemotePlayback::state() const {
}
bool RemotePlayback::hasPendingActivity() const {
+ // TODO(haraken): This check should be moved to ActiveScriptWrappable.
+ if (getExecutionContext()->isContextDestroyed())
+ return false;
return hasEventListeners() || !m_availabilityCallbacks.isEmpty() ||
m_promptPromiseResolver;
}
-void RemotePlayback::contextDestroyed() {
- m_availabilityCallbacks.clear();
- m_promptPromiseResolver = nullptr;
-}
-
void RemotePlayback::notifyInitialAvailability(int callbackId) {
// May not find the callback if the website cancels it fast enough.
auto iter = m_availabilityCallbacks.find(callbackId);
@@ -310,7 +307,6 @@ DEFINE_TRACE(RemotePlayback) {
visitor->trace(m_promptPromiseResolver);
visitor->trace(m_mediaElement);
EventTargetWithInlineData::trace(visitor);
- ContextLifecycleObserver::trace(visitor);
}
DEFINE_TRACE_WRAPPERS(RemotePlayback) {
« no previous file with comments | « third_party/WebKit/Source/modules/remoteplayback/RemotePlayback.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698