Changeset 160553 in webkit


Ignore:
Timestamp:
Dec 13, 2013 12:04:40 PM (10 years ago)
Author:
thiago.lacerda@openbossa.org
Message:

Adding RTCPeerConnectionErrorCallback
https://bugs.webkit.org/show_bug.cgi?id=125574

Reviewed by Eric Carlson.

According to the spec there should be a RTCPeerConnectionErrorCallback function type for createOffer/Answer,
setLocal/RemoteDescription and updateIce function calls. This callback must handle a DOMError object.

Source/WebCore:

Existing tests were updated.

  • CMakeLists.txt:
  • GNUmakefile.list.am:
  • Modules/mediastream/RTCPeerConnection.cpp:

(WebCore::RTCPeerConnection::createOffer):
(WebCore::RTCPeerConnection::createAnswer):
(WebCore::RTCPeerConnection::setLocalDescription):
(WebCore::RTCPeerConnection::setRemoteDescription):
(WebCore::RTCPeerConnection::addIceCandidate):

  • Modules/mediastream/RTCErrorCallback.h: Removed.
  • Modules/mediastream/RTCErrorCallback.idl: Removed.
  • Modules/mediastream/RTCPeerConnection.h:
  • Modules/mediastream/RTCPeerConnection.idl:
  • Modules/mediastream/RTCPeerConnectionErrorCallback.h: Added.
  • Modules/mediastream/RTCPeerConnectionErrorCallback.idl: Added.
  • Modules/mediastream/RTCSessionDescriptionRequestImpl.cpp:

(WebCore::RTCSessionDescriptionRequestImpl::create):
(WebCore::RTCSessionDescriptionRequestImpl::RTCSessionDescriptionRequestImpl):
(WebCore::RTCSessionDescriptionRequestImpl::requestFailed):

  • Modules/mediastream/RTCSessionDescriptionRequestImpl.h:
  • Modules/mediastream/RTCVoidRequestImpl.cpp:

(WebCore::RTCVoidRequestImpl::create):
(WebCore::RTCVoidRequestImpl::RTCVoidRequestImpl):
(WebCore::RTCVoidRequestImpl::requestFailed):

  • Modules/mediastream/RTCVoidRequestImpl.h:
  • WebCore.xcodeproj/project.pbxproj:
  • platform/mediastream/RTCPeerConnectionHandler.cpp:

(WebCore::RTCPeerConnectionHandler::incompatibleConstraintsErrorName):
(WebCore::RTCPeerConnectionHandler::invalidSessionDescriptionErrorName):
(WebCore::RTCPeerConnectionHandler::incompatibleSessionDescriptionErrorName):
(WebCore::RTCPeerConnectionHandler::internalErrorName):

  • platform/mediastream/RTCPeerConnectionHandler.h:
  • platform/mock/RTCNotifiersMock.cpp:

(WebCore::SessionRequestNotifier::SessionRequestNotifier):
(WebCore::SessionRequestNotifier::fire):
(WebCore::VoidRequestNotifier::VoidRequestNotifier):
(WebCore::VoidRequestNotifier::fire):

  • platform/mock/RTCNotifiersMock.h:
  • platform/mock/RTCPeerConnectionHandlerMock.cpp:

(WebCore::RTCPeerConnectionHandlerMock::createOffer):
(WebCore::RTCPeerConnectionHandlerMock::createAnswer):

LayoutTests:

  • fast/mediastream/RTCPeerConnection-createAnswer-expected.txt:
  • fast/mediastream/RTCPeerConnection-createAnswer.html:
  • fast/mediastream/RTCPeerConnection-createOffer-expected.txt:
  • fast/mediastream/RTCPeerConnection-createOffer.html:
