[MediaStream] RealtimeMediaSource should be able to vend hashed IDs
authoreric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 Oct 2018 17:20:20 +0000 (17:20 +0000)
committereric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 Oct 2018 17:20:20 +0000 (17:20 +0000)
commit1e5ca37e47aabe6d7fdbe1afa5aadfc31b3e1f57
treeda8cdcb3159a65c9cc375b8deef42b092bcf7d67
parent07daa5f5303603da00aae85d68253d22f91f5419
[MediaStream] RealtimeMediaSource should be able to vend hashed IDs
https://bugs.webkit.org/show_bug.cgi?id=190142
<rdar://problem/44911109>

Reviewed by Youenn Fablet.

Source/WebCore:

No new tests, covered by existing tests.

* Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
(WebCore::CanvasCaptureMediaStreamTrack::Source::Source): Update order of parameters passed
to base class.

* Modules/mediastream/MediaDevicesRequest.cpp:
(WebCore::MediaDevicesRequest::start): ASSERT if document.deviceIDHashSalt is not the same
as passed salt.

* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::getSettings const): Don't need to hash ID.
(WebCore::MediaStreamTrack::getCapabilities const): Ditto.
* Modules/mediastream/MediaStreamTrack.h:
* Modules/mediastream/MediaStreamTrack.idl:

* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::allow): Pass hash salt to createMediaStream.

* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::LibWebRTCPeerConnectionBackend::createReceiverForSource): Update order of parameters passed
to base class.

* Modules/webaudio/MediaStreamAudioSource.cpp:
(WebCore::MediaStreamAudioSource::MediaStreamAudioSource): Ditto.
* platform/mediastream/MediaConstraints.h:

* platform/mediastream/RealtimeIncomingAudioSource.cpp:
(WebCore::RealtimeIncomingAudioSource::RealtimeIncomingAudioSource): Ditto.

* platform/mediastream/RealtimeIncomingVideoSource.cpp:
(WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource): Ditto.

* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::RealtimeMediaSource): Calculate hashed ID.
(WebCore::RealtimeMediaSource::selectSettings): Use m_hashedID.
(WebCore::RealtimeMediaSource::hashedId const): New.
(WebCore::RealtimeMediaSource::deviceIDHashSalt const): New.
* platform/mediastream/RealtimeMediaSource.h:

* platform/mediastream/RealtimeMediaSourceCenter.cpp:
(WebCore::RealtimeMediaSourceCenter::createMediaStream): Take hash salt, pass it when creating
a source.
(WebCore::RealtimeMediaSourceCenter::getUserMediaDevices): Ditto.
(WebCore::RealtimeMediaSourceCenter::validateRequestConstraints): Ditto.
* platform/mediastream/RealtimeMediaSourceCenter.h:

* platform/mediastream/RealtimeMediaSourceFactory.h:
* platform/mediastream/RealtimeVideoSource.cpp:
(WebCore::RealtimeVideoSource::RealtimeVideoSource): Update parameters.
* platform/mediastream/RealtimeVideoSource.h:

* platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp:
(WebCore::GStreamerAudioCaptureSource::create): Ditto.
(WebCore::GStreamerAudioCaptureSource::GStreamerAudioCaptureSource): Ditto.
* platform/mediastream/gstreamer/GStreamerAudioCaptureSource.h:

* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
(WebCore::GStreamerVideoCaptureSource::create): Ditto.
(WebCore::GStreamerVideoCaptureSource::GStreamerVideoCaptureSource): Ditto.
* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h:

* platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp:
(WebCore::WrappedMockRealtimeAudioSource::WrappedMockRealtimeAudioSource): Ditto.
(WebCore::MockRealtimeAudioSource::create): Ditto.
(WebCore::MockGStreamerAudioCaptureSource::MockGStreamerAudioCaptureSource): Ditto.
* platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.h:

* platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.cpp:
(WebCore::MockRealtimeVideoSource::create): Ditto.
(WebCore::MockGStreamerVideoCaptureSource::MockGStreamerVideoCaptureSource): Ditto.
* platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.h:

* platform/mediastream/mac/AVVideoCaptureSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::create): Ditto.
(WebCore::AVVideoCaptureSource::AVVideoCaptureSource): Ditto.
(WebCore::AVVideoCaptureSource::settings): Use hashedId to set device ID.
(WebCore::AVVideoCaptureSource::capabilities): Ditto.

* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioCaptureSource::create): Update parameters.
(WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource): Ditto.
(WebCore::CoreAudioCaptureSource::capabilities): Use hashedId to set device ID.
(WebCore::CoreAudioCaptureSource::settings): Ditto.
* platform/mediastream/mac/CoreAudioCaptureSource.h:

* platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
(WebCore::DisplayCaptureSourceCocoa::DisplayCaptureSourceCocoa): Update parameters.
* platform/mediastream/mac/DisplayCaptureSourceCocoa.h:

* platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
* platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
(WebCore::MockRealtimeAudioSource::create): Ditto.
(WebCore::MockRealtimeAudioSourceMac::MockRealtimeAudioSourceMac): Ditto.

* platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
* platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
(WebCore::MockRealtimeVideoSource::create): Ditto.
(WebCore::MockRealtimeVideoSourceMac::MockRealtimeVideoSourceMac): Ditto.

* platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:

* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
(WebCore::ScreenDisplayCaptureSourceMac::create): Ditto.
(WebCore::ScreenDisplayCaptureSourceMac::ScreenDisplayCaptureSourceMac): Ditto.
(WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream): Update logging.
(WebCore::ScreenDisplayCaptureSourceMac::startDisplayStream): Ditto.
(WebCore::ScreenDisplayCaptureSourceMac::frameAvailable): Ditto.

* platform/mediastream/mac/WindowDisplayCaptureSourceMac.h:
* platform/mediastream/mac/WindowDisplayCaptureSourceMac.mm:
(WebCore::WindowDisplayCaptureSourceMac::create): Update parameters.

* platform/mock/MockRealtimeAudioSource.cpp:
(WebCore::MockRealtimeAudioSource::create): Ditto.
(WebCore::MockRealtimeAudioSource::MockRealtimeAudioSource): Ditto.
(WebCore::MockRealtimeAudioSource::settings): Use hashedId to set device ID.
(WebCore::MockRealtimeAudioSource::capabilities): Ditto.
* platform/mock/MockRealtimeAudioSource.h:

* platform/mock/MockRealtimeMediaSourceCenter.cpp:

* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::create): Update parameters.
(WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource): Ditto.
(WebCore::MockRealtimeVideoSource::capabilities): Use hashedId to set device ID.
(WebCore::MockRealtimeVideoSource::settings): Ditto.
* platform/mock/MockRealtimeVideoSource.h:

Source/WebKit:

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<MediaConstraints>::encode):
(IPC::ArgumentCoder<MediaConstraints>::decode):
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
(WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
* WebProcess/cocoa/UserMediaCaptureManager.cpp:
(WebKit::UserMediaCaptureManager::Source::Source):
(WebKit::UserMediaCaptureManager::createCaptureSource):
* WebProcess/cocoa/UserMediaCaptureManager.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236877 268f45cc-cd09-0410-ab3c-d52691b4dbfc
58 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp
Source/WebCore/Modules/mediastream/MediaDevicesRequest.cpp
Source/WebCore/Modules/mediastream/MediaStreamTrack.cpp
Source/WebCore/Modules/mediastream/MediaStreamTrack.h
Source/WebCore/Modules/mediastream/MediaStreamTrack.idl
Source/WebCore/Modules/mediastream/UserMediaRequest.cpp
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp
Source/WebCore/Modules/webaudio/MediaStreamAudioSource.cpp
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Document.h
Source/WebCore/platform/mediastream/MediaConstraints.h
Source/WebCore/platform/mediastream/RealtimeIncomingAudioSource.cpp
Source/WebCore/platform/mediastream/RealtimeIncomingVideoSource.cpp
Source/WebCore/platform/mediastream/RealtimeMediaSource.cpp
Source/WebCore/platform/mediastream/RealtimeMediaSource.h
Source/WebCore/platform/mediastream/RealtimeMediaSourceCenter.cpp
Source/WebCore/platform/mediastream/RealtimeMediaSourceCenter.h
Source/WebCore/platform/mediastream/RealtimeMediaSourceFactory.cpp
Source/WebCore/platform/mediastream/RealtimeMediaSourceFactory.h
Source/WebCore/platform/mediastream/RealtimeVideoSource.cpp
Source/WebCore/platform/mediastream/RealtimeVideoSource.h
Source/WebCore/platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp
Source/WebCore/platform/mediastream/gstreamer/GStreamerAudioCaptureSource.h
Source/WebCore/platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp
Source/WebCore/platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h
Source/WebCore/platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp
Source/WebCore/platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.h
Source/WebCore/platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.cpp
Source/WebCore/platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.h
Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.h
Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm
Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.cpp
Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.h
Source/WebCore/platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp
Source/WebCore/platform/mediastream/mac/DisplayCaptureSourceCocoa.h
Source/WebCore/platform/mediastream/mac/MockRealtimeAudioSourceMac.h
Source/WebCore/platform/mediastream/mac/MockRealtimeAudioSourceMac.mm
Source/WebCore/platform/mediastream/mac/MockRealtimeVideoSourceMac.h
Source/WebCore/platform/mediastream/mac/MockRealtimeVideoSourceMac.mm
Source/WebCore/platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp
Source/WebCore/platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h
Source/WebCore/platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm
Source/WebCore/platform/mediastream/mac/WindowDisplayCaptureSourceMac.h
Source/WebCore/platform/mediastream/mac/WindowDisplayCaptureSourceMac.mm
Source/WebCore/platform/mock/MockRealtimeAudioSource.cpp
Source/WebCore/platform/mock/MockRealtimeAudioSource.h
Source/WebCore/platform/mock/MockRealtimeMediaSourceCenter.cpp
Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp
Source/WebCore/platform/mock/MockRealtimeVideoSource.h
Source/WebKit/ChangeLog
Source/WebKit/Shared/WebCoreArgumentCoders.cpp
Source/WebKit/UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp
Source/WebKit/UIProcess/Cocoa/UserMediaCaptureManagerProxy.h
Source/WebKit/UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in
Source/WebKit/UIProcess/UserMediaPermissionRequestManagerProxy.cpp
Source/WebKit/WebProcess/cocoa/UserMediaCaptureManager.cpp
Source/WebKit/WebProcess/cocoa/UserMediaCaptureManager.h