Index: Source/modules/mediastream/MediaStreamTrack.cpp |
diff --git a/Source/modules/mediastream/MediaStreamTrack.cpp b/Source/modules/mediastream/MediaStreamTrack.cpp |
index 22251a23c6bb5a66a408e18f4aa504a736584b31..fe6ceafc8095ff6050c78c78de8e9f6de86cda92 100644 |
--- a/Source/modules/mediastream/MediaStreamTrack.cpp |
+++ b/Source/modules/mediastream/MediaStreamTrack.cpp |
@@ -27,8 +27,11 @@ |
#include "modules/mediastream/MediaStreamTrack.h" |
#include "core/dom/Event.h" |
+#include "core/dom/ScriptExecutionContext.h" |
#include "core/platform/mediastream/MediaStreamCenter.h" |
#include "core/platform/mediastream/MediaStreamComponent.h" |
+#include "public/platform/WebSourceInfo.h" |
+#include "weborigin/SecurityOrigin.h" |
namespace WebCore { |
@@ -115,6 +118,22 @@ String MediaStreamTrack::readyState() const |
return String(); |
} |
+SourceInfoVector MediaStreamTrack::getSourceInfos(ScriptExecutionContext* context, ExceptionCode& ec) |
+{ |
+ WebKit::WebVector<WebKit::WebSourceInfo> webSourceInfos; |
+ bool ok = MediaStreamCenter::instance().getSourceInfos(context->securityOrigin()->toString(), webSourceInfos); |
+ if (!ok) { |
+ ec = NOT_SUPPORTED_ERR; |
+ return SourceInfoVector(); |
+ } |
+ |
+ SourceInfoVector sourceInfos; |
+ for (size_t i = 0; i < webSourceInfos.size(); ++i) |
+ sourceInfos.append(SourceInfo::create(webSourceInfos[i])); |
+ |
+ return sourceInfos; |
+} |
+ |
bool MediaStreamTrack::ended() const |
{ |
return m_stopped || (m_component->source()->readyState() == MediaStreamSource::ReadyStateEnded); |