Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "public/platform/WebMediaPlayerSource.h" | |
| 6 | |
| 7 namespace blink { | |
| 8 | |
| 9 WebMediaPlayerSource::WebMediaPlayerSource() | |
| 10 { | |
| 11 } | |
| 12 | |
| 13 WebMediaPlayerSource::WebMediaPlayerSource(const WebURL& url) | |
| 14 : m_url(url) | |
| 15 { | |
| 16 } | |
| 17 | |
| 18 WebMediaPlayerSource::WebMediaPlayerSource(const WebMediaStream& mediaStream) | |
| 19 : m_mediaStream(mediaStream) | |
| 20 { | |
| 21 } | |
| 22 | |
| 23 WebMediaPlayerSource::~WebMediaPlayerSource() | |
| 24 { | |
| 25 m_mediaStream.reset(); | |
| 26 } | |
| 27 | |
| 28 bool WebMediaPlayerSource::isEmpty() const | |
|
philipj_slow
2016/04/07 15:38:11
Hmm, this isn't actually used anywhere?
Guido Urdaneta
2016/04/08 10:58:47
Removed. Will add it in the future if we need it.
| |
| 29 { | |
| 30 return !isURL() && !isMediaProviderObject(); | |
| 31 } | |
| 32 | |
| 33 bool WebMediaPlayerSource::isURL() const | |
| 34 { | |
| 35 return !m_url.isEmpty(); | |
| 36 } | |
| 37 | |
| 38 WebURL WebMediaPlayerSource::getAsURL() const | |
| 39 { | |
| 40 return m_url; | |
| 41 } | |
| 42 | |
| 43 bool WebMediaPlayerSource::isMediaProviderObject() const | |
|
philipj_slow
2016/04/07 15:38:11
Maybe for the time being, just isMediaStream() wil
Guido Urdaneta
2016/04/08 10:58:47
I think isMediaProviderObject() makes the code eas
philipj_slow
2016/04/08 12:49:31
Acknowledged.
| |
| 44 { | |
| 45 return isMediaStream(); | |
| 46 } | |
| 47 | |
| 48 bool WebMediaPlayerSource::isMediaStream() const | |
| 49 { | |
| 50 return !m_mediaStream.isNull(); | |
| 51 } | |
| 52 | |
| 53 WebMediaStream WebMediaPlayerSource::getAsMediaStream() const | |
| 54 { | |
| 55 return m_mediaStream; | |
| 56 } | |
| 57 | |
| 58 } // namespace blink | |
| OLD | NEW |