• tommyw@google.com's avatar
    MediaStream API: Add the async createOffer functionality to RTCPeerConnection · ee34ed92
    tommyw@google.com authored
    https://bugs.webkit.org/show_bug.cgi?id=95734
    
    Reviewed by Adam Barth.
    
    Source/Platform:
    
    * Platform.gypi:
    * chromium/public/WebRTCPeerConnectionHandler.h:
    (WebKit):
    (WebRTCPeerConnectionHandler):
    * chromium/public/WebRTCSessionDescriptionDescriptor.h: Added.
    (WebCore):
    (WebKit):
    (WebRTCSessionDescriptionDescriptor):
    (WebKit::WebRTCSessionDescriptionDescriptor::WebRTCSessionDescriptionDescriptor):
    (WebKit::WebRTCSessionDescriptionDescriptor::~WebRTCSessionDescriptionDescriptor):
    (WebKit::WebRTCSessionDescriptionDescriptor::operator=):
    (WebKit::WebRTCSessionDescriptionDescriptor::isNull):
    * chromium/public/WebRTCSessionDescriptionRequest.h: Added.
    (WebCore):
    (WebKit):
    (WebRTCSessionDescriptionRequest):
    (ExtraData):
    (WebKit::WebRTCSessionDescriptionRequest::ExtraData::~ExtraData):
    (WebKit::WebRTCSessionDescriptionRequest::WebRTCSessionDescriptionRequest):
    (WebKit::WebRTCSessionDescriptionRequest::~WebRTCSessionDescriptionRequest):
    (WebKit::WebRTCSessionDescriptionRequest::operator=):
    (WebKit::WebRTCSessionDescriptionRequest::isNull):
    
    Source/WebCore:
    
    createOffer sends a request to the platform implementer requesting it to gather up all candidates.
    This can take some time, therefore the request is async.
    
    Test: fast/mediastream/RTCPeerConnection-createOffer.html
    
    * CMakeLists.txt:
    * GNUmakefile.list.am:
    * Modules/mediastream/RTCErrorCallback.h: Copied from Source/WebCore/platform/mediastream/RTCSessionDescriptionDescriptor.h.
    (WebCore):
    (RTCErrorCallback):
    (WebCore::RTCErrorCallback::~RTCErrorCallback):
    * Modules/mediastream/RTCErrorCallback.idl: Copied from Source/WebCore/platform/mediastream/RTCSessionDescriptionDescriptor.h.
    * Modules/mediastream/RTCPeerConnection.cpp:
    (WebCore::RTCPeerConnection::createOffer):
    (WebCore):
    * Modules/mediastream/RTCPeerConnection.h:
    (WebCore):
    (RTCPeerConnection):
    * Modules/mediastream/RTCPeerConnection.idl:
    * Modules/mediastream/RTCSessionDescriptionCallback.h: Copied from Source/WebCore/platform/mediastream/RTCSessionDescriptionDescriptor.h.
    (WebCore):
    (RTCSessionDescriptionCallback):
    (WebCore::RTCSessionDescriptionCallback::~RTCSessionDescriptionCallback):
    * Modules/mediastream/RTCSessionDescriptionCallback.idl: Copied from Source/WebCore/platform/mediastream/RTCSessionDescriptionDescriptor.h.
    * Modules/mediastream/RTCSessionDescriptionRequestImpl.cpp: Added.
    (WebCore):
    (WebCore::RTCSessionDescriptionRequestImpl::create):
    (WebCore::RTCSessionDescriptionRequestImpl::RTCSessionDescriptionRequestImpl):
    (WebCore::RTCSessionDescriptionRequestImpl::~RTCSessionDescriptionRequestImpl):
    (WebCore::RTCSessionDescriptionRequestImpl::requestSucceeded):
    (WebCore::RTCSessionDescriptionRequestImpl::requestFailed):
    (WebCore::RTCSessionDescriptionRequestImpl::stop):
    (WebCore::RTCSessionDescriptionRequestImpl::clear):
    * Modules/mediastream/RTCSessionDescriptionRequestImpl.h: Copied from Source/WebCore/platform/mediastream/RTCSessionDescriptionDescriptor.h.
    (WebCore):
    (RTCSessionDescriptionRequestImpl):
    * WebCore.gypi:
    * platform/chromium/support/WebRTCSessionDescriptionDescriptor.cpp: Copied from Tools/DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.h.
    (WebKit):
    (WebKit::WebRTCSessionDescriptionDescriptor::WebRTCSessionDescriptionDescriptor):
    (WebKit::WebRTCSessionDescriptionDescriptor::assign):
    (WebKit::WebRTCSessionDescriptionDescriptor::reset):
    (WebKit::WebRTCSessionDescriptionDescriptor::operator WTF::PassRefPtr<WebCore::RTCSessionDescriptionDescriptor>):
    (WebKit::WebRTCSessionDescriptionDescriptor::initialize):
    (WebKit::WebRTCSessionDescriptionDescriptor::type):
    (WebKit::WebRTCSessionDescriptionDescriptor::setType):
    (WebKit::WebRTCSessionDescriptionDescriptor::sdp):
    (WebKit::WebRTCSessionDescriptionDescriptor::setSDP):
    * platform/chromium/support/WebRTCSessionDescriptionRequest.cpp: Added.
    (WebKit):
    (WebKit::WebRTCSessionDescriptionRequest::WebRTCSessionDescriptionRequest):
    (WebKit::WebRTCSessionDescriptionRequest::assign):
    (WebKit::WebRTCSessionDescriptionRequest::reset):
    (WebKit::WebRTCSessionDescriptionRequest::requestSucceeded):
    (WebKit::WebRTCSessionDescriptionRequest::requestFailed):
    (ExtraDataContainer):
    (WebKit::ExtraDataContainer::ExtraDataContainer):
    (WebKit::ExtraDataContainer::extraData):
    (WebKit::WebRTCSessionDescriptionRequest::extraData):
    (WebKit::WebRTCSessionDescriptionRequest::setExtraData):
    * platform/mediastream/RTCPeerConnectionHandler.cpp:
    (RTCPeerConnectionHandlerDummy):
    (WebCore::RTCPeerConnectionHandlerDummy::createOffer):
    (WebCore):
    * platform/mediastream/RTCPeerConnectionHandler.h:
    (WebCore):
    (RTCPeerConnectionHandler):
    * platform/mediastream/RTCSessionDescriptionDescriptor.h:
    (WebCore::RTCSessionDescriptionDescriptor::type):
    (WebCore::RTCSessionDescriptionDescriptor::sdp):
    * platform/mediastream/RTCSessionDescriptionRequest.h: Copied from Source/WebCore/platform/mediastream/RTCSessionDescriptionDescriptor.h.
    (WebCore):
    (RTCSessionDescriptionRequest):
    (ExtraData):
    (WebCore::RTCSessionDescriptionRequest::ExtraData::~ExtraData):
    (WebCore::RTCSessionDescriptionRequest::~RTCSessionDescriptionRequest):
    (WebCore::RTCSessionDescriptionRequest::extraData):
    (WebCore::RTCSessionDescriptionRequest::setExtraData):
    (WebCore::RTCSessionDescriptionRequest::RTCSessionDescriptionRequest):
    * platform/mediastream/chromium/RTCPeerConnectionHandlerChromium.cpp:
    (WebCore::RTCPeerConnectionHandlerChromium::createOffer):
    (WebCore):
    * platform/mediastream/chromium/RTCPeerConnectionHandlerChromium.h:
    (RTCPeerConnectionHandlerChromium):
    
    Tools:
    
    * DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.cpp:
    (MockWebRTCPeerConnectionHandler::SuccessCallbackTask::SuccessCallbackTask):
    (MockWebRTCPeerConnectionHandler::SuccessCallbackTask::runIfValid):
    (MockWebRTCPeerConnectionHandler::FailureCallbackTask::FailureCallbackTask):
    (MockWebRTCPeerConnectionHandler::FailureCallbackTask::runIfValid):
    (MockWebRTCPeerConnectionHandler::createOffer):
    * DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.h:
    (MockWebRTCPeerConnectionHandler):
    (MockWebRTCPeerConnectionHandler::taskList):
    (SuccessCallbackTask):
    (FailureCallbackTask):
    
    LayoutTests:
    
    * fast/mediastream/RTCPeerConnection-createOffer-expected.txt: Added.
    * fast/mediastream/RTCPeerConnection-createOffer.html: Added.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@127501 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    ee34ed92
ChangeLog 3.62 MB