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

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

Issue 1827853002: [Android, RemotePlayback] Implement HTMLMediaElement.remote.connect(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remote-playback-availability
Patch Set: Fixed timing for rejecting the promises Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/remoteplayback/RemotePlayback.h
diff --git a/third_party/WebKit/Source/modules/remoteplayback/RemotePlayback.h b/third_party/WebKit/Source/modules/remoteplayback/RemotePlayback.h
index fa24f558fc5ac27779afcac8b4549c1b52f4e452..f0bd5a7b53d150ce21c4b98f4330710c97b54287 100644
--- a/third_party/WebKit/Source/modules/remoteplayback/RemotePlayback.h
+++ b/third_party/WebKit/Source/modules/remoteplayback/RemotePlayback.h
@@ -20,6 +20,7 @@ class ExecutionContext;
class HTMLMediaElement;
class LocalFrame;
class RemotePlaybackAvailability;
+class ScriptPromiseResolver;
class RemotePlayback final
: public RefCountedGarbageCollectedEventTargetWithInlineData<RemotePlayback>
@@ -31,13 +32,14 @@ class RemotePlayback final
public:
static RemotePlayback* create(HTMLMediaElement&);
- ~RemotePlayback() override = default;
+ ~RemotePlayback() override;
// EventTarget implementation.
const WTF::AtomicString& interfaceName() const override;
ExecutionContext* getExecutionContext() const override;
ScriptPromise getAvailability(ScriptState*);
+ ScriptPromise connect(ScriptState*);
String state() const;
@@ -46,7 +48,7 @@ public:
DECLARE_VIRTUAL_TRACE();
private:
- RemotePlayback(LocalFrame*, WebRemotePlaybackState, bool availability);
+ explicit RemotePlayback(HTMLMediaElement&);
void stateChanged(WebRemotePlaybackState) override;
void availabilityChanged(bool available) override;
@@ -54,6 +56,8 @@ private:
WebRemotePlaybackState m_state;
bool m_availability;
HeapVector<Member<RemotePlaybackAvailability>> m_availabilityObjects;
+ WeakPtrWillBeMember<HTMLMediaElement> m_mediaElement;
+ HeapVector<Member<ScriptPromiseResolver>> m_connectPromiseResolvers;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698