Title: [181371] trunk/Source/WebCore
Revision
181371
Author
ph...@webkit.org
Date
2015-03-11 01:10:07 -0700 (Wed, 11 Mar 2015)

Log Message

Rename MediaStreamCenter to RealtimeMediaSourceCenter
https://bugs.webkit.org/show_bug.cgi?id=142535

Reviewed by Eric Carlson.

As per bug title, rename MediaStreamCenter to
RealtimeMediaSourceCenter, this class manages
RealtimeMediaSources, not MediaStreams. Some un-needed includes of
the header were also removed.

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/Source/WebCore/CMakeLists.txt (181370 => 181371)


--- trunk/Source/WebCore/CMakeLists.txt	2015-03-11 07:45:26 UTC (rev 181370)
+++ trunk/Source/WebCore/CMakeLists.txt	2015-03-11 08:10:07 UTC (rev 181371)
@@ -2166,10 +2166,10 @@
     platform/graphics/transforms/TransformationMatrix.cpp
     platform/graphics/transforms/TranslateTransformOperation.cpp
 
-    platform/mediastream/MediaStreamCenter.cpp
     platform/mediastream/MediaStreamPrivate.cpp
     platform/mediastream/MediaStreamTrackPrivate.cpp
     platform/mediastream/RealtimeMediaSource.cpp
+    platform/mediastream/RealtimeMediaSourceCenter.cpp
     platform/mediastream/RealtimeMediaSourceStates.cpp
     platform/mediastream/RTCIceCandidateDescriptor.cpp
     platform/mediastream/RTCPeerConnectionHandler.cpp
@@ -2179,7 +2179,7 @@
     platform/mock/DeviceOrientationClientMock.cpp
     platform/mock/GeolocationClientMock.cpp
     platform/mock/MediaConstraintsMock.cpp
-    platform/mock/MockMediaStreamCenter.cpp
+    platform/mock/MockRealtimeMediaSourceCenter.cpp
     platform/mock/RTCDataChannelHandlerMock.cpp
     platform/mock/RTCDTMFSenderHandlerMock.cpp
     platform/mock/RTCNotifiersMock.cpp

Modified: trunk/Source/WebCore/ChangeLog (181370 => 181371)


--- trunk/Source/WebCore/ChangeLog	2015-03-11 07:45:26 UTC (rev 181370)
+++ trunk/Source/WebCore/ChangeLog	2015-03-11 08:10:07 UTC (rev 181371)
@@ -1,3 +1,15 @@
+2015-03-10  Philippe Normand  <pnorm...@igalia.com>
+
+        Rename MediaStreamCenter to RealtimeMediaSourceCenter
+        https://bugs.webkit.org/show_bug.cgi?id=142535
+
+        Reviewed by Eric Carlson.
+
+        As per bug title, rename MediaStreamCenter to
+        RealtimeMediaSourceCenter, this class manages
+        RealtimeMediaSources, not MediaStreams. Some un-needed includes of
+        the header were also removed.
+
 2015-03-11  Gyuyoung Kim  <gyuyoung....@samsung.com>
 
         Remove unnecessary create() factory functions

Modified: trunk/Source/WebCore/Modules/mediastream/MediaStream.cpp (181370 => 181371)


--- trunk/Source/WebCore/Modules/mediastream/MediaStream.cpp	2015-03-11 07:45:26 UTC (rev 181370)
+++ trunk/Source/WebCore/Modules/mediastream/MediaStream.cpp	2015-03-11 08:10:07 UTC (rev 181371)
@@ -33,7 +33,6 @@
 #include "AudioStreamTrack.h"
 #include "Event.h"
 #include "ExceptionCode.h"
-#include "MediaStreamCenter.h"
 #include "MediaStreamRegistry.h"
 #include "MediaStreamTrackEvent.h"
 #include "RealtimeMediaSource.h"

Modified: trunk/Source/WebCore/Modules/mediastream/MediaStream.h (181370 => 181371)


--- trunk/Source/WebCore/Modules/mediastream/MediaStream.h	2015-03-11 07:45:26 UTC (rev 181370)
+++ trunk/Source/WebCore/Modules/mediastream/MediaStream.h	2015-03-11 08:10:07 UTC (rev 181371)
@@ -43,8 +43,6 @@
 
 namespace WebCore {
 
-class MediaStreamCenter;
-
 class MediaStream final : public RefCounted<MediaStream>, public URLRegistrable, public ScriptWrappable, public MediaStreamPrivateClient, public EventTargetWithInlineData, public ContextDestructionObserver {
 public:
     class Observer {

Modified: trunk/Source/WebCore/Modules/mediastream/MediaStreamTrack.cpp (181370 => 181371)


--- trunk/Source/WebCore/Modules/mediastream/MediaStreamTrack.cpp	2015-03-11 07:45:26 UTC (rev 181370)
+++ trunk/Source/WebCore/Modules/mediastream/MediaStreamTrack.cpp	2015-03-11 08:10:07 UTC (rev 181371)
@@ -40,12 +40,12 @@
 #include "MediaConstraintsImpl.h"
 #include "MediaSourceStates.h"
 #include "MediaStream.h"
-#include "MediaStreamCenter.h"
 #include "MediaStreamPrivate.h"
 #include "MediaStreamTrackSourcesCallback.h"
 #include "MediaStreamTrackSourcesRequest.h"
 #include "MediaTrackConstraints.h"
 #include "NotImplemented.h"
+#include "RealtimeMediaSourceCenter.h"
 #include "VideoStreamTrack.h"
 #include <wtf/Functional.h>
 #include <wtf/NeverDestroyed.h>
@@ -151,7 +151,7 @@
 void MediaStreamTrack::getSources(ScriptExecutionContext* context, PassRefPtr<MediaStreamTrackSourcesCallback> callback, ExceptionCode& ec)
 {
     RefPtr<MediaStreamTrackSourcesRequest> request = MediaStreamTrackSourcesRequest::create(context, callback);
-    if (!MediaStreamCenter::singleton().getMediaStreamTrackSources(request.release()))
+    if (!RealtimeMediaSourceCenter::singleton().getMediaStreamTrackSources(request.release()))
         ec = NOT_SUPPORTED_ERR;
 }
 

Modified: trunk/Source/WebCore/Modules/mediastream/UserMediaRequest.cpp (181370 => 181371)


--- trunk/Source/WebCore/Modules/mediastream/UserMediaRequest.cpp	2015-03-11 07:45:26 UTC (rev 181370)
+++ trunk/Source/WebCore/Modules/mediastream/UserMediaRequest.cpp	2015-03-11 08:10:07 UTC (rev 181371)
@@ -43,8 +43,8 @@
 #include "Frame.h"
 #include "MediaConstraintsImpl.h"
 #include "MediaStream.h"
-#include "MediaStreamCenter.h"
 #include "MediaStreamPrivate.h"
+#include "RealtimeMediaSourceCenter.h"
 #include "SecurityOrigin.h"
 #include "UserMediaController.h"
 #include <wtf/Functional.h>
@@ -114,7 +114,7 @@
 {
     // 1 - make sure the system is capable of supporting the audio and video constraints. We don't want to ask for
     // user permission if the constraints can not be suported.
-    MediaStreamCenter::singleton().validateRequestConstraints(this, m_audioConstraints, m_videoConstraints);
+    RealtimeMediaSourceCenter::singleton().validateRequestConstraints(this, m_audioConstraints, m_videoConstraints);
 }
 
     
@@ -133,7 +133,7 @@
     RefPtr<UserMediaRequest> protectedThis(this);
     callOnMainThread([protectedThis] {
         // 3 - the user granted access, ask platform to create the media stream descriptors.
-        MediaStreamCenter::singleton().createMediaStream(protectedThis.get(), protectedThis->m_audioConstraints, protectedThis->m_videoConstraints);
+        RealtimeMediaSourceCenter::singleton().createMediaStream(protectedThis.get(), protectedThis->m_audioConstraints, protectedThis->m_videoConstraints);
     });
 }
 

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (181370 => 181371)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2015-03-11 07:45:26 UTC (rev 181370)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2015-03-11 08:10:07 UTC (rev 181371)
@@ -252,10 +252,6 @@
 		078E092E17D14D1C00420AA1 /* UserMediaClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 07221B8D17CEC32700848E51 /* UserMediaClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		078E092F17D14D1C00420AA1 /* UserMediaController.h in Headers */ = {isa = PBXBuildFile; fileRef = 07221B8F17CEC32700848E51 /* UserMediaController.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		078E093017D14D1C00420AA1 /* UserMediaRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 07221B9117CEC32700848E51 /* UserMediaRequest.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		078E093117D1684200420AA1 /* MediaStreamCenterMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0729B14E17CFCCA0004F1D60 /* MediaStreamCenterMac.cpp */; };
-		078E093217D1684600420AA1 /* MediaStreamCenterMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 0729B14F17CFCCA0004F1D60 /* MediaStreamCenterMac.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		078E093317D16B0600420AA1 /* MediaStreamCenter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07221B9A17CF0AD400848E51 /* MediaStreamCenter.cpp */; };
-		078E093417D16B0B00420AA1 /* MediaStreamCenter.h in Headers */ = {isa = PBXBuildFile; fileRef = 07221B9B17CF0AD400848E51 /* MediaStreamCenter.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		078E093717D16B2C00420AA1 /* MediaStreamPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 07221B9D17CF0AD400848E51 /* MediaStreamPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		078E093917D16B2C00420AA1 /* MediaStreamCreationClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 07221BA017CF0AD400848E51 /* MediaStreamCreationClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		078E093A17D16E1C00420AA1 /* MediaConstraints.h in Headers */ = {isa = PBXBuildFile; fileRef = 07221B9917CF0AD400848E51 /* MediaConstraints.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -330,8 +326,6 @@
 		07C59B5E17F4B208000FBCBB /* JSAudioStreamTrack.h in Headers */ = {isa = PBXBuildFile; fileRef = 07C59B5A17F4B208000FBCBB /* JSAudioStreamTrack.h */; };
 		07C59B5F17F4B208000FBCBB /* JSVideoStreamTrack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07C59B5B17F4B208000FBCBB /* JSVideoStreamTrack.cpp */; };
 		07C59B6017F4B208000FBCBB /* JSVideoStreamTrack.h in Headers */ = {isa = PBXBuildFile; fileRef = 07C59B5C17F4B208000FBCBB /* JSVideoStreamTrack.h */; };
-		07C59B6317F4D1BF000FBCBB /* MockMediaStreamCenter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07C59B6117F4CF87000FBCBB /* MockMediaStreamCenter.cpp */; };
-		07C59B6417F4D1C4000FBCBB /* MockMediaStreamCenter.h in Headers */ = {isa = PBXBuildFile; fileRef = 07C59B6217F4CF87000FBCBB /* MockMediaStreamCenter.h */; };
 		07C59B6817F784BA000FBCBB /* MediaSourceStates.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07C59B6517F784BA000FBCBB /* MediaSourceStates.cpp */; };
 		07C59B6917F784BA000FBCBB /* MediaSourceStates.h in Headers */ = {isa = PBXBuildFile; fileRef = 07C59B6617F784BA000FBCBB /* MediaSourceStates.h */; };
 		07C59B6E17F794F6000FBCBB /* JSMediaSourceStatesCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07C59B6D17F794F6000FBCBB /* JSMediaSourceStatesCustom.cpp */; };
