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

Side by Side Diff: third_party/WebKit/Source/modules/remoteplayback/HTMLMediaElementRemotePlayback.cpp

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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "modules/remoteplayback/HTMLMediaElementRemotePlayback.h" 5 #include "modules/remoteplayback/HTMLMediaElementRemotePlayback.h"
6 6
7 #include "core/dom/DOMException.h" 7 #include "core/dom/DOMException.h"
8 #include "core/dom/Document.h" 8 #include "core/dom/Document.h"
9 #include "core/dom/QualifiedName.h" 9 #include "core/dom/QualifiedName.h"
10 #include "core/html/HTMLMediaElement.h" 10 #include "core/html/HTMLMediaElement.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 Supplement<HTMLMediaElement>::from(element, supplementName())); 42 Supplement<HTMLMediaElement>::from(element, supplementName()));
43 if (!supplement) { 43 if (!supplement) {
44 supplement = new HTMLMediaElementRemotePlayback(); 44 supplement = new HTMLMediaElementRemotePlayback();
45 provideTo(element, supplementName(), supplement); 45 provideTo(element, supplementName(), supplement);
46 } 46 }
47 return *supplement; 47 return *supplement;
48 } 48 }
49 49
50 // static 50 // static
51 RemotePlayback* HTMLMediaElementRemotePlayback::remote( 51 RemotePlayback* HTMLMediaElementRemotePlayback::remote(
52 ScriptState* scriptState,
53 HTMLMediaElement& element) { 52 HTMLMediaElement& element) {
54 HTMLMediaElementRemotePlayback& self = 53 HTMLMediaElementRemotePlayback& self =
55 HTMLMediaElementRemotePlayback::from(element); 54 HTMLMediaElementRemotePlayback::from(element);
56 Document& document = element.document(); 55 Document& document = element.document();
57 if (!document.frame()) 56 if (!document.frame())
58 return nullptr; 57 return nullptr;
59 58
60 if (!self.m_remote) 59 if (!self.m_remote)
61 self.m_remote = RemotePlayback::create(scriptState, element); 60 self.m_remote = RemotePlayback::create(element);
62 61
63 return self.m_remote; 62 return self.m_remote;
64 } 63 }
65 64
66 // static 65 // static
67 const char* HTMLMediaElementRemotePlayback::supplementName() { 66 const char* HTMLMediaElementRemotePlayback::supplementName() {
68 return "HTMLMediaElementRemotePlayback"; 67 return "HTMLMediaElementRemotePlayback";
69 } 68 }
70 69
71 DEFINE_TRACE(HTMLMediaElementRemotePlayback) { 70 DEFINE_TRACE(HTMLMediaElementRemotePlayback) {
72 visitor->trace(m_remote); 71 visitor->trace(m_remote);
73 Supplement<HTMLMediaElement>::trace(visitor); 72 Supplement<HTMLMediaElement>::trace(visitor);
74 } 73 }
75 74
76 } // namespace blink 75 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698