Index: third_party/WebKit/Source/platform/exported/WebMediaStreamSource.cpp |
diff --git a/third_party/WebKit/Source/platform/exported/WebMediaStreamSource.cpp b/third_party/WebKit/Source/platform/exported/WebMediaStreamSource.cpp |
index 5e19c39fd20ed9fb8b2bfabdcd8682025d3aa56e..0d00ae1d2489c27ba2b59ac6510de8a5fbf34054 100644 |
--- a/third_party/WebKit/Source/platform/exported/WebMediaStreamSource.cpp |
+++ b/third_party/WebKit/Source/platform/exported/WebMediaStreamSource.cpp |
@@ -57,12 +57,12 @@ class ExtraDataContainer : public MediaStreamSource::ExtraData { |
} // namespace |
WebMediaStreamSource WebMediaStreamSource::ExtraData::owner() { |
- ASSERT(m_owner); |
+ DCHECK(m_owner); |
return WebMediaStreamSource(m_owner); |
} |
void WebMediaStreamSource::ExtraData::setOwner(MediaStreamSource* owner) { |
- ASSERT(!m_owner); |
+ DCHECK(!m_owner); |
m_owner = owner; |
} |
@@ -91,36 +91,49 @@ void WebMediaStreamSource::initialize(const WebString& id, |
Type type, |
const WebString& name) { |
m_private = MediaStreamSource::create( |
- id, static_cast<MediaStreamSource::StreamType>(type), name); |
+ id, static_cast<MediaStreamSource::StreamType>(type), name, false); |
+} |
+ |
+void WebMediaStreamSource::initialize(const WebString& id, |
+ Type type, |
+ const WebString& name, |
+ bool remote) { |
+ m_private = MediaStreamSource::create( |
+ id, static_cast<MediaStreamSource::StreamType>(type), name, remote); |
} |
WebString WebMediaStreamSource::id() const { |
- ASSERT(!m_private.isNull()); |
+ DCHECK(!m_private.isNull()); |
return m_private.get()->id(); |
} |
WebMediaStreamSource::Type WebMediaStreamSource::getType() const { |
- ASSERT(!m_private.isNull()); |
+ DCHECK(!m_private.isNull()); |
return static_cast<Type>(m_private.get()->type()); |
} |
WebString WebMediaStreamSource::name() const { |
- ASSERT(!m_private.isNull()); |
+ DCHECK(!m_private.isNull()); |
return m_private.get()->name(); |
} |
+bool WebMediaStreamSource::remote() const { |
+ DCHECK(!m_private.isNull()); |
+ return m_private.get()->remote(); |
+} |
+ |
void WebMediaStreamSource::setReadyState(ReadyState state) { |
- ASSERT(!m_private.isNull()); |
+ DCHECK(!m_private.isNull()); |
m_private->setReadyState(static_cast<MediaStreamSource::ReadyState>(state)); |
} |
WebMediaStreamSource::ReadyState WebMediaStreamSource::getReadyState() const { |
- ASSERT(!m_private.isNull()); |
+ DCHECK(!m_private.isNull()); |
return static_cast<ReadyState>(m_private->getReadyState()); |
} |
WebMediaStreamSource::ExtraData* WebMediaStreamSource::getExtraData() const { |
- ASSERT(!m_private.isNull()); |
+ DCHECK(!m_private.isNull()); |
MediaStreamSource::ExtraData* data = m_private->getExtraData(); |
if (!data) |
return 0; |
@@ -128,7 +141,7 @@ WebMediaStreamSource::ExtraData* WebMediaStreamSource::getExtraData() const { |
} |
void WebMediaStreamSource::setExtraData(ExtraData* extraData) { |
- ASSERT(!m_private.isNull()); |
+ DCHECK(!m_private.isNull()); |
if (extraData) |
extraData->setOwner(m_private.get()); |
@@ -138,12 +151,12 @@ void WebMediaStreamSource::setExtraData(ExtraData* extraData) { |
} |
WebMediaConstraints WebMediaStreamSource::constraints() { |
- ASSERT(!m_private.isNull()); |
+ DCHECK(!m_private.isNull()); |
return m_private->constraints(); |
} |
bool WebMediaStreamSource::requiresAudioConsumer() const { |
- ASSERT(!m_private.isNull()); |
+ DCHECK(!m_private.isNull()); |
return m_private->requiresAudioConsumer(); |
} |
@@ -187,16 +200,16 @@ void ConsumerWrapper::consumeAudio(AudioBus* bus, size_t numberOfFrames) { |
void WebMediaStreamSource::addAudioConsumer( |
WebAudioDestinationConsumer* consumer) { |
- ASSERT(isMainThread()); |
- ASSERT(!m_private.isNull() && consumer); |
+ DCHECK(isMainThread()); |
+ DCHECK(!m_private.isNull() && consumer); |
m_private->addAudioConsumer(ConsumerWrapper::create(consumer)); |
} |
bool WebMediaStreamSource::removeAudioConsumer( |
WebAudioDestinationConsumer* consumer) { |
- ASSERT(isMainThread()); |
- ASSERT(!m_private.isNull() && consumer); |
+ DCHECK(isMainThread()); |
+ DCHECK(!m_private.isNull() && consumer); |
const HashSet<AudioDestinationConsumer*>& consumers = |
m_private->audioConsumers(); |