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

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

Issue 2484973005: [Blink, RemotePlaybackAPI] Create WebRemotePlaybackClient in HTMLMediaElement ctor to avoid lazy in… (Closed)
Patch Set: Removed <v8.h> from HTMLMediaElement.cpp Created 4 years, 1 month 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 d12c4da7cc8a72785eb432d9974f7fbc42e08f83..f8b4371dc86d40b9035f2bc4b601937b206d9f05 100644
--- a/third_party/WebKit/Source/modules/remoteplayback/RemotePlayback.h
+++ b/third_party/WebKit/Source/modules/remoteplayback/RemotePlayback.h
@@ -7,7 +7,6 @@
#include "bindings/core/v8/ActiveScriptWrappable.h"
#include "bindings/core/v8/ScriptPromise.h"
-#include "bindings/core/v8/ScriptState.h"
#include "bindings/core/v8/TraceWrapperMember.h"
#include "core/events/EventTarget.h"
#include "modules/ModulesExport.h"
@@ -24,16 +23,17 @@ class ExecutionContext;
class HTMLMediaElement;
class RemotePlaybackAvailabilityCallback;
class ScriptPromiseResolver;
+class ScriptState;
class MODULES_EXPORT RemotePlayback final
: public EventTargetWithInlineData,
public ActiveScriptWrappable,
- WTF_NON_EXPORTED_BASE(private WebRemotePlaybackClient) {
+ WTF_NON_EXPORTED_BASE(public WebRemotePlaybackClient) {
DEFINE_WRAPPERTYPEINFO();
USING_GARBAGE_COLLECTED_MIXIN(RemotePlayback);
public:
- static RemotePlayback* create(ScriptState*, HTMLMediaElement&);
+ static RemotePlayback* create(HTMLMediaElement&);
// Notifies this object that disableRemotePlayback attribute was set on the
// corresponding media element.
@@ -46,18 +46,19 @@ class MODULES_EXPORT RemotePlayback final
// Starts notifying the page about the changes to the remote playback devices
// availability via the provided callback. May start the monitoring of remote
// playback devices if it isn't running yet.
- ScriptPromise watchAvailability(RemotePlaybackAvailabilityCallback*);
+ ScriptPromise watchAvailability(ScriptState*,
+ RemotePlaybackAvailabilityCallback*);
// Cancels updating the page via the callback specified by its id.
- ScriptPromise cancelWatchAvailability(int id);
+ ScriptPromise cancelWatchAvailability(ScriptState*, int id);
// Cancels all the callbacks watching remote playback availability changes
// registered with this element.
- ScriptPromise cancelWatchAvailability();
+ ScriptPromise cancelWatchAvailability(ScriptState*);
// Shows the UI allowing user to change the remote playback state of the media
// element (by picking a remote playback device from the list, for example).
- ScriptPromise prompt();
+ ScriptPromise prompt(ScriptState*);
String state() const;
@@ -75,7 +76,7 @@ class MODULES_EXPORT RemotePlayback final
friend class V8RemotePlayback;
friend class RemotePlaybackTest;
- explicit RemotePlayback(ScriptState*, HTMLMediaElement&);
+ explicit RemotePlayback(HTMLMediaElement&);
// Calls the specified availability callback with the current availability.
// Need a void() method to post it as a task.
@@ -92,7 +93,6 @@ class MODULES_EXPORT RemotePlayback final
void setV8ReferencesForCallbacks(v8::Isolate*,
const v8::Persistent<v8::Object>& wrapper);
- RefPtr<ScriptState> m_scriptState;
WebRemotePlaybackState m_state;
bool m_availability;
HeapHashMap<int, TraceWrapperMember<RemotePlaybackAvailabilityCallback>>

Powered by Google App Engine
This is Rietveld 408576698