Diff
Modified: trunk/Source/WebCore/CMakeLists.txt (88797 => 88798)
--- trunk/Source/WebCore/CMakeLists.txt 2011-06-14 13:54:29 UTC (rev 88797)
+++ trunk/Source/WebCore/CMakeLists.txt 2011-06-14 13:58:11 UTC (rev 88798)
@@ -1976,6 +1976,7 @@
dom/GeneratedStream.cpp
dom/Stream.cpp
dom/StreamEvent.cpp
+ dom/StreamList.cpp
page/MediaStreamController.cpp
page/MediaStreamFrameController.cpp
)
@@ -1984,6 +1985,7 @@
dom/GeneratedStream.idl
dom/Stream.idl
dom/StreamEvent.idl
+ dom/StreamList.idl
page/NavigatorUserMediaError.idl
)
ENDIF ()
Modified: trunk/Source/WebCore/ChangeLog (88797 => 88798)
--- trunk/Source/WebCore/ChangeLog 2011-06-14 13:54:29 UTC (rev 88797)
+++ trunk/Source/WebCore/ChangeLog 2011-06-14 13:58:11 UTC (rev 88798)
@@ -1,3 +1,29 @@
+2011-06-14 Tommy Widenflycht <[email protected]>
+
+ Reviewed by Tony Gentilcore.
+
+ Media Stream PeerConnection API: adding the StreamList and supporting classes.
+ https://bugs.webkit.org/show_bug.cgi?id=61539
+
+ * dom/StreamContainer.h: Added.
+ (WebCore::StreamContainer::create):
+ (WebCore::StreamContainer::~StreamContainer):
+ (WebCore::StreamContainer::length):
+ (WebCore::StreamContainer::item):
+ (WebCore::StreamContainer::add):
+ (WebCore::StreamContainer::remove):
+ (WebCore::StreamContainer::contains):
+ (WebCore::StreamContainer::get):
+ (WebCore::StreamContainer::StreamContainer):
+ * dom/StreamList.cpp: Added.
+ (WebCore::StreamList::create):
+ (WebCore::StreamList::StreamList):
+ (WebCore::StreamList::~StreamList):
+ (WebCore::StreamList::length):
+ (WebCore::StreamList::item):
+ * dom/StreamList.h: Added.
+ * dom/StreamList.idl: Added.
+
2011-06-14 Caio Marcelo de Oliveira Filho <[email protected]>
Reviewed by Andreas Kling.
Modified: trunk/Source/WebCore/CodeGenerators.pri (88797 => 88798)
--- trunk/Source/WebCore/CodeGenerators.pri 2011-06-14 13:54:29 UTC (rev 88797)
+++ trunk/Source/WebCore/CodeGenerators.pri 2011-06-14 13:58:11 UTC (rev 88798)
@@ -157,6 +157,7 @@
dom/Range.idl \
dom/Stream.idl \
dom/StreamEvent.idl \
+ dom/StreamList.idl \
dom/StringCallback.idl \
dom/Text.idl \
dom/TextEvent.idl \
Modified: trunk/Source/WebCore/DerivedSources.cpp (88797 => 88798)
--- trunk/Source/WebCore/DerivedSources.cpp 2011-06-14 13:54:29 UTC (rev 88797)
+++ trunk/Source/WebCore/DerivedSources.cpp 2011-06-14 13:58:11 UTC (rev 88798)
@@ -293,6 +293,7 @@
#include "JSStorageInfoUsageCallback.cpp"
#include "JSStream.cpp"
#include "JSStreamEvent.cpp"
+#include "JSStreamList.cpp"
#include "JSStringCallback.cpp"
#include "JSStyleMedia.cpp"
#include "JSStyleSheet.cpp"
Modified: trunk/Source/WebCore/DerivedSources.make (88797 => 88798)
--- trunk/Source/WebCore/DerivedSources.make 2011-06-14 13:54:29 UTC (rev 88797)
+++ trunk/Source/WebCore/DerivedSources.make 2011-06-14 13:58:11 UTC (rev 88798)
@@ -367,6 +367,7 @@
StorageInfoUsageCallback \
Stream \
StreamEvent \
+ StreamList \
StringCallback \
SVGAElement \
SVGAltGlyphElement \
Modified: trunk/Source/WebCore/GNUmakefile.list.am (88797 => 88798)
--- trunk/Source/WebCore/GNUmakefile.list.am 2011-06-14 13:54:29 UTC (rev 88797)
+++ trunk/Source/WebCore/GNUmakefile.list.am 2011-06-14 13:58:11 UTC (rev 88798)
@@ -463,6 +463,8 @@
DerivedSources/WebCore/JSStream.h \
DerivedSources/WebCore/JSStreamEvent.cpp \
DerivedSources/WebCore/JSStreamEvent.h \
+ DerivedSources/WebCore/JSStreamList.cpp \
+ DerivedSources/WebCore/JSStreamList.h \
DerivedSources/WebCore/JSStyleMedia.cpp \
DerivedSources/WebCore/JSStyleMedia.h \
DerivedSources/WebCore/JSStyleSheet.cpp \
@@ -1274,6 +1276,11 @@
Source/WebCore/dom/StaticNodeList.h \
Source/WebCore/dom/Stream.cpp \
Source/WebCore/dom/Stream.h \
+ Source/WebCore/dom/StreamContainer.h \
+ Source/WebCore/dom/StreamEvent.cpp \
+ Source/WebCore/dom/StreamEvent.h \
+ Source/WebCore/dom/StreamList.cpp \
+ Source/WebCore/dom/StreamList.h \
Source/WebCore/dom/StyledElement.cpp \
Source/WebCore/dom/StyledElement.h \
Source/WebCore/dom/StyleElement.cpp \
Modified: trunk/Source/WebCore/WebCore.gypi (88797 => 88798)
--- trunk/Source/WebCore/WebCore.gypi 2011-06-14 13:54:29 UTC (rev 88797)
+++ trunk/Source/WebCore/WebCore.gypi 2011-06-14 13:58:11 UTC (rev 88798)
@@ -1177,6 +1177,7 @@
'dom/RequestAnimationFrameCallback.idl',
'dom/Stream.idl',
'dom/StreamEvent.idl',
+ 'dom/StreamList.idl',
'dom/StringCallback.idl',
'dom/Text.idl',
'dom/TextEvent.idl',
@@ -2583,8 +2584,11 @@
'dom/StaticNodeList.h',
'dom/Stream.cpp',
'dom/Stream.h',
+ 'dom/StreamContainer.h',
'dom/StreamEvent.cpp',
'dom/StreamEvent.h',
+ 'dom/StreamList.cpp',
+ 'dom/StreamList.h',
'dom/StringCallback.cpp',
'dom/StringCallback.h',
'dom/StyleElement.cpp',
Modified: trunk/Source/WebCore/WebCore.pro (88797 => 88798)
--- trunk/Source/WebCore/WebCore.pro 2011-06-14 13:54:29 UTC (rev 88797)
+++ trunk/Source/WebCore/WebCore.pro 2011-06-14 13:58:11 UTC (rev 88798)
@@ -3157,7 +3157,9 @@
HEADERS += \
dom/GeneratedStream.h \
dom/Stream.h \
+ dom/StreamContainer.h \
dom/StreamEvent.h \
+ dom/StreamList.h \
page/CallbackTask.h \
page/MediaStreamClient.h \
page/MediaStreamController.h \
@@ -3170,6 +3172,7 @@
dom/GeneratedStream.cpp \
dom/Stream.cpp \
dom/StreamEvent.cpp \
+ dom/StreamList.cpp \
page/MediaStreamController.cpp \
page/MediaStreamFrameController.cpp
Modified: trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj (88797 => 88798)
--- trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj 2011-06-14 13:54:29 UTC (rev 88797)
+++ trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj 2011-06-14 13:58:11 UTC (rev 88798)
@@ -13710,6 +13710,62 @@
>
</File>
<File
+ RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSStreamList.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_Cairo_CFLite|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_Cairo_CFLite|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_All|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Production|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSStreamList.h"
+ >
+ </File>
+ <File
RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSStringCallback.cpp"
>
<FileConfiguration
@@ -47778,6 +47834,10 @@
>
</File>
<File
+ RelativePath="..\dom\StreamContainer.h"
+ >
+ </File>
+ <File
RelativePath="..\dom\StreamEvent.cpp"
>
<FileConfiguration
@@ -47834,6 +47894,62 @@
>
</File>
<File
+ RelativePath="..\dom\StreamList.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_Cairo_CFLite|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_Cairo_CFLite|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_All|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Production|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\dom\StreamList.h"
+ >
+ </File>
+ <File
RelativePath="..\dom\StringCallback.cpp"
>
<FileConfiguration
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (88797 => 88798)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2011-06-14 13:54:29 UTC (rev 88797)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2011-06-14 13:58:11 UTC (rev 88798)
@@ -4162,6 +4162,11 @@
B12D236A1356033F002A28D4 /* JSExclusiveTrackList.h in Headers */ = {isa = PBXBuildFile; fileRef = B12D23681356033F002A28D4 /* JSExclusiveTrackList.h */; };
B12D236D1356034D002A28D4 /* JSMultipleTrackList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B12D236B1356034D002A28D4 /* JSMultipleTrackList.cpp */; };
B12D236E1356034D002A28D4 /* JSMultipleTrackList.h in Headers */ = {isa = PBXBuildFile; fileRef = B12D236C1356034D002A28D4 /* JSMultipleTrackList.h */; };
+ B14353D4138EA8ED00D53276 /* StreamContainer.h in Headers */ = {isa = PBXBuildFile; fileRef = B14353D0138EA8ED00D53276 /* StreamContainer.h */; };
+ B14353D5138EA8ED00D53276 /* StreamList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B14353D1138EA8ED00D53276 /* StreamList.cpp */; };
+ B14353D6138EA8ED00D53276 /* StreamList.h in Headers */ = {isa = PBXBuildFile; fileRef = B14353D2138EA8ED00D53276 /* StreamList.h */; };
+ B14353F8138EA95B00D53276 /* JSStreamList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B14353F6138EA95B00D53276 /* JSStreamList.cpp */; };
+ B14353F9138EA95B00D53276 /* JSStreamList.h in Headers */ = {isa = PBXBuildFile; fileRef = B14353F7138EA95B00D53276 /* JSStreamList.h */; };
B1827493134CA4C100B98C2D /* CallbackFunction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B1827492134CA4C100B98C2D /* CallbackFunction.cpp */; };
B1D5ECB5134B58DA0087C78F /* CallbackFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = B1D5ECB4134B58DA0087C78F /* CallbackFunction.h */; };
B1E5457A1346291F0092A545 /* GeneratedStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B1E545711346291F0092A545 /* GeneratedStream.cpp */; };
@@ -10540,6 +10545,12 @@
B12D23681356033F002A28D4 /* JSExclusiveTrackList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSExclusiveTrackList.h; sourceTree = "<group>"; };
B12D236B1356034D002A28D4 /* JSMultipleTrackList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMultipleTrackList.cpp; sourceTree = "<group>"; };
B12D236C1356034D002A28D4 /* JSMultipleTrackList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMultipleTrackList.h; sourceTree = "<group>"; };
+ B14353D0138EA8ED00D53276 /* StreamContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StreamContainer.h; sourceTree = "<group>"; };
+ B14353D1138EA8ED00D53276 /* StreamList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StreamList.cpp; sourceTree = "<group>"; };
+ B14353D2138EA8ED00D53276 /* StreamList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StreamList.h; sourceTree = "<group>"; };
+ B14353D3138EA8ED00D53276 /* StreamList.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = StreamList.idl; sourceTree = "<group>"; };
+ B14353F6138EA95B00D53276 /* JSStreamList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSStreamList.cpp; sourceTree = "<group>"; };
+ B14353F7138EA95B00D53276 /* JSStreamList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSStreamList.h; sourceTree = "<group>"; };
B1827492134CA4C100B98C2D /* CallbackFunction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CallbackFunction.cpp; sourceTree = "<group>"; };
B1D5ECB4134B58DA0087C78F /* CallbackFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CallbackFunction.h; sourceTree = "<group>"; };
B1E545711346291F0092A545 /* GeneratedStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GeneratedStream.cpp; sourceTree = "<group>"; };
@@ -17180,6 +17191,8 @@
B1E545D813462B0B0092A545 /* JSStream.h */,
49A85B75138D58EE00ECB7B3 /* JSStreamEvent.cpp */,
49A85B76138D58EE00ECB7B3 /* JSStreamEvent.h */,
+ B14353F6138EA95B00D53276 /* JSStreamList.cpp */,
+ B14353F7138EA95B00D53276 /* JSStreamList.h */,
65DF31EF09D1CC60000BE325 /* JSText.cpp */,
65DF31F009D1CC60000BE325 /* JSText.h */,
B12D23631356032F002A28D4 /* JSTrackList.cpp */,
@@ -19731,9 +19744,13 @@
B1E545741346291F0092A545 /* Stream.cpp */,
B1E545751346291F0092A545 /* Stream.h */,
B1E545761346291F0092A545 /* Stream.idl */,
+ B14353D0138EA8ED00D53276 /* StreamContainer.h */,
49A85B68138D573900ECB7B3 /* StreamEvent.cpp */,
49A85B69138D573A00ECB7B3 /* StreamEvent.h */,
49A85B6A138D573A00ECB7B3 /* StreamEvent.idl */,
+ B14353D1138EA8ED00D53276 /* StreamList.cpp */,
+ B14353D2138EA8ED00D53276 /* StreamList.h */,
+ B14353D3138EA8ED00D53276 /* StreamList.idl */,
8102C5871325BB1100DDE67A /* StringCallback.cpp */,
81AC6C35131C57D30009A7E0 /* StringCallback.h */,
81AC6C34131C57C20009A7E0 /* StringCallback.idl */,
@@ -21960,6 +21977,7 @@
892CF212134C8BB300AAEDA1 /* JSStorageInfoUsageCallback.h in Headers */,
B1E545E613462B0B0092A545 /* JSStream.h in Headers */,
49A85B78138D58EE00ECB7B3 /* JSStreamEvent.h in Headers */,
+ B14353F9138EA95B00D53276 /* JSStreamList.h in Headers */,
0FF5026A102BA9430066F39A /* JSStyleMedia.h in Headers */,
BCE0139B0C0BEF180043860A /* JSStyleSheet.h in Headers */,
A84EBD830CB8C97700079609 /* JSStyleSheetList.h in Headers */,
@@ -22717,7 +22735,9 @@
3AB02D2A12D4F91600FBB694 /* StorageTracker.h in Headers */,
3AC3680012EF7A09006A3D6F /* StorageTrackerClient.h in Headers */,
B1E5457E1346291F0092A545 /* Stream.h in Headers */,
+ B14353D4138EA8ED00D53276 /* StreamContainer.h in Headers */,
49A85B6C138D573A00ECB7B3 /* StreamEvent.h in Headers */,
+ B14353D6138EA8ED00D53276 /* StreamList.h in Headers */,
81AC6C36131C57D30009A7E0 /* StringCallback.h in Headers */,
65488D6B0DD5A83D009D83B2 /* StringSourceProvider.h in Headers */,
B23540F30D00782E002382FA /* StringTruncator.h in Headers */,
@@ -24905,6 +24925,7 @@
892CF211134C8BB300AAEDA1 /* JSStorageInfoUsageCallback.cpp in Sources */,
B1E545E513462B0B0092A545 /* JSStream.cpp in Sources */,
49A85B77138D58EE00ECB7B3 /* JSStreamEvent.cpp in Sources */,
+ B14353F8138EA95B00D53276 /* JSStreamList.cpp in Sources */,
0FF50269102BA9430066F39A /* JSStyleMedia.cpp in Sources */,
BCE0139A0C0BEF180043860A /* JSStyleSheet.cpp in Sources */,
BC98A27D0C0C9950004BEBF7 /* JSStyleSheetCustom.cpp in Sources */,
@@ -25575,6 +25596,7 @@
3AB02D2B12D4F91600FBB694 /* StorageTracker.cpp in Sources */,
B1E5457D1346291F0092A545 /* Stream.cpp in Sources */,
49A85B6B138D573A00ECB7B3 /* StreamEvent.cpp in Sources */,
+ B14353D5138EA8ED00D53276 /* StreamList.cpp in Sources */,
B2C3DA300D006C1D00EF6F26 /* String.cpp in Sources */,
8102C5881325BB1100DDE67A /* StringCallback.cpp in Sources */,
B2B2645C0D00A77E000ACC1D /* StringCF.cpp in Sources */,
Added: trunk/Source/WebCore/dom/StreamContainer.h (0 => 88798)
--- trunk/Source/WebCore/dom/StreamContainer.h (rev 0)
+++ trunk/Source/WebCore/dom/StreamContainer.h 2011-06-14 13:58:11 UTC (rev 88798)
@@ -0,0 +1,91 @@
+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef StreamContainer_h
+#define StreamContainer_h
+
+#if ENABLE(MEDIA_STREAM)
+
+#include "Stream.h"
+#include <wtf/Assertions.h>
+#include <wtf/Forward.h>
+#include <wtf/HashMap.h>
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class StreamContainer : public RefCounted<StreamContainer> {
+public:
+ static PassRefPtr<StreamContainer> create() { return adoptRef(new StreamContainer); }
+ virtual ~StreamContainer() { }
+
+ unsigned length() const { return m_streams.size(); }
+
+ PassRefPtr<Stream> item(unsigned index) const
+ {
+ HashMap<String, RefPtr<Stream> >::const_iterator i = m_streams.begin();
+ for (unsigned j = 0; i != m_streams.end(); ++i, ++j) {
+ if (j == index)
+ return i->second;
+ }
+ return PassRefPtr<Stream>();
+ }
+
+ void add(PassRefPtr<Stream> stream)
+ {
+ RefPtr<Stream> s = stream;
+ ASSERT(!contains(s));
+ m_streams.add(s->label(), s);
+ }
+
+ void remove(PassRefPtr<Stream> stream)
+ {
+ RefPtr<Stream> s = stream;
+ ASSERT(contains(s));
+ m_streams.remove(s->label());
+ }
+
+ bool contains(PassRefPtr<Stream> stream) const
+ {
+ RefPtr<Stream> s = stream;
+ return m_streams.contains(s->label());
+ }
+
+ PassRefPtr<Stream> get(const String& key) const
+ {
+ return m_streams.get(key);
+ }
+
+private:
+ StreamContainer() { }
+
+ HashMap<String, RefPtr<Stream> > m_streams;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(MEDIA_STREAM)
+
+#endif // StreamContainer_h
Added: trunk/Source/WebCore/dom/StreamList.cpp (0 => 88798)
--- trunk/Source/WebCore/dom/StreamList.cpp (rev 0)
+++ trunk/Source/WebCore/dom/StreamList.cpp 2011-06-14 13:58:11 UTC (rev 88798)
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "StreamList.h"
+
+#if ENABLE(MEDIA_STREAM)
+
+#include <StreamContainer.h>
+
+namespace WebCore {
+
+PassRefPtr<StreamList> StreamList::create(PassRefPtr<StreamContainer> streams)
+{
+ return adoptRef(new StreamList(streams));
+}
+
+StreamList::StreamList(PassRefPtr<StreamContainer> streams)
+ : m_streams(streams)
+{
+}
+
+StreamList::~StreamList()
+{
+}
+
+unsigned StreamList::length() const
+{
+ return m_streams->length();
+}
+
+PassRefPtr<Stream> StreamList::item(unsigned index) const
+{
+ if (index < m_streams->length())
+ return m_streams->item(index);
+ return PassRefPtr<Stream>();
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(MEDIA_STREAM)
Added: trunk/Source/WebCore/dom/StreamList.h (0 => 88798)
--- trunk/Source/WebCore/dom/StreamList.h (rev 0)
+++ trunk/Source/WebCore/dom/StreamList.h 2011-06-14 13:58:11 UTC (rev 88798)
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef StreamList_h
+#define StreamList_h
+
+#if ENABLE(MEDIA_STREAM)
+
+#include <wtf/Forward.h>
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
+
+namespace WebCore {
+
+class Stream;
+class StreamContainer;
+
+class StreamList : public RefCounted<StreamList> {
+public:
+ static PassRefPtr<StreamList> create(PassRefPtr<StreamContainer> streams);
+ virtual ~StreamList();
+
+ // DOM methods & attributes for StreamList
+ virtual unsigned length() const;
+ virtual PassRefPtr<Stream> item(unsigned index) const;
+
+private:
+ StreamList(PassRefPtr<StreamContainer> streams);
+
+ RefPtr<StreamContainer> m_streams;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(MEDIA_STREAM)
+
+#endif // StreamList_h
Added: trunk/Source/WebCore/dom/StreamList.idl (0 => 88798)
--- trunk/Source/WebCore/dom/StreamList.idl (rev 0)
+++ trunk/Source/WebCore/dom/StreamList.idl 2011-06-14 13:58:11 UTC (rev 88798)
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+module core {
+
+ interface [
+ Conditional=MEDIA_STREAM,
+ HasIndexGetter
+ ] StreamList {
+ Stream item(in [IsIndex] unsigned long index);
+
+ readonly attribute unsigned long length;
+ };
+
+}