Change return type of RtpSenderInterface::SetParameters from bool to RTCError
Note that RTCErrorTypes are mapped to the following DOMException names:
INTERNAL_ERROR -> OperationError
UNSUPPORTED_PARAMETER -> OperationError
INVALID_STATE -> InvalidStateError
INVALID_MODIFICATION -> InvalidModificationError
INVALID_RANGE -> RangeError
Bug: webrtc:8772
Change-Id: I44e3fe2456b007b8fb227d37d74b07ba226a19e4
Reviewed-on: https://webrtc-review.googlesource.com/37141
Commit-Queue: Zach Stein <zstein@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21766}
diff --git a/api/rtpsenderinterface.h b/api/rtpsenderinterface.h
index a7d7edc..83e135f 100644
--- a/api/rtpsenderinterface.h
+++ b/api/rtpsenderinterface.h
@@ -21,6 +21,7 @@
#include "api/mediastreaminterface.h"
#include "api/mediatypes.h"
#include "api/proxy.h"
+#include "api/rtcerror.h"
#include "api/rtpparameters.h"
#include "rtc_base/refcount.h"
#include "rtc_base/scoped_ref_ptr.h"
@@ -54,7 +55,7 @@
virtual RtpParameters GetParameters() const = 0;
// Note that only a subset of the parameters can currently be changed. See
// rtpparameters.h
- virtual bool SetParameters(const RtpParameters& parameters) = 0;
+ virtual RTCError SetParameters(const RtpParameters& parameters) = 0;
// Returns null for a video sender.
virtual rtc::scoped_refptr<DtmfSenderInterface> GetDtmfSender() const = 0;
@@ -82,7 +83,7 @@
PROXY_CONSTMETHOD0(std::string, id)
PROXY_CONSTMETHOD0(std::vector<std::string>, stream_ids)
PROXY_CONSTMETHOD0(RtpParameters, GetParameters);
- PROXY_METHOD1(bool, SetParameters, const RtpParameters&)
+ PROXY_METHOD1(RTCError, SetParameters, const RtpParameters&)
PROXY_CONSTMETHOD0(rtc::scoped_refptr<DtmfSenderInterface>, GetDtmfSender);
PROXY_CONSTMETHOD0(int, AttachmentId);
END_PROXY_MAP()