@@ -1768,6 +1762,12 @@
 		49FFBF4011C93EE3006A7118 /* WebGLLayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 49FFBF3E11C93EE3006A7118 /* WebGLLayer.mm */; };
 		4A0DA2FE129B241900AB61E1 /* FormAssociatedElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A0DA2FC129B241900AB61E1 /* FormAssociatedElement.cpp */; };
 		4A0DA2FF129B241900AB61E1 /* FormAssociatedElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A0DA2FD129B241900AB61E1 /* FormAssociatedElement.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		4A0FFA9D1AAF5E750062803B /* MockRealtimeMediaSourceCenter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A0FFA9B1AAF5E6C0062803B /* MockRealtimeMediaSourceCenter.cpp */; };
+		4A0FFA9E1AAF5E7E0062803B /* MockRealtimeMediaSourceCenter.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A0FFA9C1AAF5E6C0062803B /* MockRealtimeMediaSourceCenter.h */; };
+		4A0FFAA11AAF5EA20062803B /* RealtimeMediaSourceCenter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A0FFA9F1AAF5EA20062803B /* RealtimeMediaSourceCenter.cpp */; };
+		4A0FFAA21AAF5EA20062803B /* RealtimeMediaSourceCenter.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A0FFAA01AAF5EA20062803B /* RealtimeMediaSourceCenter.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		4A0FFAA51AAF5EF60062803B /* RealtimeMediaSourceCenterMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A0FFAA31AAF5EF60062803B /* RealtimeMediaSourceCenterMac.cpp */; };
+		4A0FFAA61AAF5EF60062803B /* RealtimeMediaSourceCenterMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A0FFAA41AAF5EF60062803B /* RealtimeMediaSourceCenterMac.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		4A38BF5014FE1C0900612512 /* WebSocketDeflateFramer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A38BF4E14FE1C0900612512 /* WebSocketDeflateFramer.cpp */; };
 		4A38BF5114FE1C0900612512 /* WebSocketDeflateFramer.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A38BF4F14FE1C0900612512 /* WebSocketDeflateFramer.h */; };
 		4A4F48A916B0DFC000EDBB29 /* DocumentRuleSets.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A4F48A716B0DFC000EDBB29 /* DocumentRuleSets.cpp */; };
