[MediaStream] Finish implementing MediaDevices.enumerateDevices
authoreric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Sep 2015 21:05:37 +0000 (21:05 +0000)
committereric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Sep 2015 21:05:37 +0000 (21:05 +0000)
commit8e6edd6d471b7aaac7a0eabb7125eb157fc3472b
tree3c7feefa5650729b98beadda8f613f7f6f76394b
parenta5194eff58b277f4a2119981dea99591bfe872f8
[MediaStream] Finish implementing MediaDevices.enumerateDevices
https://bugs.webkit.org/show_bug.cgi?id=149322
<rdar://problem/22750866>

Reviewed by Brent Fulgham.

Source/WebCore:

Test: fast/mediastream/MediaDevices-enumerateDevices.html

* CMakeLists.txt: Add MediaDevicesRequest.cpp

* Modules/mediastream/MediaDeviceInfo.h: Add MediaDeviceInfoVector typedef.

* Modules/mediastream/MediaDevices.cpp:
(WebCore::MediaDevices::enumerateDevices): Use MediaDevicesRequest.
* Modules/mediastream/MediaDevices.h: EnumerateDevicePromise -> EnumerateDevicesPromise.
* Modules/mediastream/MediaDevices.idl:

* Modules/mediastream/MediaDevicesRequest.cpp: Added.
(WebCore::MediaDevicesRequest::create):
(WebCore::MediaDevicesRequest::MediaDevicesRequest):
(WebCore::MediaDevicesRequest::~MediaDevicesRequest):
(WebCore::MediaDevicesRequest::securityOrigin):
(WebCore::MediaDevicesRequest::contextDestroyed):
(WebCore::MediaDevicesRequest::start):
(WebCore::MediaDevicesRequest::didCompleteRequest):
(WebCore::MediaDevicesRequest::requestOrigin):
* Modules/mediastream/MediaDevicesRequest.h: Added.

* Modules/mediastream/MediaStreamTrackSourcesRequest.cpp:
(WebCore::MediaStreamTrackSourcesRequest::MediaStreamTrackSourcesRequest):
(WebCore::MediaStreamTrackSourcesRequest::didCompleteRequest):
* Modules/mediastream/MediaStreamTrackSourcesRequest.h:

* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::enumerateDevices): Deleted.
* Modules/mediastream/UserMediaRequest.h:

* WebCore.xcodeproj/project.pbxproj: Add MediaDevicesRequest.cpp

* platform/mediastream/MediaDevicesPrivate.cpp: Removed.
* platform/mediastream/MediaDevicesPrivate.h: Removed.

* platform/mediastream/MediaStreamCreationClient.h:
* platform/mediastream/MediaStreamTrackSourcesRequestClient.h:
(WebCore::MediaStreamTrackSourcesRequestClient::~MediaStreamTrackSourcesRequestClient):

* platform/mediastream/mac/AVCaptureDeviceManager.h:
* platform/mediastream/mac/AVCaptureDeviceManager.mm:
(WebCore::AVCaptureDeviceManager::verifyConstraintsForMediaType): Optionally take an
  AVCaptureSession instead of always allocating one.
(WebCore::AVCaptureDeviceManager::bestSourcesForTypeAndConstraints): Pass the AVCaptureSession
  to verifyConstraintsForMediaType.

* platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
(WebCore::RealtimeMediaSourceCenterMac::getMediaStreamTrackSources):

* platform/mock/MockRealtimeMediaSourceCenter.cpp:
(WebCore::MockRealtimeMediaSourceCenter::getMediaStreamTrackSources):

LayoutTests:

* fast/mediastream/MediaDevices-enumerateDevices-expected.txt: Added.
* fast/mediastream/MediaDevices-enumerateDevices.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@189982 268f45cc-cd09-0410-ab3c-d52691b4dbfc
23 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/mediastream/MediaDevices-enumerateDevices-expected.txt [new file with mode: 0644]
LayoutTests/fast/mediastream/MediaDevices-enumerateDevices.html [new file with mode: 0644]
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediastream/MediaDeviceInfo.h
Source/WebCore/Modules/mediastream/MediaDevices.cpp
Source/WebCore/Modules/mediastream/MediaDevices.h
Source/WebCore/Modules/mediastream/MediaDevices.idl
Source/WebCore/Modules/mediastream/MediaDevicesRequest.cpp [new file with mode: 0644]
Source/WebCore/Modules/mediastream/MediaDevicesRequest.h [moved from Source/WebCore/platform/mediastream/MediaDevicesPrivate.h with 56% similarity]
Source/WebCore/Modules/mediastream/MediaStreamTrackSourcesRequest.cpp
Source/WebCore/Modules/mediastream/MediaStreamTrackSourcesRequest.h
Source/WebCore/Modules/mediastream/UserMediaRequest.cpp
Source/WebCore/Modules/mediastream/UserMediaRequest.h
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/platform/mediastream/MediaDevicesPrivate.cpp [deleted file]
Source/WebCore/platform/mediastream/MediaStreamCreationClient.h
Source/WebCore/platform/mediastream/MediaStreamTrackSourcesRequestClient.h
Source/WebCore/platform/mediastream/mac/AVCaptureDeviceManager.h
Source/WebCore/platform/mediastream/mac/AVCaptureDeviceManager.mm
Source/WebCore/platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp
Source/WebCore/platform/mock/MockRealtimeMediaSourceCenter.cpp