Skip to content

Commit

Permalink
MediaStream API: Update RTCDataChannel to match the specification
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=120889

Patch by Thiago de Barros Lacerda <[email protected]> on 2013-09-14
Reviewed by Eric Carlson

Merged from https://chromium.googlesource.com/chromium/blink/+/c3862b0a83e20fc8b1f770c7e4a886a7cceb80d2
by Tommy Widenflycht.

According to WebRTC specification, RTCDataChannel must have the following new attributes:
boolean ordered
unsigned short maxRetransmitTime
unsigned short maxRetransmits
DOMString protocol
boolean negotiated
unsigned short id

and the following one was deprecated:
boolean reliable

Test updates will be landed with https://webkit.org/b/121102.

* Modules/mediastream/RTCDataChannel.cpp:
(WebCore::RTCDataChannel::ordered):
(WebCore::RTCDataChannel::maxRetransmitTime):
(WebCore::RTCDataChannel::maxRetransmits):
(WebCore::RTCDataChannel::protocol):
(WebCore::RTCDataChannel::negotiated):
(WebCore::RTCDataChannel::id):
* Modules/mediastream/RTCDataChannel.h:
* Modules/mediastream/RTCDataChannel.idl:
* platform/mediastream/RTCDataChannelHandler.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155792 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
[email protected] committed Sep 15, 2013
1 parent 4917883 commit d944159
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 5 deletions.
34 changes: 34 additions & 0 deletions Source/WebCore/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,37 @@
2013-09-14 Thiago de Barros Lacerda <[email protected]>

MediaStream API: Update RTCDataChannel to match the specification
https://bugs.webkit.org/show_bug.cgi?id=120889

Reviewed by Eric Carlson

Merged from https://chromium.googlesource.com/chromium/blink/+/c3862b0a83e20fc8b1f770c7e4a886a7cceb80d2
by Tommy Widenflycht.

According to WebRTC specification, RTCDataChannel must have the following new attributes:
boolean ordered
unsigned short maxRetransmitTime
unsigned short maxRetransmits
DOMString protocol
boolean negotiated
unsigned short id

and the following one was deprecated:
boolean reliable

Test updates will be landed with https://webkit.org/b/121102.

* Modules/mediastream/RTCDataChannel.cpp:
(WebCore::RTCDataChannel::ordered):
(WebCore::RTCDataChannel::maxRetransmitTime):
(WebCore::RTCDataChannel::maxRetransmits):
(WebCore::RTCDataChannel::protocol):
(WebCore::RTCDataChannel::negotiated):
(WebCore::RTCDataChannel::id):
* Modules/mediastream/RTCDataChannel.h:
* Modules/mediastream/RTCDataChannel.idl:
* platform/mediastream/RTCDataChannelHandler.h:

2013-09-14 Sam Weinig <[email protected]>

[CTTE] Node subclasses should take a Document by reference in their constructor (Part 4)
Expand Down
29 changes: 27 additions & 2 deletions Source/WebCore/Modules/mediastream/RTCDataChannel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,34 @@ String RTCDataChannel::label() const
return m_handler->label();
}

bool RTCDataChannel::reliable() const
bool RTCDataChannel::ordered() const
{
return m_handler->isReliable();
return m_handler->ordered();
}

unsigned short RTCDataChannel::maxRetransmitTime() const
{
return m_handler->maxRetransmitTime();
}

unsigned short RTCDataChannel::maxRetransmits() const
{
return m_handler->maxRetransmits();
}

String RTCDataChannel::protocol() const
{
return m_handler->protocol();
}

bool RTCDataChannel::negotiated() const
{
return m_handler->negotiated();
}

unsigned short RTCDataChannel::id() const
{
return m_handler->id();
}

String RTCDataChannel::readyState() const
Expand Down
7 changes: 6 additions & 1 deletion Source/WebCore/Modules/mediastream/RTCDataChannel.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@ class RTCDataChannel : public RefCounted<RTCDataChannel>, public ScriptWrappable
~RTCDataChannel();

String label() const;
bool reliable() const;
bool ordered() const;
unsigned short maxRetransmitTime() const;
unsigned short maxRetransmits() const;
String protocol() const;
bool negotiated() const;
unsigned short id() const;
String readyState() const;
unsigned long bufferedAmount() const;

Expand Down
7 changes: 6 additions & 1 deletion Source/WebCore/Modules/mediastream/RTCDataChannel.idl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@
EventTarget
] interface RTCDataChannel {
readonly attribute DOMString label;
readonly attribute boolean reliable;
readonly attribute boolean ordered;
readonly attribute unsigned short maxRetransmitTime;
readonly attribute unsigned short maxRetransmits;
readonly attribute DOMString protocol;
readonly attribute boolean negotiated;
readonly attribute unsigned short id;
readonly attribute DOMString readyState;
readonly attribute unsigned long bufferedAmount;

Expand Down
7 changes: 6 additions & 1 deletion Source/WebCore/platform/mediastream/RTCDataChannelHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ class RTCDataChannelHandler {
virtual void setClient(RTCDataChannelHandlerClient*) = 0;

virtual String label() = 0;
virtual bool isReliable() = 0;
virtual bool ordered() = 0;
virtual unsigned short maxRetransmitTime() = 0;
virtual unsigned short maxRetransmits() = 0;
virtual String protocol() = 0;
virtual bool negotiated() = 0;
virtual unsigned short id() = 0;
virtual unsigned long bufferedAmount() = 0;

virtual bool sendStringData(const String&) = 0;
Expand Down

0 comments on commit d944159

Please sign in to comment.