@@ -7157,8 +7157,6 @@
 		07221B9017CEC32700848E51 /* UserMediaRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserMediaRequest.cpp; sourceTree = "<group>"; };
 		07221B9117CEC32700848E51 /* UserMediaRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserMediaRequest.h; sourceTree = "<group>"; };
 		07221B9917CF0AD400848E51 /* MediaConstraints.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaConstraints.h; sourceTree = "<group>"; };
-		07221B9A17CF0AD400848E51 /* MediaStreamCenter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaStreamCenter.cpp; sourceTree = "<group>"; };
-		07221B9B17CF0AD400848E51 /* MediaStreamCenter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaStreamCenter.h; sourceTree = "<group>"; };
 		07221B9D17CF0AD400848E51 /* MediaStreamPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaStreamPrivate.h; sourceTree = "<group>"; };
 		07221BA017CF0AD400848E51 /* MediaStreamCreationClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaStreamCreationClient.h; sourceTree = "<group>"; };
 		07221BA217CF0AD400848E51 /* RTCDataChannelHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTCDataChannelHandler.h; sourceTree = "<group>"; };
@@ -7188,8 +7186,6 @@
 		07277E4917D018CC0015534D /* JSMediaStreamTrackEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMediaStreamTrackEvent.h; sourceTree = "<group>"; };
 		072847E216EBC5B00043CFA4 /* PlatformTextTrack.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PlatformTextTrack.h; sourceTree = "<group>"; };
 		072847E316EBC5B00043CFA4 /* PlatformTextTrackMenu.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PlatformTextTrackMenu.h; sourceTree = "<group>"; };
-		0729B14E17CFCCA0004F1D60 /* MediaStreamCenterMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaStreamCenterMac.cpp; sourceTree = "<group>"; };
-		0729B14F17CFCCA0004F1D60 /* MediaStreamCenterMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaStreamCenterMac.h; sourceTree = "<group>"; };
 		072AE1DF183C0741000A5988 /* PluginReplacement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PluginReplacement.h; path = plugins/PluginReplacement.h; sourceTree = "<group>"; };
 		072AE1E0183C0741000A5988 /* QuickTimePluginReplacement.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = QuickTimePluginReplacement.mm; path = plugins/QuickTimePluginReplacement.mm; sourceTree = "<group>"; };
 		072AE1E1183C0741000A5988 /* QuickTimePluginReplacement.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; name = QuickTimePluginReplacement.css; path = plugins/QuickTimePluginReplacement.css; sourceTree = "<group>"; };
@@ -7330,8 +7326,6 @@
 		07C59B5A17F4B208000FBCBB /* JSAudioStreamTrack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSAudioStreamTrack.h; sourceTree = "<group>"; };
 		07C59B5B17F4B208000FBCBB /* JSVideoStreamTrack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSVideoStreamTrack.cpp; sourceTree = "<group>"; };
 		07C59B5C17F4B208000FBCBB /* JSVideoStreamTrack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSVideoStreamTrack.h; sourceTree = "<group>"; };
-		07C59B6117F4CF87000FBCBB /* MockMediaStreamCenter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MockMediaStreamCenter.cpp; sourceTree = "<group>"; };
-		07C59B6217F4CF87000FBCBB /* MockMediaStreamCenter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MockMediaStreamCenter.h; sourceTree = "<group>"; };
 		07C59B6517F784BA000FBCBB /* MediaSourceStates.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaSourceStates.cpp; sourceTree = "<group>"; };
 		07C59B6617F784BA000FBCBB /* MediaSourceStates.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaSourceStates.h; sourceTree = "<group>"; };
 		07C59B6717F784BA000FBCBB /* MediaSourceStates.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MediaSourceStates.idl; sourceTree = "<group>"; };
@@ -8903,6 +8897,12 @@
 		49FFBF3E11C93EE3006A7118 /* WebGLLayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebGLLayer.mm; sourceTree = "<group>"; };
 		4A0DA2FC129B241900AB61E1 /* FormAssociatedElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FormAssociatedElement.cpp; sourceTree = "<group>"; };
 		4A0DA2FD129B241900AB61E1 /* FormAssociatedElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FormAssociatedElement.h; sourceTree = "<group>"; };
+		4A0FFA9B1AAF5E6C0062803B /* MockRealtimeMediaSourceCenter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MockRealtimeMediaSourceCenter.cpp; sourceTree = "<group>"; };
+		4A0FFA9C1AAF5E6C0062803B /* MockRealtimeMediaSourceCenter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MockRealtimeMediaSourceCenter.h; sourceTree = "<group>"; };
+		4A0FFA9F1AAF5EA20062803B /* RealtimeMediaSourceCenter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RealtimeMediaSourceCenter.cpp; sourceTree = "<group>"; };
+		4A0FFAA01AAF5EA20062803B /* RealtimeMediaSourceCenter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RealtimeMediaSourceCenter.h; sourceTree = "<group>"; };
+		4A0FFAA31AAF5EF60062803B /* RealtimeMediaSourceCenterMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RealtimeMediaSourceCenterMac.cpp; sourceTree = "<group>"; };
+		4A0FFAA41AAF5EF60062803B /* RealtimeMediaSourceCenterMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RealtimeMediaSourceCenterMac.h; sourceTree = "<group>"; };
 		4A38BF4E14FE1C0900612512 /* WebSocketDeflateFramer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebSocketDeflateFramer.cpp; sourceTree = "<group>"; };
 		4A38BF4F14FE1C0900612512 /* WebSocketDeflateFramer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSocketDeflateFramer.h; sourceTree = "<group>"; };
 		4A4F48A716B0DFC000EDBB29 /* DocumentRuleSets.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DocumentRuleSets.cpp; sourceTree = "<group>"; };
@@ -14592,6 +14592,8 @@
 		07221B9217CF0AD400848E51 /* mediastream */ = {
 			isa = PBXGroup;
 			children = (
+				4A0FFA9F1AAF5EA20062803B /* RealtimeMediaSourceCenter.cpp */,
+				4A0FFAA01AAF5EA20062803B /* RealtimeMediaSourceCenter.h */,
 				4A4F656B1AA997F100E38CDD /* RealtimeMediaSource.cpp */,
 				4A4F656C1AA997F100E38CDD /* RealtimeMediaSource.h */,
 				4A4F656D1AA997F100E38CDD /* RealtimeMediaSourceCapabilities.h */,
@@ -14599,8 +14601,6 @@
 				4A4F656F1AA997F100E38CDD /* RealtimeMediaSourceStates.h */,
 				0729B14D17CFCCA0004F1D60 /* mac */,
 				07221B9917CF0AD400848E51 /* MediaConstraints.h */,
-				07221B9A17CF0AD400848E51 /* MediaStreamCenter.cpp */,
-				07221B9B17CF0AD400848E51 /* MediaStreamCenter.h */,
 				070F549717F12F6B00169E04 /* MediaStreamConstraintsValidationClient.h */,
 				07221BA017CF0AD400848E51 /* MediaStreamCreationClient.h */,
 				0711588F17DF633700EDFE2B /* MediaStreamPrivate.cpp */,
@@ -14632,6 +14632,8 @@
 		0729B14D17CFCCA0004F1D60 /* mac */ = {
 			isa = PBXGroup;
 			children = (
+				4A0FFAA31AAF5EF60062803B /* RealtimeMediaSourceCenterMac.cpp */,
+				4A0FFAA41AAF5EF60062803B /* RealtimeMediaSourceCenterMac.h */,
 				070363D8181A1CDC00C074A5 /* AVAudioCaptureSource.h */,
 				070363D9181A1CDC00C074A5 /* AVAudioCaptureSource.mm */,
 				070363DA181A1CDC00C074A5 /* AVCaptureDeviceManager.h */,
@@ -14640,8 +14642,6 @@
 				070363DD181A1CDC00C074A5 /* AVMediaCaptureSource.mm */,
 				070363DE181A1CDC00C074A5 /* AVVideoCaptureSource.h */,
 				070363DF181A1CDC00C074A5 /* AVVideoCaptureSource.mm */,
-				0729B14E17CFCCA0004F1D60 /* MediaStreamCenterMac.cpp */,
-				0729B14F17CFCCA0004F1D60 /* MediaStreamCenterMac.h */,
 			);
 			path = mac;
 			sourceTree = "<group>";
@@ -16291,13 +16291,13 @@
 		59C77F101054591C00506104 /* mock */ = {
 			isa = PBXGroup;
 			children = (
+				4A0FFA9B1AAF5E6C0062803B /* MockRealtimeMediaSourceCenter.cpp */,
+				4A0FFA9C1AAF5E6C0062803B /* MockRealtimeMediaSourceCenter.h */,
 				CDF2B005182053DF00F2B424 /* mediasource */,
 				59309A1011F4AE5800250603 /* DeviceOrientationClientMock.cpp */,
 				59309A1211F4AE6A00250603 /* DeviceOrientationClientMock.h */,
 				073794DF19EE2D1B00E5A045 /* MediaConstraintsMock.cpp */,
 				073794E019EE2D1B00E5A045 /* MediaConstraintsMock.h */,
-				07C59B6117F4CF87000FBCBB /* MockMediaStreamCenter.cpp */,
-				07C59B6217F4CF87000FBCBB /* MockMediaStreamCenter.h */,
 				AAE27B7416CBFC0D00623043 /* PlatformSpeechSynthesizerMock.cpp */,
 				AAE27B7516CBFC0D00623043 /* PlatformSpeechSynthesizerMock.h */,
 				073794F319F5864E00E5A045 /* RTCDataChannelHandlerMock.cpp */,
@@ -23869,6 +23869,7 @@
 				E1FE136B183FE1AB00892F13 /* CryptoAlgorithmRSA_OAEP.h in Headers */,
 				E1233F0D185A3E3B008DFAF5 /* CryptoAlgorithmRSAES_PKCS1_v1_5.h in Headers */,
 				E1BD331E182D8F4200C05D9F /* CryptoAlgorithmRsaKeyGenParams.h in Headers */,
+				4A0FFAA61AAF5EF60062803B /* RealtimeMediaSourceCenterMac.h in Headers */,
 				E1C266DB18319935003F8B33 /* CryptoAlgorithmRsaKeyParamsWithHash.h in Headers */,
 				E1FE1377184D1E3300892F13 /* CryptoAlgorithmRsaOaepParams.h in Headers */,
 				E1BD331A182D8DDD00C05D9F /* CryptoAlgorithmRSASSA_PKCS1_v1_5.h in Headers */,
@@ -23997,6 +23998,7 @@
 				45FEA5D0156DDE8C00654101 /* Decimal.h in Headers */,
 				A8C228A111D5722E00D5A7D3 /* DecodedDataDocumentParser.h in Headers */,
 				CECCFC3B141973D5002A0AC1 /* DecodeEscapeSequences.h in Headers */,
+				4A0FFAA21AAF5EA20062803B /* RealtimeMediaSourceCenter.h in Headers */,
 				4162A451101145AE00DFF3ED /* DedicatedWorkerGlobalScope.h in Headers */,
 				41A3D58F101C152D00316D07 /* DedicatedWorkerThread.h in Headers */,
 				FD06DFA6134A4DEF006F5D7D /* DefaultAudioDestinationNode.h in Headers */,
@@ -25625,8 +25627,6 @@
 				0783228518013ED800999E0C /* MediaStreamAudioSource.h in Headers */,
 				FD671A78159BB07000197559 /* MediaStreamAudioSourceNode.h in Headers */,
 				0705850B17FA4827005F2BCB /* MediaStreamCapabilities.h in Headers */,
-				078E093417D16B0B00420AA1 /* MediaStreamCenter.h in Headers */,
-				078E093217D1684600420AA1 /* MediaStreamCenterMac.h in Headers */,
 				070F549817F12F6B00169E04 /* MediaStreamConstraintsValidationClient.h in Headers */,
 				078E093917D16B2C00420AA1 /* MediaStreamCreationClient.h in Headers */,
 				078E091617D14D1C00420AA1 /* MediaStreamEvent.h in Headers */,
@@ -25662,7 +25662,6 @@
 				CDF2B0111820540600F2B424 /* MockBox.h in Headers */,
 				CDF2B0131820540600F2B424 /* MockMediaPlayerMediaSource.h in Headers */,
 				CDF2B0151820540600F2B424 /* MockMediaSourcePrivate.h in Headers */,
-				07C59B6417F4D1C4000FBCBB /* MockMediaStreamCenter.h in Headers */,
 				CDF2B0171820540700F2B424 /* MockSourceBufferPrivate.h in Headers */,
 				CDF2B0191820540700F2B424 /* MockTracks.h in Headers */,
 				C6D74AD509AA282E000B0A52 /* ModifySelectionListLevel.h in Headers */,
@@ -27021,6 +27020,7 @@
 				1AB7FC7D0A8B92EC00D9D37B /* XPathPredicate.h in Headers */,
 				1AB7FC7F0A8B92EC00D9D37B /* XPathResult.h in Headers */,
 				1AB7FC820A8B92EC00D9D37B /* XPathStep.h in Headers */,
+				4A0FFA9E1AAF5E7E0062803B /* MockRealtimeMediaSourceCenter.h in Headers */,
 				1AB7FC840A8B92EC00D9D37B /* XPathUtil.h in Headers */,
 				1AB7FC860A8B92EC00D9D37B /* XPathValue.h in Headers */,
 				1AB7FC880A8B92EC00D9D37B /* XPathVariableReference.h in Headers */,
@@ -27959,6 +27959,7 @@
 				9766504F144FBFFE00F6BB51 /* EventFactory.cpp in Sources */,
 				93C09A810B064F00005ABD4D /* EventHandler.cpp in Sources */,
 				FE6938B61045D67E008EABB6 /* EventHandlerIOS.mm in Sources */,
+				4A0FFAA11AAF5EA20062803B /* RealtimeMediaSourceCenter.cpp in Sources */,
 				93C09A7F0B064EEF005ABD4D /* EventHandlerMac.mm in Sources */,
 				AD4495F3141FC08900541EDF /* EventListenerMap.cpp in Sources */,
 				C400D10918F1C8F60090D863 /* EventLoopInput.cpp in Sources */,
@@ -29172,8 +29173,6 @@
 				0783228418013ED800999E0C /* MediaStreamAudioSource.cpp in Sources */,
 				FD671A77159BB07000197559 /* MediaStreamAudioSourceNode.cpp in Sources */,
 				0705851517FB0EEA005F2BCB /* MediaStreamCapabilities.cpp in Sources */,
-				078E093317D16B0600420AA1 /* MediaStreamCenter.cpp in Sources */,
-				078E093117D1684200420AA1 /* MediaStreamCenterMac.cpp in Sources */,
 				078E090017D14CEE00420AA1 /* MediaStreamEvent.cpp in Sources */,
 				0711589117DF6F6600EDFE2B /* MediaStreamPrivate.cpp in Sources */,
 				078E090117D14CEE00420AA1 /* MediaStreamRegistry.cpp in Sources */,
@@ -29204,7 +29203,6 @@
 				724ED3311A3A8B2300F5F13C /* JSEXTBlendMinMax.cpp in Sources */,
 				CDF2B0121820540600F2B424 /* MockMediaPlayerMediaSource.cpp in Sources */,
 				CDF2B0141820540600F2B424 /* MockMediaSourcePrivate.cpp in Sources */,
-				07C59B6317F4D1BF000FBCBB /* MockMediaStreamCenter.cpp in Sources */,
 				CDF2B0161820540700F2B424 /* MockSourceBufferPrivate.cpp in Sources */,
 				CDF2B0181820540700F2B424 /* MockTracks.cpp in Sources */,
 				C6D74AE409AA290A000B0A52 /* ModifySelectionListLevel.cpp in Sources */,
@@ -29702,6 +29700,7 @@
 				AA2A5ACD16A485FA00975A25 /* SpeechSynthesisVoice.cpp in Sources */,
 				A78FE13B12366B1000ACE8D0 /* SpellChecker.cpp in Sources */,
 				B8DBDB4D130B0F8A00F5CDB1 /* SpellingCorrectionCommand.cpp in Sources */,
+				4A0FFAA51AAF5EF60062803B /* RealtimeMediaSourceCenterMac.cpp in Sources */,
 				4512502215DCE37D002F84E2 /* SpinButtonElement.cpp in Sources */,
 				93309E11099E64920056E581 /* SplitElementCommand.cpp in Sources */,
 				93309E13099E64920056E581 /* SplitTextNodeCommand.cpp in Sources */,
@@ -30032,6 +30031,7 @@
 				F55B3DDB1251F12D003EF269 /* TimeInputType.cpp in Sources */,
 				7553CFE9108F473F00EA281E /* TimelineRecordFactory.cpp in Sources */,
 				93309EA4099EB78C0056E581 /* Timer.cpp in Sources */,
+				4A0FFA9D1AAF5E750062803B /* MockRealtimeMediaSourceCenter.cpp in Sources */,
 				585D6E031A1A792E00FA4F12 /* SimpleLineLayoutFlowContents.cpp in Sources */,
 				E44613AF0CD6331000FADA75 /* TimeRanges.cpp in Sources */,
 				A1DE71321861322200734192 /* TouchConstructors.cpp in Sources */,

Deleted: trunk/Source/WebCore/platform/mediastream/MediaStreamCenter.cpp (181370 => 181371)


--- trunk/Source/WebCore/platform/mediastream/MediaStreamCenter.cpp	2015-03-11 07:45:26 UTC (rev 181370)
+++ trunk/Source/WebCore/platform/mediastream/MediaStreamCenter.cpp	2015-03-11 08:10:07 UTC (rev 181371)
@@ -1,72 +0,0 @@
-/*
- * Copyright (C) 2011 Ericsson AB. All rights reserved.
- * Copyright (C) 2012 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.
- * 3. Neither the name of Ericsson nor the names of its contributors
- *    may be used to endorse or promote products derived from this
- *    software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
- * OWNER OR 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"
-
-#if ENABLE(MEDIA_STREAM)
-
-#include "MediaStreamCenter.h"
-
-#include "MediaStreamPrivate.h"
-
-namespace WebCore {
-
-static MediaStreamCenter*& mediaStreamCenterOverride()
-{
-    static MediaStreamCenter* override;
-    return override;
-}
-
-MediaStreamCenter& MediaStreamCenter::singleton()
-{
-    MediaStreamCenter* override = mediaStreamCenterOverride();
-    if (override)
-        return *override;
-    
-    return MediaStreamCenter::platformCenter();
-}
-
-void MediaStreamCenter::setSharedStreamCenter(MediaStreamCenter* center)
-{
-    mediaStreamCenterOverride() = center;
-}
-
-MediaStreamCenter::MediaStreamCenter()
-{
-}
-
-MediaStreamCenter::~MediaStreamCenter()
-{
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(MEDIA_STREAM)

Deleted: trunk/Source/WebCore/platform/mediastream/MediaStreamCenter.h (181370 => 181371)


--- trunk/Source/WebCore/platform/mediastream/MediaStreamCenter.h	2015-03-11 07:45:26 UTC (rev 181370)
+++ trunk/Source/WebCore/platform/mediastream/MediaStreamCenter.h	2015-03-11 08:10:07 UTC (rev 181371)
@@ -1,71 +0,0 @@
-/*
- * Copyright (C) 2011 Ericsson AB. All rights reserved.
- * Copyright (C) 2012 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.
- * 3. Neither the name of Ericsson nor the names of its contributors
- *    may be used to endorse or promote products derived from this
- *    software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
- * OWNER OR 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 MediaStreamCenter_h
-#define MediaStreamCenter_h
-
-#if ENABLE(MEDIA_STREAM)
-
-#include "RealtimeMediaSource.h"
-#include <wtf/PassRefPtr.h>
-#include <wtf/text/WTFString.h>
-
-namespace WebCore {
-
-class MediaConstraints;
-class MediaStreamCreationClient;
-class RealtimeMediaSourceStates;
-class MediaStreamTrackSourcesRequestClient;
-
-class MediaStreamCenter {
-public:
-    virtual ~MediaStreamCenter();
-
-    static MediaStreamCenter& singleton();
-    static void setSharedStreamCenter(MediaStreamCenter*);
-
-    virtual void validateRequestConstraints(PassRefPtr<MediaStreamCreationClient>, PassRefPtr<MediaConstraints> audioConstraints, PassRefPtr<MediaConstraints> videoConstraints) = 0;
-
-    virtual void createMediaStream(PassRefPtr<MediaStreamCreationClient>, PassRefPtr<MediaConstraints> audioConstraints, PassRefPtr<MediaConstraints> videoConstraints) = 0;
-
-    virtual bool getMediaStreamTrackSources(PassRefPtr<MediaStreamTrackSourcesRequestClient>) = 0;
-
-protected:
-    MediaStreamCenter();
-
-    static MediaStreamCenter& platformCenter();
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(MEDIA_STREAM)
-
-#endif // MediaStreamCenter_h

Modified: trunk/Source/WebCore/platform/mediastream/MediaStreamPrivate.cpp (181370 => 181371)


--- trunk/Source/WebCore/platform/mediastream/MediaStreamPrivate.cpp	2015-03-11 07:45:26 UTC (rev 181370)
+++ trunk/Source/WebCore/platform/mediastream/MediaStreamPrivate.cpp	2015-03-11 08:10:07 UTC (rev 181371)
@@ -36,7 +36,6 @@
 
 #include "MediaStreamPrivate.h"
 
-#include "MediaStreamCenter.h"
 #include "UUID.h"
 #include <wtf/RefCounted.h>
 #include <wtf/Vector.h>

Modified: trunk/Source/WebCore/platform/mediastream/RealtimeMediaSource.cpp (181370 => 181371)


--- trunk/Source/WebCore/platform/mediastream/RealtimeMediaSource.cpp	2015-03-11 07:45:26 UTC (rev 181370)
+++ trunk/Source/WebCore/platform/mediastream/RealtimeMediaSource.cpp	2015-03-11 08:10:07 UTC (rev 181371)
@@ -35,7 +35,6 @@
 #if ENABLE(MEDIA_STREAM)
 #include "RealtimeMediaSource.h"
 
-#include "MediaStreamCenter.h"
 #include "RealtimeMediaSourceCapabilities.h"
 #include "UUID.h"
 

Copied: trunk/Source/WebCore/platform/mediastream/RealtimeMediaSourceCenter.cpp (from rev 181368, trunk/Source/WebCore/platform/mediastream/MediaStreamCenter.cpp) (0 => 181371)


--- trunk/Source/WebCore/platform/mediastream/RealtimeMediaSourceCenter.cpp	                        (rev 0)
+++ trunk/Source/WebCore/platform/mediastream/RealtimeMediaSourceCenter.cpp	2015-03-11 08:10:07 UTC (rev 181371)
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2011 Ericsson AB. All rights reserved.
+ * Copyright (C) 2012 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.
+ * 3. Neither the name of Ericsson nor the names of its contributors
+ *    may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
+ * OWNER OR 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"
+
+#if ENABLE(MEDIA_STREAM)
+#include "RealtimeMediaSourceCenter.h"
+
+#include "MediaStreamPrivate.h"
+
+namespace WebCore {
+
+static RealtimeMediaSourceCenter*& mediaStreamCenterOverride()
+{
+    static RealtimeMediaSourceCenter* override;
+    return override;
+}
+
+RealtimeMediaSourceCenter& RealtimeMediaSourceCenter::singleton()
+{
+    RealtimeMediaSourceCenter* override = mediaStreamCenterOverride();
+    if (override)
+        return *override;
+    
+    return RealtimeMediaSourceCenter::platformCenter();
+}
+
+void RealtimeMediaSourceCenter::setSharedStreamCenter(RealtimeMediaSourceCenter* center)
+{
+    mediaStreamCenterOverride() = center;
+}
+
+RealtimeMediaSourceCenter::RealtimeMediaSourceCenter()
+{
+}
+
+RealtimeMediaSourceCenter::~RealtimeMediaSourceCenter()
+{
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(MEDIA_STREAM)

Copied: trunk/Source/WebCore/platform/mediastream/RealtimeMediaSourceCenter.h (from rev 181368, trunk/Source/WebCore/platform/mediastream/MediaStreamCenter.h) (0 => 181371)


--- trunk/Source/WebCore/platform/mediastream/RealtimeMediaSourceCenter.h	                        (rev 0)
+++ trunk/Source/WebCore/platform/mediastream/RealtimeMediaSourceCenter.h	2015-03-11 08:10:07 UTC (rev 181371)
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2011 Ericsson AB. All rights reserved.
+ * Copyright (C) 2012 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.
+ * 3. Neither the name of Ericsson nor the names of its contributors
+ *    may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
+ * OWNER OR 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 RealtimeMediaSourceCenter_h
+#define RealtimeMediaSourceCenter_h
+
+#if ENABLE(MEDIA_STREAM)
+
+#include "RealtimeMediaSource.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+class MediaConstraints;
+class MediaStreamCreationClient;
+class RealtimeMediaSourceStates;
+class MediaStreamTrackSourcesRequestClient;
+
+class RealtimeMediaSourceCenter {
+public:
+    virtual ~RealtimeMediaSourceCenter();
+
+    static RealtimeMediaSourceCenter& singleton();
+    static void setSharedStreamCenter(RealtimeMediaSourceCenter*);
+
+    virtual void validateRequestConstraints(PassRefPtr<MediaStreamCreationClient>, PassRefPtr<MediaConstraints> audioConstraints, PassRefPtr<MediaConstraints> videoConstraints) = 0;
+
+    virtual void createMediaStream(PassRefPtr<MediaStreamCreationClient>, PassRefPtr<MediaConstraints> audioConstraints, PassRefPtr<MediaConstraints> videoConstraints) = 0;
+
+    virtual bool getMediaStreamTrackSources(PassRefPtr<MediaStreamTrackSourcesRequestClient>) = 0;
+
+protected:
+    RealtimeMediaSourceCenter();
+
+    static RealtimeMediaSourceCenter& platformCenter();
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(MEDIA_STREAM)
+
+#endif // RealtimeMediaSourceCenter_h

Modified: trunk/Source/WebCore/platform/mediastream/gstreamer/MediaStreamCenterGStreamer.cpp (181370 => 181371)


--- trunk/Source/WebCore/platform/mediastream/gstreamer/MediaStreamCenterGStreamer.cpp	2015-03-11 07:45:26 UTC (rev 181370)
+++ trunk/Source/WebCore/platform/mediastream/gstreamer/MediaStreamCenterGStreamer.cpp	2015-03-11 08:10:07 UTC (rev 181371)
@@ -44,7 +44,7 @@
 
 namespace WebCore {
 
-MediaStreamCenter& MediaStreamCenter::platformCenter()
+RealtimeMediaSourceCenter& RealtimeMediaSourceCenter::platformCenter()
 {
     ASSERT(isMainThread());
     DEPRECATED_DEFINE_STATIC_LOCAL(MediaStreamCenterGStreamer, center, ());

Modified: trunk/Source/WebCore/platform/mediastream/gstreamer/MediaStreamCenterGStreamer.h (181370 => 181371)


--- trunk/Source/WebCore/platform/mediastream/gstreamer/MediaStreamCenterGStreamer.h	2015-03-11 07:45:26 UTC (rev 181370)
+++ trunk/Source/WebCore/platform/mediastream/gstreamer/MediaStreamCenterGStreamer.h	2015-03-11 08:10:07 UTC (rev 181371)
@@ -34,7 +34,7 @@
 
 #if ENABLE(MEDIA_STREAM)
 
-#include "MediaStreamCenter.h"
+#include "RealtimeMediaSourceCenter.h"
 
 #include <wtf/PassRefPtr.h>
 #include <wtf/text/WTFString.h>
@@ -45,7 +45,7 @@
 class RealtimeMediaSource;
 class MediaStreamSourcesQueryClient;
 
-class MediaStreamCenterGStreamer : public MediaStreamCenter {
+class MediaStreamCenterGStreamer : public RealtimeMediaSourceCenter {
 public:
     MediaStreamCenterGStreamer();
     ~MediaStreamCenterGStreamer();

Modified: trunk/Source/WebCore/platform/mediastream/mac/AVCaptureDeviceManager.h (181370 => 181371)


--- trunk/Source/WebCore/platform/mediastream/mac/AVCaptureDeviceManager.h	2015-03-11 07:45:26 UTC (rev 181370)
+++ trunk/Source/WebCore/platform/mediastream/mac/AVCaptureDeviceManager.h	2015-03-11 08:10:07 UTC (rev 181371)
@@ -28,7 +28,6 @@
 
 #if ENABLE(MEDIA_STREAM) && USE(AVFOUNDATION)
 
-#include "MediaStreamCenter.h"
 #include "MediaStreamTrackSourcesRequestClient.h"
 #include "RealtimeMediaSource.h"
 #include <wtf/RetainPtr.h>

Deleted: trunk/Source/WebCore/platform/mediastream/mac/MediaStreamCenterMac.cpp (181370 => 181371)


--- trunk/Source/WebCore/platform/mediastream/mac/MediaStreamCenterMac.cpp	2015-03-11 07:45:26 UTC (rev 181370)
+++ trunk/Source/WebCore/platform/mediastream/mac/MediaStreamCenterMac.cpp	2015-03-11 08:10:07 UTC (rev 181371)
@@ -1,139 +0,0 @@
-/*
- * Copyright (C) 2013 Apple, 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.
- * 3. Neither the name of Ericsson nor the names of its contributors
- *    may be used to endorse or promote products derived from this
- *    software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
- * OWNER OR 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"
-
-#if ENABLE(MEDIA_STREAM)
-
-#include "MediaStreamCenterMac.h"
-
-#include "AVCaptureDeviceManager.h"
-#include "MediaStreamCreationClient.h"
-#include "MediaStreamPrivate.h"
-#include "MediaStreamTrackSourcesRequestClient.h"
-#include <wtf/MainThread.h>
-
-namespace WebCore {
-
-MediaStreamCenter& MediaStreamCenter::platformCenter()
-{
-    ASSERT(isMainThread());
-    DEPRECATED_DEFINE_STATIC_LOCAL(MediaStreamCenterMac, center, ());
-    return center;
-}
-
-MediaStreamCenterMac::MediaStreamCenterMac()
-{
-}
-
-MediaStreamCenterMac::~MediaStreamCenterMac()
-{
-}
-
-void MediaStreamCenterMac::validateRequestConstraints(PassRefPtr<MediaStreamCreationClient> prpQueryClient, PassRefPtr<MediaConstraints> audioConstraints, PassRefPtr<MediaConstraints> videoConstraints)
-{
-    RefPtr<MediaStreamCreationClient> client = prpQueryClient;
-    
-    ASSERT(client);
-
-    if (audioConstraints) {
-        String invalidConstraint;
-        AVCaptureDeviceManager::singleton().verifyConstraintsForMediaType(RealtimeMediaSource::Audio, audioConstraints.get(), invalidConstraint);
-        if (!invalidConstraint.isEmpty()) {
-            client->constraintsInvalid(invalidConstraint);
-            return;
-        }
-    }
-
-    if (videoConstraints) {
-        String invalidConstraint;
-        AVCaptureDeviceManager::singleton().verifyConstraintsForMediaType(RealtimeMediaSource::Video, videoConstraints.get(), invalidConstraint);
-        if (!invalidConstraint.isEmpty()) {
-            client->constraintsInvalid(invalidConstraint);
-            return;
-        }
-    }
-
-    client->constraintsValidated();
-}
-    
-void MediaStreamCenterMac::createMediaStream(PassRefPtr<MediaStreamCreationClient> prpQueryClient, PassRefPtr<MediaConstraints> audioConstraints, PassRefPtr<MediaConstraints> videoConstraints)
-{
-    RefPtr<MediaStreamCreationClient> client = prpQueryClient;
-    
-    ASSERT(client);
-    
-    Vector<RefPtr<RealtimeMediaSource>> audioSources;
-    Vector<RefPtr<RealtimeMediaSource>> videoSources;
-    
-    if (audioConstraints) {
-        String invalidConstraint;
-        AVCaptureDeviceManager::singleton().verifyConstraintsForMediaType(RealtimeMediaSource::Audio, audioConstraints.get(), invalidConstraint);
-        if (!invalidConstraint.isEmpty()) {
-            client->failedToCreateStreamWithConstraintsError(invalidConstraint);
-            return;
-        }
-        
-        RefPtr<RealtimeMediaSource> audioSource = AVCaptureDeviceManager::singleton().bestSourceForTypeAndConstraints(RealtimeMediaSource::Audio, audioConstraints.get());
-        ASSERT(audioSource);
-        
-        audioSources.append(audioSource.release());
-    }
-    
-    if (videoConstraints) {
-        String invalidConstraint;
-        AVCaptureDeviceManager::singleton().verifyConstraintsForMediaType(RealtimeMediaSource::Video, videoConstraints.get(), invalidConstraint);
-        if (!invalidConstraint.isEmpty()) {
-            client->failedToCreateStreamWithConstraintsError(invalidConstraint);
-            return;
-        }
-        
-        RefPtr<RealtimeMediaSource> videoSource = AVCaptureDeviceManager::singleton().bestSourceForTypeAndConstraints(RealtimeMediaSource::Video, videoConstraints.get());
-        ASSERT(videoSource);
-        
-        videoSources.append(videoSource.release());
-    }
-    
-    client->didCreateStream(MediaStreamPrivate::create(audioSources, videoSources));
-}
-
-bool MediaStreamCenterMac::getMediaStreamTrackSources(PassRefPtr<MediaStreamTrackSourcesRequestClient> prpClient)
-{
-    RefPtr<MediaStreamTrackSourcesRequestClient> requestClient = prpClient;
-
-    Vector<RefPtr<TrackSourceInfo>> sources = AVCaptureDeviceManager::singleton().getSourcesInfo(requestClient->requestOrigin());
-
-    requestClient->didCompleteRequest(sources);
-    return true;
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(MEDIA_STREAM)

Deleted: trunk/Source/WebCore/platform/mediastream/mac/MediaStreamCenterMac.h (181370 => 181371)


--- trunk/Source/WebCore/platform/mediastream/mac/MediaStreamCenterMac.h	2015-03-11 07:45:26 UTC (rev 181370)
+++ trunk/Source/WebCore/platform/mediastream/mac/MediaStreamCenterMac.h	2015-03-11 08:10:07 UTC (rev 181371)
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2013 Apple, 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.
- * 3. Neither the name of Ericsson nor the names of its contributors
- *    may be used to endorse or promote products derived from this
- *    software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
- * OWNER OR 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 MediaStreamCenterMac_h
-#define MediaStreamCenterMac_h
-
-#if ENABLE(MEDIA_STREAM)
-
-#include "MediaStreamCenter.h"
-
-#include "RealtimeMediaSource.h"
-#include <wtf/PassRefPtr.h>
-#include <wtf/text/WTFString.h>
-
-namespace WebCore {
-
-class MediaStreamCenterMac final : public MediaStreamCenter {
-public:
-    MediaStreamCenterMac();
-    ~MediaStreamCenterMac();
-
-    virtual void validateRequestConstraints(PassRefPtr<MediaStreamCreationClient>, PassRefPtr<MediaConstraints> audioConstraints, PassRefPtr<MediaConstraints> videoConstraints);
-    virtual void createMediaStream(PassRefPtr<MediaStreamCreationClient>, PassRefPtr<MediaConstraints> audioConstraints, PassRefPtr<MediaConstraints> videoConstraints);
-    virtual bool getMediaStreamTrackSources(PassRefPtr<MediaStreamTrackSourcesRequestClient>) override;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(MEDIA_STREAM)
-
-#endif // MediaStreamCenterMac_h

Copied: trunk/Source/WebCore/platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp (from rev 181368, trunk/Source/WebCore/platform/mediastream/mac/MediaStreamCenterMac.cpp) (0 => 181371)


--- trunk/Source/WebCore/platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp	                        (rev 0)
+++ trunk/Source/WebCore/platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp	2015-03-11 08:10:07 UTC (rev 181371)
@@ -0,0 +1,138 @@
+/*
+ * Copyright (C) 2013 Apple, 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.
+ * 3. Neither the name of Ericsson nor the names of its contributors
+ *    may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
+ * OWNER OR 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"
+
+#if ENABLE(MEDIA_STREAM)
+#include "RealtimeMediaSourceCenterMac.h"
+
+#include "AVCaptureDeviceManager.h"
+#include "MediaStreamCreationClient.h"
+#include "MediaStreamPrivate.h"
+#include "MediaStreamTrackSourcesRequestClient.h"
+#include <wtf/MainThread.h>
+
+namespace WebCore {
+
+RealtimeMediaSourceCenter& RealtimeMediaSourceCenter::platformCenter()
+{
+    ASSERT(isMainThread());
+    DEPRECATED_DEFINE_STATIC_LOCAL(RealtimeMediaSourceCenterMac, center, ());
+    return center;
+}
+
+RealtimeMediaSourceCenterMac::RealtimeMediaSourceCenterMac()
+{
+}
+
+RealtimeMediaSourceCenterMac::~RealtimeMediaSourceCenterMac()
+{
+}
+
+void RealtimeMediaSourceCenterMac::validateRequestConstraints(PassRefPtr<MediaStreamCreationClient> prpQueryClient, PassRefPtr<MediaConstraints> audioConstraints, PassRefPtr<MediaConstraints> videoConstraints)
+{
+    RefPtr<MediaStreamCreationClient> client = prpQueryClient;
+    
+    ASSERT(client);
+
+    if (audioConstraints) {
+        String invalidConstraint;
+        AVCaptureDeviceManager::singleton().verifyConstraintsForMediaType(RealtimeMediaSource::Audio, audioConstraints.get(), invalidConstraint);
+        if (!invalidConstraint.isEmpty()) {
+            client->constraintsInvalid(invalidConstraint);
+            return;
+        }
+    }
+
+    if (videoConstraints) {
+        String invalidConstraint;
+        AVCaptureDeviceManager::singleton().verifyConstraintsForMediaType(RealtimeMediaSource::Video, videoConstraints.get(), invalidConstraint);
+        if (!invalidConstraint.isEmpty()) {
+            client->constraintsInvalid(invalidConstraint);
+            return;
+        }
+    }
+
+    client->constraintsValidated();
+}
+    
+void RealtimeMediaSourceCenterMac::createMediaStream(PassRefPtr<MediaStreamCreationClient> prpQueryClient, PassRefPtr<MediaConstraints> audioConstraints, PassRefPtr<MediaConstraints> videoConstraints)
+{
+    RefPtr<MediaStreamCreationClient> client = prpQueryClient;
+    
+    ASSERT(client);
+    
+    Vector<RefPtr<RealtimeMediaSource>> audioSources;
+    Vector<RefPtr<RealtimeMediaSource>> videoSources;
+    
+    if (audioConstraints) {
+        String invalidConstraint;
+        AVCaptureDeviceManager::singleton().verifyConstraintsForMediaType(RealtimeMediaSource::Audio, audioConstraints.get(), invalidConstraint);
+        if (!invalidConstraint.isEmpty()) {
+            client->failedToCreateStreamWithConstraintsError(invalidConstraint);
+            return;
+        }
+        
+        RefPtr<RealtimeMediaSource> audioSource = AVCaptureDeviceManager::singleton().bestSourceForTypeAndConstraints(RealtimeMediaSource::Audio, audioConstraints.get());
+        ASSERT(audioSource);
+        
+        audioSources.append(audioSource.release());
+    }
+    
+    if (videoConstraints) {
+        String invalidConstraint;
+        AVCaptureDeviceManager::singleton().verifyConstraintsForMediaType(RealtimeMediaSource::Video, videoConstraints.get(), invalidConstraint);
+        if (!invalidConstraint.isEmpty()) {
+            client->failedToCreateStreamWithConstraintsError(invalidConstraint);
+            return;
+        }
+        
+        RefPtr<RealtimeMediaSource> videoSource = AVCaptureDeviceManager::singleton().bestSourceForTypeAndConstraints(RealtimeMediaSource::Video, videoConstraints.get());
+        ASSERT(videoSource);
+        
+        videoSources.append(videoSource.release());
+    }
+    
+    client->didCreateStream(MediaStreamPrivate::create(audioSources, videoSources));
+}
+
+bool RealtimeMediaSourceCenterMac::getMediaStreamTrackSources(PassRefPtr<MediaStreamTrackSourcesRequestClient> prpClient)
+{
+    RefPtr<MediaStreamTrackSourcesRequestClient> requestClient = prpClient;
+
+    Vector<RefPtr<TrackSourceInfo>> sources = AVCaptureDeviceManager::singleton().getSourcesInfo(requestClient->requestOrigin());
+
+    requestClient->didCompleteRequest(sources);
+    return true;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(MEDIA_STREAM)

Copied: trunk/Source/WebCore/platform/mediastream/mac/RealtimeMediaSourceCenterMac.h (from rev 181368, trunk/Source/WebCore/platform/mediastream/mac/MediaStreamCenterMac.h) (0 => 181371)


--- trunk/Source/WebCore/platform/mediastream/mac/RealtimeMediaSourceCenterMac.h	                        (rev 0)
+++ trunk/Source/WebCore/platform/mediastream/mac/RealtimeMediaSourceCenterMac.h	2015-03-11 08:10:07 UTC (rev 181371)
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2013 Apple, 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.
+ * 3. Neither the name of Ericsson nor the names of its contributors
+ *    may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
+ * OWNER OR 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 RealtimeMediaSourceCenterMac_h
+#define RealtimeMediaSourceCenterMac_h
+
+#if ENABLE(MEDIA_STREAM)
+
+#include "RealtimeMediaSource.h"
+#include "RealtimeMediaSourceCenter.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+class RealtimeMediaSourceCenterMac final : public RealtimeMediaSourceCenter {
+public:
+    RealtimeMediaSourceCenterMac();
+    ~RealtimeMediaSourceCenterMac();
+
+    virtual void validateRequestConstraints(PassRefPtr<MediaStreamCreationClient>, PassRefPtr<MediaConstraints> audioConstraints, PassRefPtr<MediaConstraints> videoConstraints);
+    virtual void createMediaStream(PassRefPtr<MediaStreamCreationClient>, PassRefPtr<MediaConstraints> audioConstraints, PassRefPtr<MediaConstraints> videoConstraints);
+    virtual bool getMediaStreamTrackSources(PassRefPtr<MediaStreamTrackSourcesRequestClient>) override;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(MEDIA_STREAM)
+
+#endif // RealtimeMediaSourceCenterMac_h

Deleted: trunk/Source/WebCore/platform/mock/MockMediaStreamCenter.cpp (181370 => 181371)


--- trunk/Source/WebCore/platform/mock/MockMediaStreamCenter.cpp	2015-03-11 07:45:26 UTC (rev 181370)
+++ trunk/Source/WebCore/platform/mock/MockMediaStreamCenter.cpp	2015-03-11 08:10:07 UTC (rev 181371)
@@ -1,220 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- * Copyright (C) 2013 Apple Inc.  All rights reserved.
- * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
- *
- * 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. ``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
- * 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"
-
-#if ENABLE(MEDIA_STREAM)
-
-#include "MockMediaStreamCenter.h"
-
-#include "MediaConstraintsMock.h"
-#include "MediaStream.h"
-#include "MediaStreamCreationClient.h"
-#include "MediaStreamPrivate.h"
-#include "MediaStreamTrack.h"
-#include "MediaStreamTrackSourcesRequestClient.h"
-#include "RealtimeMediaSource.h"
-#include "RealtimeMediaSourceCapabilities.h"
-#include <wtf/NeverDestroyed.h>
-
-namespace WebCore {
-
-class MockSource : public RealtimeMediaSource {
-public:
-    MockSource(const AtomicString& id, const AtomicString& name, RealtimeMediaSource::Type type)
-        : RealtimeMediaSource(id, type, name)
-    {
-    }
-
-    virtual ~MockSource() { }
-
-    virtual RefPtr<RealtimeMediaSourceCapabilities> capabilities() const { return m_capabilities; }
-    virtual const RealtimeMediaSourceStates& states() { return m_currentStates; }
-
-    RefPtr<RealtimeMediaSourceCapabilities> m_capabilities;
-    RealtimeMediaSourceStates m_currentStates;
-};
-    
-typedef HashMap<String, RefPtr<MockSource>> MockSourceMap;
-
-static MockSourceMap& mockSourceMap()
-{
-    DEPRECATED_DEFINE_STATIC_LOCAL(MockSourceMap, mockSourceMap, ());
-    return mockSourceMap;
-}
-
-static const AtomicString& mockAudioSourceID()
-{
-    static NeverDestroyed<AtomicString> id("239c24b1-2b15-11e3-8224-0800200c9a66", AtomicString::ConstructFromLiteral);
-    return id;
-}
-
-static const AtomicString& mockVideoSourceID()
-{
-    static NeverDestroyed<AtomicString> id("239c24b0-2b15-11e3-8224-0800200c9a66", AtomicString::ConstructFromLiteral);
-    return id;
-}
-
-static void initializeMockSources()
-{
-    RefPtr<MockSource> mockSource1 = adoptRef(new MockSource(mockVideoSourceID(), "Mock video device", RealtimeMediaSource::Video));
-    mockSource1->m_capabilities = RealtimeMediaSourceCapabilities::create();
-    mockSource1->m_capabilities->setSourceId(mockSource1->id());
-    mockSource1->m_capabilities->addSourceType(RealtimeMediaSourceStates::Camera);
-    mockSource1->m_capabilities->addSourceType(RealtimeMediaSourceStates::Microphone);
-    mockSource1->m_capabilities->addFacingMode(RealtimeMediaSourceStates::User);
-    mockSource1->m_capabilities->addFacingMode(RealtimeMediaSourceStates::Environment);
-    mockSource1->m_capabilities->setWidthRange(RealtimeMediaSourceCapabilityRange(320UL, 1920UL, true));
-    mockSource1->m_capabilities->setHeightRange(RealtimeMediaSourceCapabilityRange(240UL, 1080UL, true));
-    mockSource1->m_capabilities->setFrameRateRange(RealtimeMediaSourceCapabilityRange(15.0f, 60.0f, true));
-    mockSource1->m_capabilities->setAspectRatioRange(RealtimeMediaSourceCapabilityRange(4 / 3.0f, 16 / 9.0f, true));
-    mockSource1->m_capabilities->setVolumeRange(RealtimeMediaSourceCapabilityRange(10UL, 90UL, true));
-
-    mockSource1->m_currentStates.setSourceType(RealtimeMediaSourceStates::Camera);
-    mockSource1->m_currentStates.setSourceId(mockSource1->id());
-    mockSource1->m_currentStates.setFacingMode(RealtimeMediaSourceStates::User);
-    mockSource1->m_currentStates.setWidth(1920);
-    mockSource1->m_currentStates.setHeight(1080);
-    mockSource1->m_currentStates.setFrameRate(30);
-    mockSource1->m_currentStates.setAspectRatio(16 / 9.0f);
-    mockSource1->m_currentStates.setVolume(70);
-    String mockSource1id = mockSource1->id();
-    mockSourceMap().add(mockSource1id, mockSource1.release());
-
-    RefPtr<MockSource> mockSource2 = adoptRef(new MockSource(mockAudioSourceID(), "Mock audio device", RealtimeMediaSource::Audio));
-    mockSource2->m_capabilities = RealtimeMediaSourceCapabilities::create();
-    mockSource2->m_capabilities->setSourceId(mockSource2->id());
-    mockSource2->m_capabilities->setVolumeRange(RealtimeMediaSourceCapabilityRange(0UL, 100UL, true));
-
-    mockSource2->m_currentStates.setSourceType(RealtimeMediaSourceStates::Microphone);
-    mockSource2->m_currentStates.setSourceId(mockSource2->id());
-    mockSource2->m_currentStates.setVolume(50);
-    String mockSource2id = mockSource2->id();
-    mockSourceMap().add(mockSource2id, mockSource2.release());
-}
-
-void MockMediaStreamCenter::registerMockMediaStreamCenter()
-{
-    DEPRECATED_DEFINE_STATIC_LOCAL(MockMediaStreamCenter, center, ());
-    static bool registered = false;
-    if (!registered) {
-        registered = true;
-        MediaStreamCenter::setSharedStreamCenter(&center);
-        initializeMockSources();
-    }
-}
-
-void MockMediaStreamCenter::validateRequestConstraints(PassRefPtr<MediaStreamCreationClient> prpQueryClient, PassRefPtr<MediaConstraints> audioConstraints, PassRefPtr<MediaConstraints> videoConstraints)
-{
-    RefPtr<MediaStreamCreationClient> client = prpQueryClient;
-    
-    ASSERT(client);
-    
-    if (audioConstraints) {
-        String invalidQuery = MediaConstraintsMock::verifyConstraints(audioConstraints);
-        if (!invalidQuery.isEmpty()) {
-            client->constraintsInvalid(invalidQuery);
-            return;
-        }
-    }
-    
-    if (videoConstraints) {
-        String invalidQuery = MediaConstraintsMock::verifyConstraints(videoConstraints);
-        if (!invalidQuery.isEmpty()) {
-            client->constraintsInvalid(invalidQuery);
-            return;
-        }
-    }
-
-    client->constraintsValidated();
-}
-
-void MockMediaStreamCenter::createMediaStream(PassRefPtr<MediaStreamCreationClient> prpQueryClient, PassRefPtr<MediaConstraints> audioConstraints, PassRefPtr<MediaConstraints> videoConstraints)
-{
-    RefPtr<MediaStreamCreationClient> client = prpQueryClient;
-
-    ASSERT(client);
-    
-    Vector<RefPtr<RealtimeMediaSource>> audioSources;
-    Vector<RefPtr<RealtimeMediaSource>> videoSources;
-    MockSourceMap& map = mockSourceMap();
-
-    if (audioConstraints) {
-        String invalidQuery = MediaConstraintsMock::verifyConstraints(audioConstraints);
-        if (!invalidQuery.isEmpty()) {
-            client->failedToCreateStreamWithConstraintsError(invalidQuery);
-            return;
-        }
-
-        MockSourceMap::iterator it = map.find(mockAudioSourceID());
-        ASSERT(it != map.end());
-
-        RefPtr<RealtimeMediaSource> audioSource = it->value;
-        audioSource->reset();
-        audioSource->setReadyState(RealtimeMediaSource::Live);
-        audioSources.append(audioSource.release());
-    }
-
-    if (videoConstraints) {
-        String invalidQuery = MediaConstraintsMock::verifyConstraints(videoConstraints);
-        if (!invalidQuery.isEmpty()) {
-            client->failedToCreateStreamWithConstraintsError(invalidQuery);
-            return;
-        }
-
-        MockSourceMap::iterator it = map.find(mockVideoSourceID());
-        ASSERT(it != map.end());
-
-        RefPtr<RealtimeMediaSource> videoSource = it->value;
-        videoSource->reset();
-        videoSource->setReadyState(RealtimeMediaSource::Live);
-        videoSources.append(videoSource.release());
-    }
-    
-    client->didCreateStream(MediaStreamPrivate::create(audioSources, videoSources));
-}
-
-bool MockMediaStreamCenter::getMediaStreamTrackSources(PassRefPtr<MediaStreamTrackSourcesRequestClient> prpClient)
-{
-    RefPtr<MediaStreamTrackSourcesRequestClient> requestClient = prpClient;
-    Vector<RefPtr<TrackSourceInfo>> sources;
-
-    MockSourceMap& map = mockSourceMap();
-    MockSourceMap::iterator end = map.end();
-    for (MockSourceMap::iterator it = map.begin(); it != end; ++it) {
-        MockSource* source = it->value.get();
-
-        sources.append(TrackSourceInfo::create(source->id(), source->type() == RealtimeMediaSource::Video ? TrackSourceInfo::Video : TrackSourceInfo::Audio, source->name()));
-    }
-
-    requestClient->didCompleteRequest(sources);
-    return true;
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(MEDIA_STREAM)

Deleted: trunk/Source/WebCore/platform/mock/MockMediaStreamCenter.h (181370 => 181371)


--- trunk/Source/WebCore/platform/mock/MockMediaStreamCenter.h	2015-03-11 07:45:26 UTC (rev 181370)
+++ trunk/Source/WebCore/platform/mock/MockMediaStreamCenter.h	2015-03-11 08:10:07 UTC (rev 181371)
@@ -1,52 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- * Copyright (C) 2013 Apple 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. ``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
- * 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 MockMediaStreamCenter_h
-#define MockMediaStreamCenter_h
-
-#if ENABLE(MEDIA_STREAM)
-
-#include "MediaStreamCenter.h"
-
-namespace WebCore {
-
-class MockMediaStreamCenter final : public MediaStreamCenter {
-public:
-    WEBCORE_EXPORT static void registerMockMediaStreamCenter();
-
-    virtual void validateRequestConstraints(PassRefPtr<MediaStreamCreationClient>, PassRefPtr<MediaConstraints> audioConstraints, PassRefPtr<MediaConstraints> videoConstraints);
-    virtual void createMediaStream(PassRefPtr<MediaStreamCreationClient>, PassRefPtr<MediaConstraints> audioConstraints, PassRefPtr<MediaConstraints> videoConstraints);
-    virtual bool getMediaStreamTrackSources(PassRefPtr<MediaStreamTrackSourcesRequestClient>) override;
-
-private:
-    MockMediaStreamCenter() { }
-};
-
-}
-
-#endif // MockMediaStreamCenter_h
-
-#endif

Copied: trunk/Source/WebCore/platform/mock/MockRealtimeMediaSourceCenter.cpp (from rev 181368, trunk/Source/WebCore/platform/mock/MockMediaStreamCenter.cpp) (0 => 181371)


--- trunk/Source/WebCore/platform/mock/MockRealtimeMediaSourceCenter.cpp	                        (rev 0)
+++ trunk/Source/WebCore/platform/mock/MockRealtimeMediaSourceCenter.cpp	2015-03-11 08:10:07 UTC (rev 181371)
@@ -0,0 +1,219 @@
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013 Apple Inc.  All rights reserved.
+ * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * 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. ``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
+ * 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"
+
+#if ENABLE(MEDIA_STREAM)
+#include "MockRealtimeMediaSourceCenter.h"
+
+#include "MediaConstraintsMock.h"
+#include "MediaStream.h"
+#include "MediaStreamCreationClient.h"
+#include "MediaStreamPrivate.h"
+#include "MediaStreamTrack.h"
+#include "MediaStreamTrackSourcesRequestClient.h"
+#include "RealtimeMediaSource.h"
+#include "RealtimeMediaSourceCapabilities.h"
+#include <wtf/NeverDestroyed.h>
+
+namespace WebCore {
+
+class MockSource : public RealtimeMediaSource {
+public:
+    MockSource(const AtomicString& id, const AtomicString& name, RealtimeMediaSource::Type type)
+        : RealtimeMediaSource(id, type, name)
+    {
+    }
+
+    virtual ~MockSource() { }
+
+    virtual RefPtr<RealtimeMediaSourceCapabilities> capabilities() const { return m_capabilities; }
+    virtual const RealtimeMediaSourceStates& states() { return m_currentStates; }
+
+    RefPtr<RealtimeMediaSourceCapabilities> m_capabilities;
+    RealtimeMediaSourceStates m_currentStates;
+};
+    
+typedef HashMap<String, RefPtr<MockSource>> MockSourceMap;
+
+static MockSourceMap& mockSourceMap()
+{
+    DEPRECATED_DEFINE_STATIC_LOCAL(MockSourceMap, mockSourceMap, ());
+    return mockSourceMap;
+}
+
+static const AtomicString& mockAudioSourceID()
+{
+    static NeverDestroyed<AtomicString> id("239c24b1-2b15-11e3-8224-0800200c9a66", AtomicString::ConstructFromLiteral);
+    return id;
+}
+
+static const AtomicString& mockVideoSourceID()
+{
+    static NeverDestroyed<AtomicString> id("239c24b0-2b15-11e3-8224-0800200c9a66", AtomicString::ConstructFromLiteral);
+    return id;
+}
+
+static void initializeMockSources()
+{
+    RefPtr<MockSource> mockSource1 = adoptRef(new MockSource(mockVideoSourceID(), "Mock video device", RealtimeMediaSource::Video));
+    mockSource1->m_capabilities = RealtimeMediaSourceCapabilities::create();
+    mockSource1->m_capabilities->setSourceId(mockSource1->id());
+    mockSource1->m_capabilities->addSourceType(RealtimeMediaSourceStates::Camera);
+    mockSource1->m_capabilities->addSourceType(RealtimeMediaSourceStates::Microphone);
+    mockSource1->m_capabilities->addFacingMode(RealtimeMediaSourceStates::User);
+    mockSource1->m_capabilities->addFacingMode(RealtimeMediaSourceStates::Environment);
+    mockSource1->m_capabilities->setWidthRange(RealtimeMediaSourceCapabilityRange(320UL, 1920UL, true));
+    mockSource1->m_capabilities->setHeightRange(RealtimeMediaSourceCapabilityRange(240UL, 1080UL, true));
+    mockSource1->m_capabilities->setFrameRateRange(RealtimeMediaSourceCapabilityRange(15.0f, 60.0f, true));
+    mockSource1->m_capabilities->setAspectRatioRange(RealtimeMediaSourceCapabilityRange(4 / 3.0f, 16 / 9.0f, true));
+    mockSource1->m_capabilities->setVolumeRange(RealtimeMediaSourceCapabilityRange(10UL, 90UL, true));
+
+    mockSource1->m_currentStates.setSourceType(RealtimeMediaSourceStates::Camera);
+    mockSource1->m_currentStates.setSourceId(mockSource1->id());
+    mockSource1->m_currentStates.setFacingMode(RealtimeMediaSourceStates::User);
+    mockSource1->m_currentStates.setWidth(1920);
+    mockSource1->m_currentStates.setHeight(1080);
+    mockSource1->m_currentStates.setFrameRate(30);
+    mockSource1->m_currentStates.setAspectRatio(16 / 9.0f);
+    mockSource1->m_currentStates.setVolume(70);
+    String mockSource1id = mockSource1->id();
+    mockSourceMap().add(mockSource1id, mockSource1.release());
+
+    RefPtr<MockSource> mockSource2 = adoptRef(new MockSource(mockAudioSourceID(), "Mock audio device", RealtimeMediaSource::Audio));
+    mockSource2->m_capabilities = RealtimeMediaSourceCapabilities::create();
+    mockSource2->m_capabilities->setSourceId(mockSource2->id());
+    mockSource2->m_capabilities->setVolumeRange(RealtimeMediaSourceCapabilityRange(0UL, 100UL, true));
+
+    mockSource2->m_currentStates.setSourceType(RealtimeMediaSourceStates::Microphone);
+    mockSource2->m_currentStates.setSourceId(mockSource2->id());
+    mockSource2->m_currentStates.setVolume(50);
+    String mockSource2id = mockSource2->id();
+    mockSourceMap().add(mockSource2id, mockSource2.release());
+}
+
+void MockRealtimeMediaSourceCenter::registerMockRealtimeMediaSourceCenter()
+{
+    DEPRECATED_DEFINE_STATIC_LOCAL(MockRealtimeMediaSourceCenter, center, ());
+    static bool registered = false;
+    if (!registered) {
+        registered = true;
+        RealtimeMediaSourceCenter::setSharedStreamCenter(&center);
+        initializeMockSources();
+    }
+}
+
+void MockRealtimeMediaSourceCenter::validateRequestConstraints(PassRefPtr<MediaStreamCreationClient> prpQueryClient, PassRefPtr<MediaConstraints> audioConstraints, PassRefPtr<MediaConstraints> videoConstraints)
+{
+    RefPtr<MediaStreamCreationClient> client = prpQueryClient;
+    
+    ASSERT(client);
+    
+    if (audioConstraints) {
+        String invalidQuery = MediaConstraintsMock::verifyConstraints(audioConstraints);
+        if (!invalidQuery.isEmpty()) {
+            client->constraintsInvalid(invalidQuery);
+            return;
+        }
+    }
+    
+    if (videoConstraints) {
+        String invalidQuery = MediaConstraintsMock::verifyConstraints(videoConstraints);
+        if (!invalidQuery.isEmpty()) {
+            client->constraintsInvalid(invalidQuery);
+            return;
+        }
+    }
+
+    client->constraintsValidated();
+}
+
+void MockRealtimeMediaSourceCenter::createMediaStream(PassRefPtr<MediaStreamCreationClient> prpQueryClient, PassRefPtr<MediaConstraints> audioConstraints, PassRefPtr<MediaConstraints> videoConstraints)
+{
+    RefPtr<MediaStreamCreationClient> client = prpQueryClient;
+
+    ASSERT(client);
+    
+    Vector<RefPtr<RealtimeMediaSource>> audioSources;
+    Vector<RefPtr<RealtimeMediaSource>> videoSources;
+    MockSourceMap& map = mockSourceMap();
+
+    if (audioConstraints) {
+        String invalidQuery = MediaConstraintsMock::verifyConstraints(audioConstraints);
+        if (!invalidQuery.isEmpty()) {
+            client->failedToCreateStreamWithConstraintsError(invalidQuery);
+            return;
+        }
+
+        MockSourceMap::iterator it = map.find(mockAudioSourceID());
+        ASSERT(it != map.end());
+
+        RefPtr<RealtimeMediaSource> audioSource = it->value;
+        audioSource->reset();
+        audioSource->setReadyState(RealtimeMediaSource::Live);
+        audioSources.append(audioSource.release());
+    }
+
+    if (videoConstraints) {
+        String invalidQuery = MediaConstraintsMock::verifyConstraints(videoConstraints);
+        if (!invalidQuery.isEmpty()) {
+            client->failedToCreateStreamWithConstraintsError(invalidQuery);
+            return;
+        }
+
+        MockSourceMap::iterator it = map.find(mockVideoSourceID());
+        ASSERT(it != map.end());
+
+        RefPtr<RealtimeMediaSource> videoSource = it->value;
+        videoSource->reset();
+        videoSource->setReadyState(RealtimeMediaSource::Live);
+        videoSources.append(videoSource.release());
+    }
+    
+    client->didCreateStream(MediaStreamPrivate::create(audioSources, videoSources));
+}
+
+bool MockRealtimeMediaSourceCenter::getMediaStreamTrackSources(PassRefPtr<MediaStreamTrackSourcesRequestClient> prpClient)
+{
+    RefPtr<MediaStreamTrackSourcesRequestClient> requestClient = prpClient;
+    Vector<RefPtr<TrackSourceInfo>> sources;
+
+    MockSourceMap& map = mockSourceMap();
+    MockSourceMap::iterator end = map.end();
+    for (MockSourceMap::iterator it = map.begin(); it != end; ++it) {
+        MockSource* source = it->value.get();
+
+        sources.append(TrackSourceInfo::create(source->id(), source->type() == RealtimeMediaSource::Video ? TrackSourceInfo::Video : TrackSourceInfo::Audio, source->name()));
+    }
+
+    requestClient->didCompleteRequest(sources);
+    return true;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(MEDIA_STREAM)

Copied: trunk/Source/WebCore/platform/mock/MockRealtimeMediaSourceCenter.h (from rev 181368, trunk/Source/WebCore/platform/mock/MockMediaStreamCenter.h) (0 => 181371)


--- trunk/Source/WebCore/platform/mock/MockRealtimeMediaSourceCenter.h	                        (rev 0)
+++ trunk/Source/WebCore/platform/mock/MockRealtimeMediaSourceCenter.h	2015-03-11 08:10:07 UTC (rev 181371)
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013 Apple 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. ``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
+ * 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 MockRealtimeMediaSourceCenter_h
+#define MockRealtimeMediaSourceCenter_h
+
+#if ENABLE(MEDIA_STREAM)
+
+#include "RealtimeMediaSourceCenter.h"
+
+namespace WebCore {
+
+class MockRealtimeMediaSourceCenter final : public RealtimeMediaSourceCenter {
+public:
+    WEBCORE_EXPORT static void registerMockRealtimeMediaSourceCenter();
+
+    virtual void validateRequestConstraints(PassRefPtr<MediaStreamCreationClient>, PassRefPtr<MediaConstraints> audioConstraints, PassRefPtr<MediaConstraints> videoConstraints);
+    virtual void createMediaStream(PassRefPtr<MediaStreamCreationClient>, PassRefPtr<MediaConstraints> audioConstraints, PassRefPtr<MediaConstraints> videoConstraints);
+    virtual bool getMediaStreamTrackSources(PassRefPtr<MediaStreamTrackSourcesRequestClient>) override;
+
+private:
+    MockRealtimeMediaSourceCenter() { }
+};
+
+}
+
+#endif // MockRealtimeMediaSourceCenter_h
+
+#endif

Modified: trunk/Source/WebCore/testing/Internals.cpp (181370 => 181371)


--- trunk/Source/WebCore/testing/Internals.cpp	2015-03-11 07:45:26 UTC (rev 181370)
+++ trunk/Source/WebCore/testing/Internals.cpp	2015-03-11 08:10:07 UTC (rev 181371)
@@ -161,7 +161,7 @@
 #endif
 
 #if ENABLE(MEDIA_STREAM)
-#include "MockMediaStreamCenter.h"
+#include "MockRealtimeMediaSourceCenter.h"
 #include "RTCPeerConnection.h"
 #include "RTCPeerConnectionHandlerMock.h"
 #include "UserMediaClientMock.h"
@@ -333,7 +333,7 @@
 #endif
 
 #if ENABLE(MEDIA_STREAM)
-    MockMediaStreamCenter::registerMockMediaStreamCenter();
+    MockRealtimeMediaSourceCenter::registerMockRealtimeMediaSourceCenter();
     enableMockRTCPeerConnectionHandler();
     WebCore::provideUserMediaTo(document->page(), new UserMediaClientMock());
 #endif
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to