Location:
trunk
Files:
22 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r160547 r160553  
     12013-12-13  Thiago de Barros Lacerda  <thiago.lacerda@openbossa.org>
     2
     3        Adding RTCPeerConnectionErrorCallback
     4        https://bugs.webkit.org/show_bug.cgi?id=125574
     5
     6        Reviewed by Eric Carlson.
     7
     8        According to the spec there should be a RTCPeerConnectionErrorCallback function type for createOffer/Answer,
     9        setLocal/RemoteDescription and updateIce function calls. This callback must handle a DOMError object.
     10
     11        * fast/mediastream/RTCPeerConnection-createAnswer-expected.txt:
     12        * fast/mediastream/RTCPeerConnection-createAnswer.html:
     13        * fast/mediastream/RTCPeerConnection-createOffer-expected.txt:
     14        * fast/mediastream/RTCPeerConnection-createOffer.html:
     15
    1162013-12-13  Alexey Proskuryakov  <ap@apple.com>
    217
  • trunk/LayoutTests/fast/mediastream/RTCPeerConnection-createAnswer-expected.txt

    r160436 r160553  
    1010PASS pc.createAnswer(requestSucceeded2, requestFailed2, {mandatory:{"succeed":false}}); did not throw exception.
    1111PASS createAnswer request failed.
     12PASS errorReason.name is "IncompatibleConstraintsError"
    1213PASS pc.createAnswer(requestSucceeded3, requestFailed3); did not throw exception.
    1314PASS createAnswer request succeeded.
  • trunk/LayoutTests/fast/mediastream/RTCPeerConnection-createAnswer.html

    r160436 r160553  
    4040            {
    4141                testPassed('createAnswer request failed.');
     42
     43                errorReason = reason;
     44                shouldBe('errorReason.name', '"IncompatibleConstraintsError"');
    4245
    4346                shouldNotThrow('pc.createAnswer(requestSucceeded3, requestFailed3);');
  • trunk/LayoutTests/fast/mediastream/RTCPeerConnection-createOffer-expected.txt

    r160436 r160553  
    99PASS pc.createOffer(requestSucceeded2, requestFailed2, {mandatory:{"succeed":false}}); did not throw exception.
    1010PASS createOffer request failed.
    11 PASS errorReason is "TEST_ERROR"
     11PASS errorReason.name is "IncompatibleConstraintsError"
    1212PASS pc.createOffer(requestSucceeded3, requestFailed1); did not throw exception.
    1313PASS createOffer request succeeded.
  • trunk/LayoutTests/fast/mediastream/RTCPeerConnection-createOffer.html

    r160436 r160553  
    2424
    2525                errorReason = reason;
    26                 shouldBe('errorReason', '"TEST_ERROR"');
     26                shouldBe('errorReason.name', '"IncompatibleConstraintsError"');
    2727
    2828                shouldNotThrow('pc.createOffer(requestSucceeded3, requestFailed1);');
  • trunk/Source/WebCore/CMakeLists.txt

    r160517 r160553  
    212212    Modules/mediastream/RTCDataChannel.idl
    213213    Modules/mediastream/RTCDataChannelEvent.idl
    214     Modules/mediastream/RTCErrorCallback.idl
     214    Modules/mediastream/RTCPeerConnectionErrorCallback.idl
    215215    Modules/mediastream/RTCIceCandidate.idl
    216216    Modules/mediastream/RTCIceCandidateEvent.idl
  • trunk/Source/WebCore/ChangeLog

    r160548 r160553  
     12013-12-13  Thiago de Barros Lacerda  <thiago.lacerda@openbossa.org>
     2
     3        Adding RTCPeerConnectionErrorCallback
     4        https://bugs.webkit.org/show_bug.cgi?id=125574
     5
     6        Reviewed by Eric Carlson.
     7
     8        According to the spec there should be a RTCPeerConnectionErrorCallback function type for createOffer/Answer,
     9        setLocal/RemoteDescription and updateIce function calls. This callback must handle a DOMError object.
     10
     11        Existing tests were updated.
     12
     13        * CMakeLists.txt:
     14        * GNUmakefile.list.am:
     15        * Modules/mediastream/RTCPeerConnection.cpp:
     16        (WebCore::RTCPeerConnection::createOffer):
     17        (WebCore::RTCPeerConnection::createAnswer):
     18        (WebCore::RTCPeerConnection::setLocalDescription):
     19        (WebCore::RTCPeerConnection::setRemoteDescription):
     20        (WebCore::RTCPeerConnection::addIceCandidate):
     21        * Modules/mediastream/RTCErrorCallback.h: Removed.
     22        * Modules/mediastream/RTCErrorCallback.idl: Removed.
     23        * Modules/mediastream/RTCPeerConnection.h:
     24        * Modules/mediastream/RTCPeerConnection.idl:
     25        * Modules/mediastream/RTCPeerConnectionErrorCallback.h: Added.
     26        * Modules/mediastream/RTCPeerConnectionErrorCallback.idl: Added.
     27        * Modules/mediastream/RTCSessionDescriptionRequestImpl.cpp:
     28        (WebCore::RTCSessionDescriptionRequestImpl::create):
     29        (WebCore::RTCSessionDescriptionRequestImpl::RTCSessionDescriptionRequestImpl):
     30        (WebCore::RTCSessionDescriptionRequestImpl::requestFailed):
     31        * Modules/mediastream/RTCSessionDescriptionRequestImpl.h:
     32        * Modules/mediastream/RTCVoidRequestImpl.cpp:
     33        (WebCore::RTCVoidRequestImpl::create):
     34        (WebCore::RTCVoidRequestImpl::RTCVoidRequestImpl):
     35        (WebCore::RTCVoidRequestImpl::requestFailed):
     36        * Modules/mediastream/RTCVoidRequestImpl.h:
     37        * WebCore.xcodeproj/project.pbxproj:
     38        * platform/mediastream/RTCPeerConnectionHandler.cpp:
     39        (WebCore::RTCPeerConnectionHandler::incompatibleConstraintsErrorName):
     40        (WebCore::RTCPeerConnectionHandler::invalidSessionDescriptionErrorName):
     41        (WebCore::RTCPeerConnectionHandler::incompatibleSessionDescriptionErrorName):
     42        (WebCore::RTCPeerConnectionHandler::internalErrorName):
     43        * platform/mediastream/RTCPeerConnectionHandler.h:
     44        * platform/mock/RTCNotifiersMock.cpp:
     45        (WebCore::SessionRequestNotifier::SessionRequestNotifier):
     46        (WebCore::SessionRequestNotifier::fire):
     47        (WebCore::VoidRequestNotifier::VoidRequestNotifier):
     48        (WebCore::VoidRequestNotifier::fire):
     49        * platform/mock/RTCNotifiersMock.h:
     50        * platform/mock/RTCPeerConnectionHandlerMock.cpp:
     51        (WebCore::RTCPeerConnectionHandlerMock::createOffer):
     52        (WebCore::RTCPeerConnectionHandlerMock::createAnswer):
     53
    1542013-12-13  Brent Fulgham  <bfulgham@apple.com>
    255
  • trunk/Source/WebCore/DerivedSources.make

    r160336 r160553  
    128128    $(WebCore)/Modules/mediastream/RTCDataChannel.idl \
    129129    $(WebCore)/Modules/mediastream/RTCDataChannelEvent.idl \
    130     $(WebCore)/Modules/mediastream/RTCErrorCallback.idl \
    131130    $(WebCore)/Modules/mediastream/RTCIceCandidate.idl \
    132131    $(WebCore)/Modules/mediastream/RTCIceCandidateEvent.idl \
    133132    $(WebCore)/Modules/mediastream/RTCPeerConnection.idl \
     133    $(WebCore)/Modules/mediastream/RTCPeerConnectionErrorCallback.idl \
    134134    $(WebCore)/Modules/mediastream/RTCSessionDescription.idl \
    135135    $(WebCore)/Modules/mediastream/RTCSessionDescriptionCallback.idl \
  • trunk/Source/WebCore/GNUmakefile.list.am

    r160517 r160553  
    612612        DerivedSources/WebCore/JSRTCDataChannelEvent.cpp \
    613613        DerivedSources/WebCore/JSRTCDataChannelEvent.h \
    614         DerivedSources/WebCore/JSRTCErrorCallback.cpp \
    615         DerivedSources/WebCore/JSRTCErrorCallback.h \
     614        DerivedSources/WebCore/JSRTCPeerConnectionErrorCallback.cpp \
     615        DerivedSources/WebCore/JSRTCPeerConnectionErrorCallback.h \
    616616        DerivedSources/WebCore/JSRTCIceCandidate.cpp \
    617617        DerivedSources/WebCore/JSRTCIceCandidate.h \
     
    12281228        $(WebCore)/Modules/mediastream/RTCDataChannel.idl \
    12291229        $(WebCore)/Modules/mediastream/RTCDataChannelEvent.idl \
    1230         $(WebCore)/Modules/mediastream/RTCErrorCallback.idl \
     1230        $(WebCore)/Modules/mediastream/RTCPeerConnectionErrorCallback.idl \
    12311231        $(WebCore)/Modules/mediastream/RTCIceCandidate.idl \
    12321232        $(WebCore)/Modules/mediastream/RTCIceCandidateEvent.idl \
     
    19381938        Source/WebCore/Modules/mediastream/RTCDataChannelEvent.cpp \
    19391939        Source/WebCore/Modules/mediastream/RTCDataChannelEvent.h \
    1940         Source/WebCore/Modules/mediastream/RTCErrorCallback.h \
     1940        Source/WebCore/Modules/mediastream/RTCPeerConnectionErrorCallback.h \
    19411941        Source/WebCore/Modules/mediastream/RTCIceCandidate.cpp \
    19421942        Source/WebCore/Modules/mediastream/RTCIceCandidate.h \
  • trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp

    r160181 r160553  
    5050#include "RTCDataChannelEvent.h"
    5151#include "RTCDataChannelHandler.h"
    52 #include "RTCErrorCallback.h"
    5352#include "RTCIceCandidate.h"
    5453#include "RTCIceCandidateDescriptor.h"
    5554#include "RTCIceCandidateEvent.h"
     55#include "RTCPeerConnectionErrorCallback.h"
    5656#include "RTCSessionDescription.h"
    5757#include "RTCSessionDescriptionCallback.h"
     
    171171}
    172172
    173 void RTCPeerConnection::createOffer(PassRefPtr<RTCSessionDescriptionCallback> successCallback, PassRefPtr<RTCErrorCallback> errorCallback, const Dictionary& mediaConstraints, ExceptionCode& ec)
     173void RTCPeerConnection::createOffer(PassRefPtr<RTCSessionDescriptionCallback> successCallback, PassRefPtr<RTCPeerConnectionErrorCallback> errorCallback, const Dictionary& mediaConstraints, ExceptionCode& ec)
    174174{
    175175    if (m_signalingState == SignalingStateClosed) {
     
    191191}
    192192
    193 void RTCPeerConnection::createAnswer(PassRefPtr<RTCSessionDescriptionCallback> successCallback, PassRefPtr<RTCErrorCallback> errorCallback, const Dictionary& mediaConstraints, ExceptionCode& ec)
     193void RTCPeerConnection::createAnswer(PassRefPtr<RTCSessionDescriptionCallback> successCallback, PassRefPtr<RTCPeerConnectionErrorCallback> errorCallback, const Dictionary& mediaConstraints, ExceptionCode& ec)
    194194{
    195195    if (m_signalingState == SignalingStateClosed) {
     
    211211}
    212212
    213 void RTCPeerConnection::setLocalDescription(PassRefPtr<RTCSessionDescription> prpSessionDescription, PassRefPtr<VoidCallback> successCallback, PassRefPtr<RTCErrorCallback> errorCallback, ExceptionCode& ec)
     213void RTCPeerConnection::setLocalDescription(PassRefPtr<RTCSessionDescription> prpSessionDescription, PassRefPtr<VoidCallback> successCallback, PassRefPtr<RTCPeerConnectionErrorCallback> errorCallback, ExceptionCode& ec)
    214214{
    215215    if (m_signalingState == SignalingStateClosed) {
     
    240240}
    241241
    242 void RTCPeerConnection::setRemoteDescription(PassRefPtr<RTCSessionDescription> prpSessionDescription, PassRefPtr<VoidCallback> successCallback, PassRefPtr<RTCErrorCallback> errorCallback, ExceptionCode& ec)
     242void RTCPeerConnection::setRemoteDescription(PassRefPtr<RTCSessionDescription> prpSessionDescription, PassRefPtr<VoidCallback> successCallback, PassRefPtr<RTCPeerConnectionErrorCallback> errorCallback, ExceptionCode& ec)
    243243{
    244244    if (m_signalingState == SignalingStateClosed) {
     
    289289}
    290290
    291 void RTCPeerConnection::addIceCandidate(RTCIceCandidate* iceCandidate, PassRefPtr<VoidCallback> successCallback, PassRefPtr<RTCErrorCallback> errorCallback, ExceptionCode& ec)
     291void RTCPeerConnection::addIceCandidate(RTCIceCandidate* iceCandidate, PassRefPtr<VoidCallback> successCallback, PassRefPtr<RTCPeerConnectionErrorCallback> errorCallback, ExceptionCode& ec)
    292292{
    293293    if (m_signalingState == SignalingStateClosed) {
  • trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.h

    r160181 r160553  
    5454class RTCDTMFSender;
    5555class RTCDataChannel;
    56 class RTCErrorCallback;
     56class RTCPeerConnectionErrorCallback;
    5757class RTCSessionDescription;
    5858class RTCSessionDescriptionCallback;
     
    6565    ~RTCPeerConnection();
    6666
    67     void createOffer(PassRefPtr<RTCSessionDescriptionCallback>, PassRefPtr<RTCErrorCallback>, const Dictionary& mediaConstraints, ExceptionCode&);
     67    void createOffer(PassRefPtr<RTCSessionDescriptionCallback>, PassRefPtr<RTCPeerConnectionErrorCallback>, const Dictionary& mediaConstraints, ExceptionCode&);
    6868
    69     void createAnswer(PassRefPtr<RTCSessionDescriptionCallback>, PassRefPtr<RTCErrorCallback>, const Dictionary& mediaConstraints, ExceptionCode&);
     69    void createAnswer(PassRefPtr<RTCSessionDescriptionCallback>, PassRefPtr<RTCPeerConnectionErrorCallback>, const Dictionary& mediaConstraints, ExceptionCode&);
    7070
    71     void setLocalDescription(PassRefPtr<RTCSessionDescription>, PassRefPtr<VoidCallback>, PassRefPtr<RTCErrorCallback>, ExceptionCode&);
     71    void setLocalDescription(PassRefPtr<RTCSessionDescription>, PassRefPtr<VoidCallback>, PassRefPtr<RTCPeerConnectionErrorCallback>, ExceptionCode&);
    7272    PassRefPtr<RTCSessionDescription> localDescription(ExceptionCode&);
    7373
    74     void setRemoteDescription(PassRefPtr<RTCSessionDescription>, PassRefPtr<VoidCallback>, PassRefPtr<RTCErrorCallback>, ExceptionCode&);
     74    void setRemoteDescription(PassRefPtr<RTCSessionDescription>, PassRefPtr<VoidCallback>, PassRefPtr<RTCPeerConnectionErrorCallback>, ExceptionCode&);
    7575    PassRefPtr<RTCSessionDescription> remoteDescription(ExceptionCode&);
    7676
     
    7979    void updateIce(const Dictionary& rtcConfiguration, const Dictionary& mediaConstraints, ExceptionCode&);
    8080
    81     void addIceCandidate(RTCIceCandidate*, PassRefPtr<VoidCallback>, PassRefPtr<RTCErrorCallback>, ExceptionCode&);
     81    void addIceCandidate(RTCIceCandidate*, PassRefPtr<VoidCallback>, PassRefPtr<RTCPeerConnectionErrorCallback>, ExceptionCode&);
    8282
    8383    String iceGatheringState() const;
  • trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.idl

    r159061 r160553  
    4040    InterfaceName=webkitRTCPeerConnection,
    4141] interface RTCPeerConnection {
    42     [RaisesException] void createOffer(RTCSessionDescriptionCallback successCallback, [Default=Undefined] optional RTCErrorCallback failureCallback, optional Dictionary mediaConstraints);
     42    [RaisesException] void createOffer(RTCSessionDescriptionCallback successCallback, [Default=Undefined] optional RTCPeerConnectionErrorCallback failureCallback, optional Dictionary mediaConstraints);
    4343
    44     [RaisesException] void createAnswer(RTCSessionDescriptionCallback successCallback, [Default=Undefined] optional RTCErrorCallback failureCallback, optional Dictionary mediaConstraints);
     44    [RaisesException] void createAnswer(RTCSessionDescriptionCallback successCallback, [Default=Undefined] optional RTCPeerConnectionErrorCallback failureCallback, optional Dictionary mediaConstraints);
    4545
    46     [RaisesException] void setLocalDescription(RTCSessionDescription description, [Default=Undefined] optional VoidCallback successCallback, [Default=Undefined] optional RTCErrorCallback failureCallback);
     46    [RaisesException] void setLocalDescription(RTCSessionDescription description, [Default=Undefined] optional VoidCallback successCallback, [Default=Undefined] optional RTCPeerConnectionErrorCallback failureCallback);
    4747    [GetterRaisesException] readonly attribute RTCSessionDescription localDescription;
    4848
    49     [RaisesException] void setRemoteDescription(RTCSessionDescription description, [Default=Undefined] optional VoidCallback successCallback, [Default=Undefined] optional RTCErrorCallback failureCallback);
     49    [RaisesException] void setRemoteDescription(RTCSessionDescription description, [Default=Undefined] optional VoidCallback successCallback, [Default=Undefined] optional RTCPeerConnectionErrorCallback failureCallback);
    5050    [GetterRaisesException] readonly attribute RTCSessionDescription remoteDescription;
    5151
     
    5454    [RaisesException] void updateIce(optional Dictionary configuration, optional Dictionary mediaConstraints);
    5555
    56     [RaisesException] void addIceCandidate(RTCIceCandidate candidate, VoidCallback successCallback, RTCErrorCallback failureCallback);
     56    [RaisesException] void addIceCandidate(RTCIceCandidate candidate, VoidCallback successCallback, RTCPeerConnectionErrorCallback failureCallback);
    5757
    5858    readonly attribute DOMString iceGatheringState;
  • trunk/Source/WebCore/Modules/mediastream/RTCPeerConnectionErrorCallback.h

    r160552 r160553  
    11/*
    2  * Copyright (C) 2012 Google Inc. All rights reserved.
     2 * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
    33 *
    44 * Redistribution and use in source and binary forms, with or without
    55 * modification, are permitted provided that the following conditions
    66 * are met:
    7  *
    87 * 1. Redistributions of source code must retain the above copyright
    98 *    notice, this list of conditions and the following disclaimer.
    109 * 2. Redistributions in binary form must reproduce the above copyright
    11  *    notice, this list of conditions and the following disclaimer
    12  *    in the documentation and/or other materials provided with the
    13  *    distribution.
    14  * 3. Neither the name of Google Inc. nor the names of its contributors
    15  *    may be used to endorse or promote products derived from this
    16  *    software without specific prior written permission.
     10 *    notice, this list of conditions and the following disclaimer in the
     11 *    documentation and/or other materials provided with the distribution.
    1712 *
    1813 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     
    2924 */
    3025
    31 #ifndef RTCErrorCallback_h
    32 #define RTCErrorCallback_h
     26#ifndef RTCPeerConnectionErrorCallback_h
     27#define RTCPeerConnectionErrorCallback_h
    3328
    3429#if ENABLE(MEDIA_STREAM)
    3530
     31#include "DOMError.h"
    3632#include <wtf/RefCounted.h>
    37 #include <wtf/text/WTFString.h>
    3833
    3934namespace WebCore {
    4035
    41 class RTCErrorCallback : public RefCounted<RTCErrorCallback> {
     36class RTCPeerConnectionErrorCallback : public RefCounted<RTCPeerConnectionErrorCallback> {
    4237public:
    43     virtual ~RTCErrorCallback() { }
    44     virtual bool handleEvent(const String& errorInformation) = 0;
     38    virtual ~RTCPeerConnectionErrorCallback() { }
     39    virtual bool handleEvent(DOMError*) = 0;
    4540};
    4641
     
    4944#endif // ENABLE(MEDIA_STREAM)
    5045
    51 #endif // RTCErrorCallback_h
     46#endif // RTCPeerConnectionErrorCallback_h
  • trunk/Source/WebCore/Modules/mediastream/RTCPeerConnectionErrorCallback.idl

    r160552 r160553  
    11/*
    2  * Copyright (C) 2012 Google Inc. All rights reserved.
     2 * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
    33 *
    44 * Redistribution and use in source and binary forms, with or without
    55 * modification, are permitted provided that the following conditions
    66 * are met:
    7  *
    87 * 1. Redistributions of source code must retain the above copyright
    98 *    notice, this list of conditions and the following disclaimer.
    109 * 2. Redistributions in binary form must reproduce the above copyright
    11  *    notice, this list of conditions and the following disclaimer
    12  *    in the documentation and/or other materials provided with the
    13  *    distribution.
    14  * 3. Neither the name of Google Inc. nor the names of its contributors
    15  *    may be used to endorse or promote products derived from this
    16  *    software without specific prior written permission.
     10 *    notice, this list of conditions and the following disclaimer in the
     11 *    documentation and/or other materials provided with the distribution.
    1712 *
    1813 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     
    3126[
    3227    Conditional=MEDIA_STREAM,
    33 ] callback interface RTCErrorCallback {
    34     boolean handleEvent(DOMString errorInformation);
     28] callback interface RTCPeerConnectionErrorCallback {
     29    boolean handleEvent(DOMError error);
    3530};
    3631
  • trunk/Source/WebCore/Modules/mediastream/RTCSessionDescriptionRequestImpl.cpp

    r146537 r160553  
    11/*
    22 * Copyright (C) 2012 Google Inc. All rights reserved.
     3 * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    3536#include "RTCSessionDescriptionRequestImpl.h"
    3637
    37 #include "RTCErrorCallback.h"
    3838#include "RTCPeerConnection.h"
     39#include "RTCPeerConnectionErrorCallback.h"
    3940#include "RTCSessionDescription.h"
    4041#include "RTCSessionDescriptionCallback.h"
     
    4344namespace WebCore {
    4445
    45 PassRefPtr<RTCSessionDescriptionRequestImpl> RTCSessionDescriptionRequestImpl::create(ScriptExecutionContext* context, PassRefPtr<RTCSessionDescriptionCallback> successCallback, PassRefPtr<RTCErrorCallback> errorCallback)
     46PassRefPtr<RTCSessionDescriptionRequestImpl> RTCSessionDescriptionRequestImpl::create(ScriptExecutionContext* context, PassRefPtr<RTCSessionDescriptionCallback> successCallback, PassRefPtr<RTCPeerConnectionErrorCallback> errorCallback)
    4647{
    4748    RefPtr<RTCSessionDescriptionRequestImpl> request = adoptRef(new RTCSessionDescriptionRequestImpl(context, successCallback, errorCallback));
     
    5051}
    5152
    52 RTCSessionDescriptionRequestImpl::RTCSessionDescriptionRequestImpl(ScriptExecutionContext* context, PassRefPtr<RTCSessionDescriptionCallback> successCallback, PassRefPtr<RTCErrorCallback> errorCallback)
     53RTCSessionDescriptionRequestImpl::RTCSessionDescriptionRequestImpl(ScriptExecutionContext* context, PassRefPtr<RTCSessionDescriptionCallback> successCallback, PassRefPtr<RTCPeerConnectionErrorCallback> errorCallback)
    5354    : ActiveDOMObject(context)
    5455    , m_successCallback(successCallback)
     
    7475{
    7576    if (m_errorCallback)
    76         m_errorCallback->handleEvent(error);
     77        m_errorCallback->handleEvent(DOMError::create(error).get());
    7778
    7879    clear();
  • trunk/Source/WebCore/Modules/mediastream/RTCSessionDescriptionRequestImpl.h

    r127766 r160553  
    11/*
    22 * Copyright (C) 2012 Google Inc. All rights reserved.
     3 * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    3940namespace WebCore {
    4041
    41 class RTCErrorCallback;
     42class RTCPeerConnectionErrorCallback;
    4243class RTCPeerConnection;
    4344class RTCSessionDescriptionCallback;
     
    4546class RTCSessionDescriptionRequestImpl : public RTCSessionDescriptionRequest, public ActiveDOMObject {
    4647public:
    47     static PassRefPtr<RTCSessionDescriptionRequestImpl> create(ScriptExecutionContext*, PassRefPtr<RTCSessionDescriptionCallback>, PassRefPtr<RTCErrorCallback>);
     48    static PassRefPtr<RTCSessionDescriptionRequestImpl> create(ScriptExecutionContext*, PassRefPtr<RTCSessionDescriptionCallback>, PassRefPtr<RTCPeerConnectionErrorCallback>);
    4849    virtual ~RTCSessionDescriptionRequestImpl();
    4950
     
    5556
    5657private:
    57     RTCSessionDescriptionRequestImpl(ScriptExecutionContext*, PassRefPtr<RTCSessionDescriptionCallback>, PassRefPtr<RTCErrorCallback>);
     58    RTCSessionDescriptionRequestImpl(ScriptExecutionContext*, PassRefPtr<RTCSessionDescriptionCallback>, PassRefPtr<RTCPeerConnectionErrorCallback>);
    5859
    5960    void clear();
    6061
    6162    RefPtr<RTCSessionDescriptionCallback> m_successCallback;
    62     RefPtr<RTCErrorCallback> m_errorCallback;
     63    RefPtr<RTCPeerConnectionErrorCallback> m_errorCallback;
    6364};
    6465
  • trunk/Source/WebCore/Modules/mediastream/RTCVoidRequestImpl.cpp

    r146537 r160553  
    11/*
    22 * Copyright (C) 2012 Google Inc. All rights reserved.
     3 * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    3536#include "RTCVoidRequestImpl.h"
    3637
    37 #include "RTCErrorCallback.h"
     38#include "DOMError.h"
    3839#include "RTCPeerConnection.h"
     40#include "RTCPeerConnectionErrorCallback.h"
    3941#include "VoidCallback.h"
    4042
    4143namespace WebCore {
    4244
    43 PassRefPtr<RTCVoidRequestImpl> RTCVoidRequestImpl::create(ScriptExecutionContext* context, PassRefPtr<VoidCallback> successCallback, PassRefPtr<RTCErrorCallback> errorCallback)
     45PassRefPtr<RTCVoidRequestImpl> RTCVoidRequestImpl::create(ScriptExecutionContext* context, PassRefPtr<VoidCallback> successCallback, PassRefPtr<RTCPeerConnectionErrorCallback> errorCallback)
    4446{
    4547    RefPtr<RTCVoidRequestImpl> request = adoptRef(new RTCVoidRequestImpl(context, successCallback, errorCallback));
     
    4850}
    4951
    50 RTCVoidRequestImpl::RTCVoidRequestImpl(ScriptExecutionContext* context, PassRefPtr<VoidCallback> successCallback, PassRefPtr<RTCErrorCallback> errorCallback)
     52RTCVoidRequestImpl::RTCVoidRequestImpl(ScriptExecutionContext* context, PassRefPtr<VoidCallback> successCallback, PassRefPtr<RTCPeerConnectionErrorCallback> errorCallback)
    5153    : ActiveDOMObject(context)
    5254    , m_successCallback(successCallback)
     
    7072{
    7173    if (m_errorCallback.get())
    72         m_errorCallback->handleEvent(error);
     74        m_errorCallback->handleEvent(DOMError::create(error).get());
    7375
    7476    clear();
  • trunk/Source/WebCore/Modules/mediastream/RTCVoidRequestImpl.h

    r127766 r160553  
    11/*
    22 * Copyright (C) 2012 Google Inc. All rights reserved.
     3 * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    3940namespace WebCore {
    4041
    41 class RTCErrorCallback;
     42class RTCPeerConnectionErrorCallback;
    4243class VoidCallback;
    4344
    4445class RTCVoidRequestImpl : public RTCVoidRequest, public ActiveDOMObject {
    4546public:
    46     static PassRefPtr<RTCVoidRequestImpl> create(ScriptExecutionContext*, PassRefPtr<VoidCallback>, PassRefPtr<RTCErrorCallback>);
     47    static PassRefPtr<RTCVoidRequestImpl> create(ScriptExecutionContext*, PassRefPtr<VoidCallback>, PassRefPtr<RTCPeerConnectionErrorCallback>);
    4748    virtual ~RTCVoidRequestImpl();
    4849
     
    5455
    5556private:
    56     RTCVoidRequestImpl(ScriptExecutionContext*, PassRefPtr<VoidCallback>, PassRefPtr<RTCErrorCallback>);
     57    RTCVoidRequestImpl(ScriptExecutionContext*, PassRefPtr<VoidCallback>, PassRefPtr<RTCPeerConnectionErrorCallback>);
    5758
    5859    void clear();
    5960
    6061    RefPtr<VoidCallback> m_successCallback;
    61     RefPtr<RTCErrorCallback> m_errorCallback;
     62    RefPtr<RTCPeerConnectionErrorCallback> m_errorCallback;
    6263};
    6364
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r160520 r160553  
    229229                078E092017D14D1C00420AA1 /* RTCDTMFSender.h in Headers */ = {isa = PBXBuildFile; fileRef = 07221B6A17CEC32700848E51 /* RTCDTMFSender.h */; settings = {ATTRIBUTES = (Private, ); }; };
    230230                078E092117D14D1C00420AA1 /* RTCDTMFToneChangeEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 07221B6D17CEC32700848E51 /* RTCDTMFToneChangeEvent.h */; settings = {ATTRIBUTES = (Private, ); }; };
    231                 078E092217D14D1C00420AA1 /* RTCErrorCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 07221B6F17CEC32700848E51 /* RTCErrorCallback.h */; settings = {ATTRIBUTES = (Private, ); }; };
    232231                078E092317D14D1C00420AA1 /* RTCIceCandidate.h in Headers */ = {isa = PBXBuildFile; fileRef = 07221B7217CEC32700848E51 /* RTCIceCandidate.h */; settings = {ATTRIBUTES = (Private, ); }; };
    233232                078E092417D14D1C00420AA1 /* RTCIceCandidateEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 07221B7517CEC32700848E51 /* RTCIceCandidateEvent.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    279278                07969DB117D14151007FF842 /* JSRTCDTMFToneChangeEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07969D9717D14151007FF842 /* JSRTCDTMFToneChangeEvent.cpp */; };
    280279                07969DB217D14151007FF842 /* JSRTCDTMFToneChangeEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 07969D9817D14151007FF842 /* JSRTCDTMFToneChangeEvent.h */; };
    281                 07969DB317D14151007FF842 /* JSRTCErrorCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07969D9917D14151007FF842 /* JSRTCErrorCallback.cpp */; };
    282                 07969DB417D14151007FF842 /* JSRTCErrorCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 07969D9A17D14151007FF842 /* JSRTCErrorCallback.h */; };
     280                07969DB317D14151007FF842 /* JSRTCPeerConnectionErrorCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07969D9917D14151007FF842 /* JSRTCPeerConnectionErrorCallback.cpp */; };
     281                07969DB417D14151007FF842 /* JSRTCPeerConnectionErrorCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 07969D9A17D14151007FF842 /* JSRTCPeerConnectionErrorCallback.h */; };
    283282                07969DB517D14151007FF842 /* JSRTCIceCandidate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07969D9B17D14151007FF842 /* JSRTCIceCandidate.cpp */; };
    284283                07969DB617D14151007FF842 /* JSRTCIceCandidate.h in Headers */ = {isa = PBXBuildFile; fileRef = 07969D9C17D14151007FF842 /* JSRTCIceCandidate.h */; };
     
    67306729                07221B6D17CEC32700848E51 /* RTCDTMFToneChangeEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTCDTMFToneChangeEvent.h; sourceTree = "<group>"; };
    67316730                07221B6E17CEC32700848E51 /* RTCDTMFToneChangeEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = RTCDTMFToneChangeEvent.idl; sourceTree = "<group>"; };
    6732                 07221B6F17CEC32700848E51 /* RTCErrorCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTCErrorCallback.h; sourceTree = "<group>"; };
    6733                 07221B7017CEC32700848E51 /* RTCErrorCallback.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = RTCErrorCallback.idl; sourceTree = "<group>"; };
    67346731                07221B7117CEC32700848E51 /* RTCIceCandidate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RTCIceCandidate.cpp; sourceTree = "<group>"; };
    67356732                07221B7217CEC32700848E51 /* RTCIceCandidate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTCIceCandidate.h; sourceTree = "<group>"; };
     
    68656862                07969D9717D14151007FF842 /* JSRTCDTMFToneChangeEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSRTCDTMFToneChangeEvent.cpp; sourceTree = "<group>"; };
    68666863                07969D9817D14151007FF842 /* JSRTCDTMFToneChangeEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSRTCDTMFToneChangeEvent.h; sourceTree = "<group>"; };
    6867                 07969D9917D14151007FF842 /* JSRTCErrorCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSRTCErrorCallback.cpp; sourceTree = "<group>"; };
    6868                 07969D9A17D14151007FF842 /* JSRTCErrorCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSRTCErrorCallback.h; sourceTree = "<group>"; };
     6864                07969D9917D14151007FF842 /* JSRTCPeerConnectionErrorCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSRTCPeerConnectionErrorCallback.cpp; sourceTree = "<group>"; };
     6865                07969D9A17D14151007FF842 /* JSRTCPeerConnectionErrorCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSRTCPeerConnectionErrorCallback.h; sourceTree = "<group>"; };
    68696866                07969D9B17D14151007FF842 /* JSRTCIceCandidate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSRTCIceCandidate.cpp; sourceTree = "<group>"; };
    68706867                07969D9C17D14151007FF842 /* JSRTCIceCandidate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSRTCIceCandidate.h; sourceTree = "<group>"; };
     
    83128309                4A6E9FC613C17D570046A7F8 /* FontFeatureSettings.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = FontFeatureSettings.h; sourceTree = "<group>"; };
    83138310                4A8C96EA0BE69032004EEFF0 /* FrameSelectionMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; name = FrameSelectionMac.mm; path = mac/FrameSelectionMac.mm; sourceTree = "<group>"; };
     8311                4A9755351858ED9B00BD6D15 /* RTCPeerConnectionErrorCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTCPeerConnectionErrorCallback.h; sourceTree = "<group>"; };
     8312                4A9755361858ED9B00BD6D15 /* RTCPeerConnectionErrorCallback.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = RTCPeerConnectionErrorCallback.idl; sourceTree = "<group>"; };
    83148313                4A9CC81516BB9AC600EC645A /* CSSDefaultStyleSheets.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSDefaultStyleSheets.cpp; sourceTree = "<group>"; };
    83158314                4A9CC81616BB9AC600EC645A /* CSSDefaultStyleSheets.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSDefaultStyleSheets.h; sourceTree = "<group>"; };
     
    1366913668                        isa = PBXGroup;
    1367013669                        children = (
     13670                                4A9755351858ED9B00BD6D15 /* RTCPeerConnectionErrorCallback.h */,
     13671                                4A9755361858ED9B00BD6D15 /* RTCPeerConnectionErrorCallback.idl */,
    1367113672                                0779BF0A18453168000B6AE7 /* HTMLMediaElementMediaStream.cpp */,
    1367213673                                0779BF0B18453168000B6AE7 /* HTMLMediaElementMediaStream.h */,
     
    1374213743                                07221B6D17CEC32700848E51 /* RTCDTMFToneChangeEvent.h */,
    1374313744                                07221B6E17CEC32700848E51 /* RTCDTMFToneChangeEvent.idl */,
    13744                                 07221B6F17CEC32700848E51 /* RTCErrorCallback.h */,
    13745                                 07221B7017CEC32700848E51 /* RTCErrorCallback.idl */,
    1374613745                                07221B7117CEC32700848E51 /* RTCIceCandidate.cpp */,
    1374713746                                07221B7217CEC32700848E51 /* RTCIceCandidate.h */,
     
    1391213911                                07969D9717D14151007FF842 /* JSRTCDTMFToneChangeEvent.cpp */,
    1391313912                                07969D9817D14151007FF842 /* JSRTCDTMFToneChangeEvent.h */,
    13914                                 07969D9917D14151007FF842 /* JSRTCErrorCallback.cpp */,
    13915                                 07969D9A17D14151007FF842 /* JSRTCErrorCallback.h */,
     13913                                07969D9917D14151007FF842 /* JSRTCPeerConnectionErrorCallback.cpp */,
     13914                                07969D9A17D14151007FF842 /* JSRTCPeerConnectionErrorCallback.h */,
    1391613915                                07969D9B17D14151007FF842 /* JSRTCIceCandidate.cpp */,
    1391713916                                07969D9C17D14151007FF842 /* JSRTCIceCandidate.h */,
     
    2326423263                                A871DE270A152AC800B12A68 /* HTMLHtmlElement.h in Headers */,
    2326523264                                A89570A016E9BD5900184E55 /* HTMLIdentifier.h in Headers */,
    23266                                 07969DB417D14151007FF842 /* JSRTCErrorCallback.h in Headers */,
     23265                                07969DB417D14151007FF842 /* JSRTCPeerConnectionErrorCallback.h in Headers */,
    2326723266                                A871DE2A0A152AC800B12A68 /* HTMLIFrameElement.h in Headers */,
    2326823267                                A8EA7D2D0A19385500A8EF5F /* HTMLImageElement.h in Headers */,
     
    2385423853                                B2FA3D950AB75A6F000E5AC4 /* JSSVGFETurbulenceElement.h in Headers */,
    2385523854                                B2FA3D970AB75A6F000E5AC4 /* JSSVGFilterElement.h in Headers */,
    23856                                 078E092217D14D1C00420AA1 /* RTCErrorCallback.h in Headers */,
    2385723855                                B27B28260CEF0C0700D39D54 /* JSSVGFontElement.h in Headers */,
    2385823856                                A83B79050CCAFF15000B0825 /* JSSVGFontFaceElement.h in Headers */,
     
    2687726875                                B6D9D27C14EAC0860090D75E /* JSFocusEvent.cpp in Sources */,
    2687826876                                FDA15EAB12B03EE1003A583A /* JSGainNode.cpp in Sources */,
    26879                                 07969DB317D14151007FF842 /* JSRTCErrorCallback.cpp in Sources */,
     26877                                07969DB317D14151007FF842 /* JSRTCPeerConnectionErrorCallback.cpp in Sources */,
    2688026878                                FE80DA630E9C4703000D6F75 /* JSGeolocation.cpp in Sources */,
    2688126879                                FE80D7AB0E9C1ED2000D6F75 /* JSGeolocationCustom.cpp in Sources */,
  • trunk/Source/WebCore/platform/mediastream/RTCPeerConnectionHandler.cpp

    r159769 r160553  
    11/*
    22 * Copyright (C) 2012 Google Inc. All rights reserved.
     3 * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    3536#include "RTCPeerConnectionHandler.h"
    3637
     38#include <wtf/NeverDestroyed.h>
     39
    3740namespace WebCore {
    3841class RTCPeerConnectionHandlerClient;
     
    4548CreatePeerConnectionHandler RTCPeerConnectionHandler::create = createHandler;
    4649
     50const AtomicString& RTCPeerConnectionHandler::incompatibleConstraintsErrorName()
     51{
     52    static NeverDestroyed<AtomicString> incompatibleConstraints("IncompatibleConstraintsError", AtomicString::ConstructFromLiteral);
     53    return incompatibleConstraints;
     54}
     55
     56const AtomicString& RTCPeerConnectionHandler::invalidSessionDescriptionErrorName()
     57{
     58    static NeverDestroyed<AtomicString> invalidSessionDescription("InvalidSessionDescriptionError", AtomicString::ConstructFromLiteral);
     59    return invalidSessionDescription;
     60}
     61
     62const AtomicString& RTCPeerConnectionHandler::incompatibleSessionDescriptionErrorName()
     63{
     64    static NeverDestroyed<AtomicString> incompatibleSessionDescription("IncompatibleSessionDescriptionError", AtomicString::ConstructFromLiteral);
     65    return incompatibleSessionDescription;
     66}
     67
     68const AtomicString& RTCPeerConnectionHandler::internalErrorName()
     69{
     70    static NeverDestroyed<AtomicString> internal("InternalError", AtomicString::ConstructFromLiteral);
     71    return internal;
     72}
     73
    4774} // namespace WebCore
    4875
  • trunk/Source/WebCore/platform/mediastream/RTCPeerConnectionHandler.h

    r159769 r160553  
    11/*
    22 * Copyright (C) 2012 Google Inc. All rights reserved.
     3 * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    7576    virtual ~RTCPeerConnectionHandler() { }
    7677
     78    static const AtomicString& incompatibleConstraintsErrorName();
     79    static const AtomicString& invalidSessionDescriptionErrorName();
     80    static const AtomicString& incompatibleSessionDescriptionErrorName();
     81    static const AtomicString& internalErrorName();
     82
    7783    virtual bool initialize(PassRefPtr<RTCConfiguration>, PassRefPtr<MediaConstraints>) = 0;
    7884
  • trunk/Source/WebCore/platform/mock/RTCNotifiersMock.cpp

    r159769 r160553  
    3030#include "RTCNotifiersMock.h"
    3131
     32#include "DOMError.h"
    3233#include "RTCDataChannelHandlerMock.h"
    3334#include "RTCSessionDescriptionDescriptor.h"
     
    3738namespace WebCore {
    3839
    39 SessionRequestNotifier::SessionRequestNotifier(PassRefPtr<RTCSessionDescriptionRequest> request, PassRefPtr<RTCSessionDescriptionDescriptor> descriptor)
     40SessionRequestNotifier::SessionRequestNotifier(PassRefPtr<RTCSessionDescriptionRequest> request, PassRefPtr<RTCSessionDescriptionDescriptor> descriptor, const String& errorName)
    4041    : m_request(request)
    4142    , m_descriptor(descriptor)
     43    , m_errorName(errorName)
    4244{
    4345}
     
    4850        m_request->requestSucceeded(m_descriptor);
    4951    else
    50         m_request->requestFailed("TEST_ERROR");
     52        m_request->requestFailed(m_errorName);
    5153}
    5254
    53 VoidRequestNotifier::VoidRequestNotifier(PassRefPtr<RTCVoidRequest> request, bool success)
     55VoidRequestNotifier::VoidRequestNotifier(PassRefPtr<RTCVoidRequest> request, bool success, const String& errorName)
    5456    : m_request(request)
    5557    , m_success(success)
     58    , m_errorName(errorName)
    5659{
    5760}
     
    6265        m_request->requestSucceeded();
    6366    else
    64         m_request->requestFailed("TEST_ERROR");
     67        m_request->requestFailed(m_errorName);
    6568}
    6669
  • trunk/Source/WebCore/platform/mock/RTCNotifiersMock.h

    r157892 r160553  
    3434#include <wtf/PassRefPtr.h>
    3535#include <wtf/RefPtr.h>
     36#include <wtf/text/WTFString.h>
    3637
    3738namespace WebCore {
     
    4344class SessionRequestNotifier : public MockNotifier {
    4445public:
    45     SessionRequestNotifier(PassRefPtr<RTCSessionDescriptionRequest>, PassRefPtr<RTCSessionDescriptionDescriptor>);
     46    SessionRequestNotifier(PassRefPtr<RTCSessionDescriptionRequest>, PassRefPtr<RTCSessionDescriptionDescriptor>, const String& = emptyString());
    4647
    4748    void fire() OVERRIDE;
     
    5051    RefPtr<RTCSessionDescriptionRequest> m_request;
    5152    RefPtr<RTCSessionDescriptionDescriptor> m_descriptor;
     53    String m_errorName;
    5254};
    5355
    5456class VoidRequestNotifier : public MockNotifier {
    5557public:
    56     VoidRequestNotifier(PassRefPtr<RTCVoidRequest>, bool);
     58    VoidRequestNotifier(PassRefPtr<RTCVoidRequest>, bool, const String& = emptyString());
    5759
    5860    void fire() OVERRIDE;
     
    6163    RefPtr<RTCVoidRequest> m_request;
    6264    bool m_success;
     65    String m_errorName;
    6366};
    6467
  • trunk/Source/WebCore/platform/mock/RTCPeerConnectionHandlerMock.cpp

    r160436 r160553  
    6868    RefPtr<SessionRequestNotifier> notifier;
    6969    if (constraints->getMandatoryConstraintValue("succeed", succeedValue) && succeedValue == "false")
    70         notifier = adoptRef(new SessionRequestNotifier(request, 0));
     70        notifier = adoptRef(new SessionRequestNotifier(request, 0, RTCPeerConnectionHandler::incompatibleConstraintsErrorName()));
    7171    else
    7272        notifier = adoptRef(new SessionRequestNotifier(request, RTCSessionDescriptionDescriptor::create("offer", "local")));
     
    8181    String succeedValue;
    8282    if (constraints->getMandatoryConstraintValue("succeed", succeedValue) && succeedValue == "false")
    83         notifier = adoptRef(new SessionRequestNotifier(request, 0));
     83        notifier = adoptRef(new SessionRequestNotifier(request, 0, RTCPeerConnectionHandler::incompatibleConstraintsErrorName()));
    8484    else
    8585        notifier = adoptRef(new SessionRequestNotifier(request, RTCSessionDescriptionDescriptor::create("answer", "local")));
Note: See TracChangeset for help on using the changeset viewer.