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

Unified Diff: third_party/WebKit/Source/core/html/HTMLMediaElement.cpp

Issue 2484973005: [Blink, RemotePlaybackAPI] Create WebRemotePlaybackClient in HTMLMediaElement ctor to avoid lazy in… (Closed)
Patch Set: Fixed compile for EmptyClients.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/core/html/HTMLMediaElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
index be3968b5e56dd5f10eacdd3546f0864afe956048..f355c16a6d474c4ba5d17264b93cd18204c0c239 100644
--- a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
@@ -96,6 +96,7 @@
#include "wtf/PtrUtil.h"
#include "wtf/text/CString.h"
#include <limits>
+#include <v8.h>
#ifndef BLINK_MEDIA_LOG
#define BLINK_MEDIA_LOG DVLOG(3)
@@ -475,6 +476,15 @@ HTMLMediaElement::HTMLMediaElement(const QualifiedName& tagName,
m_lockedPendingUserGesture = true;
}
+ LocalFrame* frame = document.frame();
+ if (frame) {
+ v8::Isolate* isolate = v8::Isolate::GetCurrent();
+ ScriptState* scriptState = ScriptState::from(isolate->GetCurrentContext());
haraken 2016/11/08 23:50:40 You shouldn't use isolate->GetCurrentContext() unl
whywhat 2016/11/09 00:22:02 Tests actually crash because context seems to be e
+ m_remotePlaybackClient =
+ frame->loader().client()->createWebRemotePlaybackClient(scriptState,
+ *this);
+ }
+
setHasCustomStyleCallbacks();
addElementToDocumentMap(this, &document);
@@ -3939,11 +3949,6 @@ void HTMLMediaElement::updatePositionNotificationRegistration() {
m_autoplayHelper->updatePositionNotificationRegistration();
}
-void HTMLMediaElement::setRemotePlaybackClient(
- WebRemotePlaybackClient* client) {
- m_remotePlaybackClient = client;
-}
-
// TODO(liberato): remove once autoplay gesture override experiment concludes.
void HTMLMediaElement::triggerAutoplayViewportCheckForTesting() {
if (FrameView* view = document().view())
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLMediaElement.h ('k') | third_party/WebKit/Source/core/html/HTMLVideoElementTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698