Chromium Code Reviews| Index: third_party/WebKit/Source/platform/exported/WebMediaPlayerSource.cpp |
| diff --git a/third_party/WebKit/Source/platform/exported/WebMediaPlayerSource.cpp b/third_party/WebKit/Source/platform/exported/WebMediaPlayerSource.cpp |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..cf5c0ab898e7e648fa4aa6a4a273441b4bee3a90 |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/platform/exported/WebMediaPlayerSource.cpp |
| @@ -0,0 +1,58 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "public/platform/WebMediaPlayerSource.h" |
| + |
| +namespace blink { |
| + |
| +WebMediaPlayerSource::WebMediaPlayerSource() |
| +{ |
| +} |
| + |
| +WebMediaPlayerSource::WebMediaPlayerSource(const WebURL& url) |
| + : m_url(url) |
| +{ |
| +} |
| + |
| +WebMediaPlayerSource::WebMediaPlayerSource(const WebMediaStream& mediaStream) |
| + : m_mediaStream(mediaStream) |
| +{ |
| +} |
| + |
| +WebMediaPlayerSource::~WebMediaPlayerSource() |
| +{ |
| + m_mediaStream.reset(); |
| +} |
| + |
| +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.
|
| +{ |
| + return !isURL() && !isMediaProviderObject(); |
| +} |
| + |
| +bool WebMediaPlayerSource::isURL() const |
| +{ |
| + return !m_url.isEmpty(); |
| +} |
| + |
| +WebURL WebMediaPlayerSource::getAsURL() const |
| +{ |
| + return m_url; |
| +} |
| + |
| +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.
|
| +{ |
| + return isMediaStream(); |
| +} |
| + |
| +bool WebMediaPlayerSource::isMediaStream() const |
| +{ |
| + return !m_mediaStream.isNull(); |
| +} |
| + |
| +WebMediaStream WebMediaPlayerSource::getAsMediaStream() const |
| +{ |
| + return m_mediaStream; |
| +} |
| + |
| +} // namespace blink |