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

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

Issue 2415723002: [Blink, RemotePlayback] watchAvailability() implementation. (Closed)
Patch Set: Added layout test for callback gc Created 4 years, 2 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 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 26 matching lines...) Expand all
37 Supplement<HTMLMediaElement>::from(element, supplementName())); 37 Supplement<HTMLMediaElement>::from(element, supplementName()));
38 if (!supplement) { 38 if (!supplement) {
39 supplement = new HTMLMediaElementRemotePlayback(); 39 supplement = new HTMLMediaElementRemotePlayback();
40 provideTo(element, supplementName(), supplement); 40 provideTo(element, supplementName(), supplement);
41 } 41 }
42 return *supplement; 42 return *supplement;
43 } 43 }
44 44
45 // static 45 // static
46 RemotePlayback* HTMLMediaElementRemotePlayback::remote( 46 RemotePlayback* HTMLMediaElementRemotePlayback::remote(
47 ScriptState* scriptState,
47 HTMLMediaElement& element) { 48 HTMLMediaElement& element) {
48 HTMLMediaElementRemotePlayback& self = 49 HTMLMediaElementRemotePlayback& self =
49 HTMLMediaElementRemotePlayback::from(element); 50 HTMLMediaElementRemotePlayback::from(element);
50 Document& document = element.document(); 51 Document& document = element.document();
51 if (!document.frame()) 52 if (!document.frame())
52 return nullptr; 53 return nullptr;
53 54
54 if (!self.m_remote) 55 if (!self.m_remote)
55 self.m_remote = RemotePlayback::create(element); 56 self.m_remote = RemotePlayback::create(scriptState, element);
56 57
57 return self.m_remote; 58 return self.m_remote;
58 } 59 }
59 60
60 // static 61 // static
61 const char* HTMLMediaElementRemotePlayback::supplementName() { 62 const char* HTMLMediaElementRemotePlayback::supplementName() {
62 return "HTMLMediaElementRemotePlayback"; 63 return "HTMLMediaElementRemotePlayback";
63 } 64 }
64 65
65 DEFINE_TRACE(HTMLMediaElementRemotePlayback) { 66 DEFINE_TRACE(HTMLMediaElementRemotePlayback) {
66 visitor->trace(m_remote); 67 visitor->trace(m_remote);
67 Supplement<HTMLMediaElement>::trace(visitor); 68 Supplement<HTMLMediaElement>::trace(visitor);
68 } 69 }
69 70
70 } // namespace blink 71 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698