Changeset 214627 in webkit
- Timestamp:
- Mar 30, 2017, 2:42:19 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 5 added
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/LayoutTests/ChangeLog ¶
r214626 r214627 1 2017-03-30 Youenn Fablet <youenn@apple.com> 2 3 Clean up RTCDataChannel 4 https://bugs.webkit.org/show_bug.cgi?id=169732 5 6 Reviewed by Chris Dumez. 7 8 * webrtc/datachannel/bufferedAmountLowThreshold-expected.txt: Added. 9 * webrtc/datachannel/bufferedAmountLowThreshold.html: Added. 10 1 11 2017-03-30 Chris Dumez <cdumez@apple.com> 2 12 -
TabularUnified trunk/LayoutTests/imported/w3c/ChangeLog ¶
r214490 r214627 1 2017-03-30 Youenn Fablet <youenn@apple.com> 2 3 Clean up RTCDataChannel 4 https://bugs.webkit.org/show_bug.cgi?id=169732 5 6 Reviewed by Chris Dumez. 7 8 * web-platform-tests/webrtc/RTCDataChannelEvent-constructor-expected.txt: 9 1 10 2017-03-28 Youenn Fablet <youenn@apple.com> 2 11 -
TabularUnified trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCDataChannelEvent-constructor-expected.txt ¶
r211930 r214627 1 1 2 FAIL RTCDataChannelEvent constructor without a required argument. Can't find variable: RTCDataChannelEvent 3 FAIL RTCDataChannelEvent constructor with channel passed as null. assert_throws: function "function () { new RTCDataChannelEvent('type', { channel: null }); }" threw object "ReferenceError: Can't find variable: RTCDataChannelEvent" ("ReferenceError") expected object "TypeError" ("TypeError") 4 FAIL RTCDataChannelEvent constructor with a channel passed as undefined. assert_throws: function "function () { new RTCDataChannelEvent('type', { channel: undefined }); }" threw object "ReferenceError: Can't find variable: RTCDataChannelEvent" ("ReferenceError") expected object "TypeError" ("TypeError") 5 FAIL RTCDataChannelEvent constructor with full arguments. Can't find variable: RTCDataChannelEvent 2 PASS RTCDataChannelEvent constructor without a required argument. 3 PASS RTCDataChannelEvent constructor with channel passed as null. 4 PASS RTCDataChannelEvent constructor with a channel passed as undefined. 5 PASS RTCDataChannelEvent constructor with full arguments. 6 6 -
TabularUnified trunk/LayoutTests/webrtc/datachannel/basic.html ¶
r214441 r214627 96 96 remoteChannel.onmessage = receiveMessages; 97 97 }; 98 }, (candidate) => { return candidate && candidate.candidate.toLowerCase().indexOf("udp") == -1;});98 }, { filterOutICECandidate: (candidate) => { return candidate && candidate.candidate.toLowerCase().indexOf("udp") == -1; } }); 99 99 }); 100 100 }, "Basic data channel exchange from offerer to receiver using UDP only"); … … 115 115 remoteChannel.onmessage = receiveMessages; 116 116 }; 117 }, (candidate) => { return candidate && candidate.candidate.toLowerCase().indexOf("tcp") == -1;});117 }, { filterOutICECandidate: (candidate) => { return candidate && candidate.candidate.toLowerCase().indexOf("tcp") == -1; } }); 118 118 }); 119 119 }, "Basic data channel exchange from offerer to receiver using TCP only"); … … 137 137 finishTest = resolve; 138 138 createConnections((localConnection) => { 139 var init = { ordered: true, maxPacketLifeTime: 10, maxRetransmitTime: 11, protocol: "whatever", negotiated: false, id: "id"};139 var init = { ordered: true, maxPacketLifeTime: 10, maxRetransmitTime: 11, protocol: "whatever", negotiated: false, id: 1 }; 140 140 localChannel = localConnection.createDataChannel('sendDataChannel', init); 141 141 localChannel.onopen = () => { sendMessages(localChannel) }; -
TabularUnified trunk/LayoutTests/webrtc/routines.js ¶
r214441 r214627 3 3 var remoteConnection; 4 4 5 function createConnections(setupLocalConnection, setupRemoteConnection, filterOutICECandidate) {5 function createConnections(setupLocalConnection, setupRemoteConnection, options = { }) { 6 6 localConnection = new RTCPeerConnection(); 7 localConnection.onicecandidate = (event) => { iceCallback1(event, filterOutICECandidate) };7 localConnection.onicecandidate = (event) => { iceCallback1(event, options.filterOutICECandidate) }; 8 8 setupLocalConnection(localConnection); 9 9 10 10 remoteConnection = new RTCPeerConnection(); 11 remoteConnection.onicecandidate = (event) => { iceCallback2(event, filterOutICECandidate) };11 remoteConnection.onicecandidate = (event) => { iceCallback2(event, options.filterOutICECandidate) }; 12 12 setupRemoteConnection(remoteConnection); 13 13 14 localConnection.createOffer().then( gotDescription1, onCreateSessionDescriptionError);14 localConnection.createOffer().then((desc) => gotDescription1(desc, options), onCreateSessionDescriptionError); 15 15 16 16 return [localConnection, remoteConnection] … … 28 28 } 29 29 30 function gotDescription1(desc )30 function gotDescription1(desc, options) 31 31 { 32 if (options.observeOffer) 33 options.observeOffer(desc); 34 32 35 localConnection.setLocalDescription(desc); 33 36 remoteConnection.setRemoteDescription(desc); 34 remoteConnection.createAnswer().then( gotDescription2, onCreateSessionDescriptionError);37 remoteConnection.createAnswer().then((desc) => gotDescription2(desc, options), onCreateSessionDescriptionError); 35 38 } 36 39 37 function gotDescription2(desc )40 function gotDescription2(desc, options) 38 41 { 42 if (options.observeAnswer) 43 options.observeAnswer(desc); 44 39 45 remoteConnection.setLocalDescription(desc); 40 46 localConnection.setRemoteDescription(desc); -
TabularUnified trunk/Source/JavaScriptCore/ChangeLog ¶
r214602 r214627 1 2017-03-30 Youenn Fablet <youenn@apple.com> 2 3 Clean up RTCDataChannel 4 https://bugs.webkit.org/show_bug.cgi?id=169732 5 6 Reviewed by Chris Dumez. 7 8 * runtime/CommonIdentifiers.h: Adding RTCDataChannelEvent. 9 1 10 2017-03-30 Saam Barati <sbarati@apple.com> 2 11 -
TabularUnified trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h ¶
r214289 r214627 101 101 macro(Reflect) \ 102 102 macro(RegExp) \ 103 macro(Request) \ 103 104 macro(Response) \ 104 macro(Request) \ 105 macro(RTCDataChannel) \ 106 macro(RTCDataChannelEvent) \ 105 107 macro(RTCDTMFToneChangeEvent) \ 106 108 macro(RTCIceCandidate) \ -
TabularUnified trunk/Source/WebCore/ChangeLog ¶
r214624 r214627 1 2017-03-30 Youenn Fablet <youenn@apple.com> and Jon Lee <jonlee@apple.com> 2 3 Clean up RTCDataChannel 4 https://bugs.webkit.org/show_bug.cgi?id=169732 5 6 Reviewed by Chris Dumez. 7 8 Test: webrtc/datachannel/datachannel-event.html 9 webrtc/datachannel/bufferedAmountLowThreshold.html 10 11 Making RTCDataChannel interface closer to the spec updating implementation accordingly. 12 See https://w3c.github.io/webrtc-pc/#rtcdatachannel. 13 In particular adding RTCDataChannelEvent constructor, and missing bufferedAmount related attributes. 14 Doing some additional cleaning refactoring. 15 16 Making bufferedAmountIsDecreasing take a bufferedAmount argument so that we get the actual value passed by 17 libwebrtc without needing to get it from the libwebrtc network thread again. 18 In the future, we should store the bufferedAmount value in RTCDataChannel and update its value on each libwebrtc 19 OnBufferedAmountChange. Special treatment may be needed when the data channel is closed, in which case the bufferedAmount should just be 20 updated to increase in the send method. 21 22 Added some FIXMEs as RTCDataChannel is not aligned with the spec related to send and bufferedAmount. 23 24 * Modules/mediastream/RTCDataChannel.cpp: 25 (WebCore::RTCDataChannel::send): 26 (WebCore::RTCDataChannel::close): 27 (WebCore::RTCDataChannel::didChangeReadyState): 28 (WebCore::RTCDataChannel::bufferedAmountIsDecreasing): 29 * Modules/mediastream/RTCDataChannel.h: 30 * Modules/mediastream/RTCDataChannel.idl: 31 * Modules/mediastream/RTCDataChannelEvent.cpp: 32 (WebCore::RTCDataChannelEvent::create): 33 (WebCore::RTCDataChannelEvent::RTCDataChannelEvent): 34 (WebCore::RTCDataChannelEvent::channel): 35 * Modules/mediastream/RTCDataChannelEvent.h: 36 * Modules/mediastream/RTCDataChannelEvent.idl: 37 * Modules/mediastream/RTCPeerConnection.idl: 38 * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp: 39 (WebCore::LibWebRTCDataChannelHandler::OnStateChange): 40 * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: 41 (WebCore::LibWebRTCMediaEndpoint::addDataChannel): 42 * WebCore.xcodeproj/project.pbxproj: 43 * dom/EventNames.h: 44 * platform/mediastream/RTCDataChannelHandler.h: 45 * platform/mediastream/RTCDataChannelHandlerClient.h: 46 * platform/mediastream/RTCDataChannelState.h: Added. 47 * platform/mediastream/RTCPeerConnectionHandlerClient.h: 48 * platform/mock/RTCDataChannelHandlerMock.cpp: 49 (WebCore::RTCDataChannelHandlerMock::setClient): 50 (WebCore::RTCDataChannelHandlerMock::close): 51 * platform/mock/RTCNotifiersMock.cpp: 52 (WebCore::IceConnectionNotifier::IceConnectionNotifier): 53 (WebCore::SignalingStateNotifier::SignalingStateNotifier): 54 (WebCore::DataChannelStateNotifier::DataChannelStateNotifier): 55 * platform/mock/RTCNotifiersMock.h: 56 1 57 2017-03-30 Javier Fernandez <jfernandez@igalia.com> 2 58 -
TabularUnified trunk/Source/WebCore/Modules/mediastream/RTCDataChannel.cpp ¶
r214508 r214627 1 1 /* 2 2 * Copyright (C) 2012 Google Inc. All rights reserved. 3 * Copyright (C) 2017 Apple Inc. All rights reserved. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 72 73 } 73 74 74 const AtomicString& RTCDataChannel::readyState() const75 {76 static NeverDestroyed<AtomicString> connectingState("connecting", AtomicString::ConstructFromLiteral);77 static NeverDestroyed<AtomicString> openState("open", AtomicString::ConstructFromLiteral);78 static NeverDestroyed<AtomicString> closingState("closing", AtomicString::ConstructFromLiteral);79 static NeverDestroyed<AtomicString> closedState("closed", AtomicString::ConstructFromLiteral);80 81 switch (m_readyState) {82 case ReadyStateConnecting:83 return connectingState;84 case ReadyStateOpen:85 return openState;86 case ReadyStateClosing:87 return closingState;88 case ReadyStateClosed:89 return closedState;90 }91 92 ASSERT_NOT_REACHED();93 return emptyAtom;94 }95 96 75 size_t RTCDataChannel::bufferedAmount() const 97 76 { 77 // FIXME: We should compute our own bufferedAmount and not count on m_handler which is made null at closing time. 78 if (m_stopped) 79 return 0; 98 80 return m_handler->bufferedAmount(); 99 81 } … … 125 107 ExceptionOr<void> RTCDataChannel::send(const String& data) 126 108 { 127 if (m_readyState != ReadyStateOpen) 109 // FIXME: We should only throw in Connected state. 110 if (m_readyState != RTCDataChannelState::Open) 128 111 return Exception { INVALID_STATE_ERR }; 129 112 … … 138 121 ExceptionOr<void> RTCDataChannel::send(ArrayBuffer& data) 139 122 { 140 if (m_readyState != ReadyStateOpen) 123 // FIXME: We should only throw in Connected state. 124 if (m_readyState != RTCDataChannelState::Open) 141 125 return Exception { INVALID_STATE_ERR }; 142 126 … … 157 141 ExceptionOr<void> RTCDataChannel::send(ArrayBufferView& data) 158 142 { 143 // FIXME: We should only throw in Connected state. 159 144 return send(*data.unsharedBuffer()); 160 145 } … … 172 157 173 158 m_stopped = true; 174 m_readyState = R eadyStateClosed;159 m_readyState = RTCDataChannelState::Closed; 175 160 176 161 m_handler->close(); … … 180 165 } 181 166 182 void RTCDataChannel::didChangeReadyState(R eadyState newState)183 { 184 if (m_stopped || m_readyState == R eadyStateClosed || m_readyState == newState)167 void RTCDataChannel::didChangeReadyState(RTCDataChannelState newState) 168 { 169 if (m_stopped || m_readyState == RTCDataChannelState::Closed || m_readyState == newState) 185 170 return; 186 171 … … 188 173 189 174 switch (m_readyState) { 190 case R eadyStateOpen:175 case RTCDataChannelState::Open: 191 176 scheduleDispatchEvent(Event::create(eventNames().openEvent, false, false)); 192 177 break; 193 case R eadyStateClosed:178 case RTCDataChannelState::Closed: 194 179 scheduleDispatchEvent(Event::create(eventNames().closeEvent, false, false)); 195 180 break; … … 232 217 } 233 218 234 void RTCDataChannel::bufferedAmountIsDecreasing( )235 { 236 if (m_stopped) 237 return; 238 239 if ( bufferedAmount()<= m_bufferedAmountLowThreshold)240 scheduleDispatchEvent(Event::create(eventNames().buffered AmountLowThresholdEvent, false, false));219 void RTCDataChannel::bufferedAmountIsDecreasing(size_t amount) 220 { 221 if (m_stopped) 222 return; 223 224 if (amount <= m_bufferedAmountLowThreshold) 225 scheduleDispatchEvent(Event::create(eventNames().bufferedamountlowEvent, false, false)); 241 226 } 242 227 -
TabularUnified trunk/Source/WebCore/Modules/mediastream/RTCDataChannel.h ¶
r214508 r214627 1 1 /* 2 2 * Copyright (C) 2012 Google Inc. All rights reserved. 3 * Copyright (C) 2017 Apple Inc. All rights reserved. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 58 59 59 60 String label() const { return m_label; } 60 const AtomicString& readyState() const;61 RTCDataChannelState readyState() const {return m_readyState; } 61 62 size_t bufferedAmount() const; 62 63 size_t bufferedAmountLowThreshold() const { return m_bufferedAmountLowThreshold; } … … 91 92 void stop() final; 92 93 const char* activeDOMObjectName() const final { return "RTCDataChannel"; } 93 bool canSuspendForDocumentSuspension() const final { return m_readyState == R eadyStateClosed; }94 bool canSuspendForDocumentSuspension() const final { return m_readyState == RTCDataChannelState::Closed; } 94 95 95 96 // RTCDataChannelHandlerClient API 96 void didChangeReadyState(R eadyState) final;97 void didChangeReadyState(RTCDataChannelState) final; 97 98 void didReceiveStringData(const String&) final; 98 99 void didReceiveRawData(const char*, size_t) final; 99 100 void didDetectError() final; 100 void bufferedAmountIsDecreasing( ) final;101 void bufferedAmountIsDecreasing(size_t) final; 101 102 102 103 std::unique_ptr<RTCDataChannelHandler> m_handler; 103 104 105 // FIXME: m_stopped is probably redundant with m_readyState. 104 106 bool m_stopped { false }; 105 106 ReadyState m_readyState { ReadyStateConnecting }; 107 RTCDataChannelState m_readyState { RTCDataChannelState::Connecting }; 107 108 108 109 enum class BinaryType { Blob, ArrayBuffer }; -
TabularUnified trunk/Source/WebCore/Modules/mediastream/RTCDataChannel.idl ¶
r214508 r214627 1 1 /* 2 2 * Copyright (C) 2012 Google Inc. All rights reserved. 3 * Copyright (C) 2017 Apple Inc. All rights reserved. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 26 27 ActiveDOMObject, 27 28 Conditional=WEB_RTC, 28 NoInterfaceObject,29 EnabledAtRuntime=PeerConnection, 29 30 ] interface RTCDataChannel : EventTarget { 30 readonly attribute DOMString label; 31 // FIXME: Add support for priority attribute. 32 33 readonly attribute USVString label; 31 34 readonly attribute boolean ordered; 32 35 readonly attribute unsigned short? maxPacketLifeTime; 33 36 readonly attribute unsigned short? maxRetransmits; 34 readonly attribute DOMString protocol;37 readonly attribute USVString protocol; 35 38 readonly attribute boolean negotiated; 36 39 readonly attribute unsigned short? id; 37 readonly attribute DOMStringreadyState;40 readonly attribute RTCDataChannelState readyState; 38 41 readonly attribute unsigned long bufferedAmount; 42 attribute unsigned long bufferedAmountLowThreshold; 39 43 40 44 [SetterMayThrowException] attribute DOMString binaryType; … … 43 47 [MayThrowException] void send(ArrayBufferView data); 44 48 [MayThrowException] void send(Blob data); 45 [MayThrowException] void send( DOMString data);49 [MayThrowException] void send(USVString data); 46 50 47 51 void close(); … … 51 55 attribute EventHandler onclose; 52 56 attribute EventHandler onmessage; 57 attribute EventHandler onbufferedamountlow; 53 58 }; 59 60 [ 61 Conditional=WEB_RTC, 62 EnabledAtRuntime=PeerConnection, 63 ImplementedAs=RTCDataChannelState 64 ] enum RTCDataChannelState { 65 "connecting", 66 "open", 67 "closing", 68 "closed" 69 }; -
TabularUnified trunk/Source/WebCore/Modules/mediastream/RTCDataChannelEvent.cpp ¶
r210828 r214627 1 1 /* 2 2 * Copyright (C) 2012 Google Inc. All rights reserved. 3 * Copyright (C) 2017 Apple Inc. All rights reserved. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 37 38 } 38 39 40 Ref<RTCDataChannelEvent> RTCDataChannelEvent::create(const AtomicString& type, Init&& initializer, IsTrusted isTrusted) 41 { 42 return adoptRef(*new RTCDataChannelEvent(type, WTFMove(initializer), isTrusted)); 43 } 44 39 45 RTCDataChannelEvent::RTCDataChannelEvent(const AtomicString& type, bool canBubble, bool cancelable, Ref<RTCDataChannel>&& channel) 40 46 : Event(type, canBubble, cancelable) … … 43 49 } 44 50 45 RTCDataChannel* RTCDataChannelEvent::channel() 51 RTCDataChannelEvent::RTCDataChannelEvent(const AtomicString& type, Init&& initializer, IsTrusted isTrusted) 52 : Event(type, initializer, isTrusted) 53 , m_channel(initializer.channel.releaseNonNull()) 46 54 { 47 return m_channel.ptr(); 55 } 56 57 RTCDataChannel& RTCDataChannelEvent::channel() 58 { 59 return m_channel.get(); 48 60 } 49 61 -
TabularUnified trunk/Source/WebCore/Modules/mediastream/RTCDataChannelEvent.h ¶
r208694 r214627 1 1 /* 2 2 * Copyright (C) 2012 Google Inc. All rights reserved. 3 * Copyright (C) 2017 Apple Inc. All rights reserved. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 33 34 namespace WebCore { 34 35 35 class RTCDataChannelEvent : public Event {36 class RTCDataChannelEvent final : public Event { 36 37 public: 38 struct Init : EventInit { 39 RefPtr<RTCDataChannel> channel; 40 }; 41 37 42 static Ref<RTCDataChannelEvent> create(const AtomicString& type, bool canBubble, bool cancelable, Ref<RTCDataChannel>&&); 43 static Ref<RTCDataChannelEvent> create(const AtomicString& type, Init&&, IsTrusted = IsTrusted::No); 38 44 39 RTCDataChannel *channel();45 RTCDataChannel& channel(); 40 46 41 47 virtual EventInterface eventInterface() const; … … 43 49 private: 44 50 RTCDataChannelEvent(const AtomicString& type, bool canBubble, bool cancelable, Ref<RTCDataChannel>&&); 51 RTCDataChannelEvent(const AtomicString& type, Init&&, IsTrusted); 45 52 46 53 Ref<RTCDataChannel> m_channel; -
TabularUnified trunk/Source/WebCore/Modules/mediastream/RTCDataChannelEvent.idl ¶
r214045 r214627 24 24 */ 25 25 26 // FIXME 169662: missing Constructor(DOMString type, RTCDataChannelEventInit eventInitDict)27 26 [ 28 NoInterfaceObject,29 27 Conditional=WEB_RTC, 30 EnabledAtRuntime=PeerConnection 28 Constructor(DOMString type, RTCDataChannelEventInit eventInitDict), 29 EnabledAtRuntime=PeerConnection, 31 30 ] interface RTCDataChannelEvent : Event { 32 31 readonly attribute RTCDataChannel channel; 33 32 }; 33 34 dictionary RTCDataChannelEventInit : EventInit { 35 required RTCDataChannel channel; 36 }; -
TabularUnified trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.idl ¶
r214441 r214627 43 43 USVString protocol = ""; 44 44 boolean negotiated = false; 45 unsigned short id;45 [EnforceRange] unsigned short id; 46 46 // FIXME 169644: missing priority 47 47 }; -
TabularUnified trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp ¶
r211371 r214627 65 65 void LibWebRTCDataChannelHandler::OnStateChange() 66 66 { 67 RTCDataChannel ::ReadyState state;67 RTCDataChannelState state; 68 68 switch (m_channel->state()) { 69 69 case webrtc::DataChannelInterface::kConnecting: 70 state = RTCDataChannel ::ReadyStateConnecting;70 state = RTCDataChannelState::Connecting; 71 71 break; 72 72 case webrtc::DataChannelInterface::kOpen: 73 state = RTCDataChannel ::ReadyStateOpen;73 state = RTCDataChannelState::Open; 74 74 break; 75 75 case webrtc::DataChannelInterface::kClosing: 76 state = RTCDataChannel ::ReadyStateClosing;76 state = RTCDataChannelState::Closing; 77 77 break; 78 78 case webrtc::DataChannelInterface::kClosed: 79 state = RTCDataChannel ::ReadyStateClosed;79 state = RTCDataChannelState::Closed; 80 80 break; 81 81 } … … 105 105 return; 106 106 ASSERT(m_client); 107 callOnMainThread([protectedClient = makeRef(*m_client) ] {108 protectedClient->bufferedAmountIsDecreasing( );107 callOnMainThread([protectedClient = makeRef(*m_client), amount = m_channel->buffered_amount()] { 108 protectedClient->bufferedAmountIsDecreasing(static_cast<size_t>(amount)); 109 109 }); 110 110 } -
TabularUnified trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp ¶
r214421 r214627 601 601 // FIXME: We should be able to write channel->didChangeReadyState(...) 602 602 RTCDataChannelHandlerClient& client = channel.get(); 603 client.didChangeReadyState(RTCDataChannel ::ReadyStateOpen);603 client.didChangeReadyState(RTCDataChannelState::Open); 604 604 }); 605 605 } -
TabularUnified trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj ¶
r214607 r214627 1440 1440 316DCB501E7910A6001B5F87 /* JSRTCSignalingState.h in Headers */ = {isa = PBXBuildFile; fileRef = 316DCB4A1E7910A6001B5F87 /* JSRTCSignalingState.h */; }; 1441 1441 316DCB8A1E7A6996001B5F87 /* RTCIceTransport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 316DCB881E7A6996001B5F87 /* RTCIceTransport.cpp */; }; 1442 316DE7021E83AE1D0084C261 /* RTCDataChannelState.h in Headers */ = {isa = PBXBuildFile; fileRef = 316DE7011E83AE1D0084C261 /* RTCDataChannelState.h */; }; 1442 1443 316FE0710E6CCBEE00BF6088 /* JSCSSKeyframeRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 316FE06D0E6CCBEE00BF6088 /* JSCSSKeyframeRule.cpp */; }; 1443 1444 316FE0720E6CCBEE00BF6088 /* JSCSSKeyframeRule.h in Headers */ = {isa = PBXBuildFile; fileRef = 316FE06E0E6CCBEE00BF6088 /* JSCSSKeyframeRule.h */; }; … … 8962 8963 316DCB891E7A6996001B5F87 /* RTCIceTransport.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = RTCIceTransport.idl; sourceTree = "<group>"; }; 8963 8964 316DCB8E1E7A6C79001B5F87 /* RTCIceTransportState.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = RTCIceTransportState.idl; sourceTree = "<group>"; }; 8965 316DE7011E83AE1D0084C261 /* RTCDataChannelState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTCDataChannelState.h; sourceTree = "<group>"; }; 8964 8966 316FE06D0E6CCBEE00BF6088 /* JSCSSKeyframeRule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCSSKeyframeRule.cpp; sourceTree = "<group>"; }; 8965 8967 316FE06E0E6CCBEE00BF6088 /* JSCSSKeyframeRule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCSSKeyframeRule.h; sourceTree = "<group>"; }; … … 16034 16036 07221BA217CF0AD400848E51 /* RTCDataChannelHandler.h */, 16035 16037 07221BA317CF0AD400848E51 /* RTCDataChannelHandlerClient.h */, 16038 316DE7011E83AE1D0084C261 /* RTCDataChannelState.h */, 16036 16039 07221BA417CF0AD400848E51 /* RTCDTMFSenderHandler.h */, 16037 16040 07221BA517CF0AD400848E51 /* RTCDTMFSenderHandlerClient.h */, … … 26809 26812 9B3A8872145632F9003AE8F5 /* DOMDOMSettableTokenList.h in Headers */, 26810 26813 7AABA25A14BC613300AA9A11 /* DOMEditor.h in Headers */, 26814 316DE7021E83AE1D0084C261 /* RTCDataChannelState.h in Headers */, 26811 26815 BC1BDF25156C18C7001C1243 /* DOMError.h in Headers */, 26812 26816 2ED609BD1145B07100C8684E /* DOMFormData.h in Headers */, -
TabularUnified trunk/Source/WebCore/dom/EventNames.h ¶
r214293 r214627 68 68 macro(blur) \ 69 69 macro(boundary) \ 70 macro(buffered AmountLowThreshold) \70 macro(bufferedamountlow) \ 71 71 macro(cached) \ 72 72 macro(cancel) \ -
TabularUnified trunk/Source/WebCore/platform/mediastream/RTCDataChannelHandler.h ¶
r214421 r214627 1 1 /* 2 2 * Copyright (C) 2012 Google Inc. All rights reserved. 3 * Copyright (C) 2017 Apple Inc. All rights reserved. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without -
TabularUnified trunk/Source/WebCore/platform/mediastream/RTCDataChannelHandlerClient.h ¶
r211371 r214627 1 1 /* 2 2 * Copyright (C) 2012 Google Inc. All rights reserved. 3 * Copyright (C) 2017 Apple Inc. All rights reserved. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 27 28 #if ENABLE(WEB_RTC) 28 29 30 #include "RTCDataChannelState.h" 29 31 #include <wtf/ThreadSafeRefCounted.h> 30 32 #include <wtf/text/WTFString.h> … … 34 36 class RTCDataChannelHandlerClient : public ThreadSafeRefCounted<RTCDataChannelHandlerClient> { 35 37 public: 36 enum ReadyState {37 ReadyStateConnecting = 0,38 ReadyStateOpen = 1,39 ReadyStateClosing = 2,40 ReadyStateClosed = 3,41 };42 43 38 virtual ~RTCDataChannelHandlerClient() { } 44 39 45 virtual void didChangeReadyState(R eadyState) = 0;40 virtual void didChangeReadyState(RTCDataChannelState) = 0; 46 41 virtual void didReceiveStringData(const String&) = 0; 47 42 virtual void didReceiveRawData(const char*, size_t) = 0; 48 43 virtual void didDetectError() = 0; 49 virtual void bufferedAmountIsDecreasing( ) = 0;44 virtual void bufferedAmountIsDecreasing(size_t) = 0; 50 45 }; 51 46 -
TabularUnified trunk/Source/WebCore/platform/mediastream/RTCPeerConnectionHandlerClient.h ¶
r214212 r214627 34 34 #if ENABLE(WEB_RTC) 35 35 36 #include "RTCIceConnectionState.h" 37 #include "RTCIceGatheringState.h" 38 #include "RTCSignalingState.h" 36 39 #include <wtf/PassRefPtr.h> 37 40 … … 44 47 class RTCPeerConnectionHandlerClient { 45 48 public: 46 enum SignalingState {47 SignalingStateStable = 1,48 SignalingStateHaveLocalOffer = 2,49 SignalingStateHaveRemoteOffer = 3,50 SignalingStateHaveLocalPrAnswer = 4,51 SignalingStateHaveRemotePrAnswer = 5,52 SignalingStateClosed = 6,53 };54 55 enum IceConnectionState {56 IceConnectionStateNew = 1,57 IceConnectionStateChecking = 2,58 IceConnectionStateConnected = 3,59 IceConnectionStateCompleted = 4,60 IceConnectionStateFailed = 5,61 IceConnectionStateDisconnected = 6,62 IceConnectionStateClosed = 763 };64 65 enum IceGatheringState {66 IceGatheringStateNew = 1,67 IceGatheringStateGathering = 2,68 IceGatheringStateComplete = 369 };70 71 49 virtual ~RTCPeerConnectionHandlerClient() { } 72 50 73 51 virtual void negotiationNeeded() = 0; 74 52 virtual void didGenerateIceCandidate(PassRefPtr<RTCIceCandidateDescriptor>) = 0; 75 virtual void didChangeSignalingState( SignalingState) = 0;76 virtual void didChangeIceGatheringState( IceGatheringState) = 0;77 virtual void didChangeIceConnectionState( IceConnectionState) = 0;53 virtual void didChangeSignalingState(RTCSignalingState) = 0; 54 virtual void didChangeIceGatheringState(RTCIceGatheringState) = 0; 55 virtual void didChangeIceConnectionState(RTCIceConnectionState) = 0; 78 56 virtual void didAddRemoteStream(PassRefPtr<MediaStreamPrivate>) = 0; 79 57 virtual void didRemoveRemoteStream(MediaStreamPrivate*) = 0; -
TabularUnified trunk/Source/WebCore/platform/mock/RTCDataChannelHandlerMock.cpp ¶
r208694 r214627 1 1 /* 2 * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies). 2 * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies). 3 * Copyright (C) 2017 Apple Inc. All rights reserved. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 25 26 26 27 #include "config.h" 28 #include "RTCDataChannelHandlerMock.h" 27 29 28 30 #if ENABLE(WEB_RTC) 29 30 #include "RTCDataChannelHandlerMock.h"31 31 32 32 #include "RTCDataChannelHandlerClient.h" … … 47 47 48 48 m_client = client; 49 RefPtr<DataChannelStateNotifier> notifier = adoptRef(new DataChannelStateNotifier(m_client, RTCDataChannelHandlerClient::ReadyStateOpen));50 m_timerEvents.append(adoptRef(new TimerEvent(this, notifier)));49 auto notifier = adoptRef(*new DataChannelStateNotifier(m_client, RTCDataChannelState::Open)); 50 m_timerEvents.append(adoptRef(new TimerEvent(this, WTFMove(notifier)))); 51 51 } 52 52 … … 65 65 void RTCDataChannelHandlerMock::close() 66 66 { 67 RefPtr<DataChannelStateNotifier> notifier = adoptRef(new DataChannelStateNotifier(m_client, RTCDataChannelHandlerClient::ReadyStateClosed));68 m_timerEvents.append(adoptRef(new TimerEvent(this, notifier)));67 auto notifier = adoptRef(*new DataChannelStateNotifier(m_client, RTCDataChannelState::Closed)); 68 m_timerEvents.append(adoptRef(new TimerEvent(this, WTFMove(notifier)))); 69 69 } 70 70 -
TabularUnified trunk/Source/WebCore/platform/mock/RTCNotifiersMock.cpp ¶
r198492 r214627 1 1 /* 2 * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies). 2 * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies). 3 * Copyright (C) 2017 Apple Inc. All rights reserved. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 68 69 } 69 70 70 IceConnectionNotifier::IceConnectionNotifier(RTCPeerConnectionHandlerClient* client, RTC PeerConnectionHandlerClient::IceConnectionState connectionState, RTCPeerConnectionHandlerClient::IceGatheringState gatheringState)71 IceConnectionNotifier::IceConnectionNotifier(RTCPeerConnectionHandlerClient* client, RTCIceConnectionState connectionState, RTCIceGatheringState gatheringState) 71 72 : m_client(client) 72 73 , m_connectionState(connectionState) … … 81 82 } 82 83 83 SignalingStateNotifier::SignalingStateNotifier(RTCPeerConnectionHandlerClient* client, RTC PeerConnectionHandlerClient::SignalingState signalingState)84 SignalingStateNotifier::SignalingStateNotifier(RTCPeerConnectionHandlerClient* client, RTCSignalingState signalingState) 84 85 : m_client(client) 85 86 , m_signalingState(signalingState) … … 102 103 } 103 104 104 DataChannelStateNotifier::DataChannelStateNotifier(RTCDataChannelHandlerClient* client, RTCDataChannel HandlerClient::ReadyState state)105 DataChannelStateNotifier::DataChannelStateNotifier(RTCDataChannelHandlerClient* client, RTCDataChannelState state) 105 106 : m_client(client) 106 107 , m_state(state) -
TabularUnified trunk/Source/WebCore/platform/mock/RTCNotifiersMock.h ¶
r214212 r214627 68 68 class IceConnectionNotifier : public MockNotifier { 69 69 public: 70 IceConnectionNotifier(RTCPeerConnectionHandlerClient*, RTC PeerConnectionHandlerClient::IceConnectionState, RTCPeerConnectionHandlerClient::IceGatheringState);70 IceConnectionNotifier(RTCPeerConnectionHandlerClient*, RTCIceConnectionState, RTCIceGatheringState); 71 71 72 72 void fire() override; … … 74 74 private: 75 75 RTCPeerConnectionHandlerClient* m_client; 76 RTC PeerConnectionHandlerClient::IceConnectionState m_connectionState;77 RTC PeerConnectionHandlerClient::IceGatheringState m_gatheringState;76 RTCIceConnectionState m_connectionState; 77 RTCIceGatheringState m_gatheringState; 78 78 }; 79 79 80 80 class SignalingStateNotifier : public MockNotifier { 81 81 public: 82 SignalingStateNotifier(RTCPeerConnectionHandlerClient*, RTC PeerConnectionHandlerClient::SignalingState);82 SignalingStateNotifier(RTCPeerConnectionHandlerClient*, RTCSignalingState); 83 83 84 84 void fire() override; … … 86 86 private: 87 87 RTCPeerConnectionHandlerClient* m_client; 88 RTC PeerConnectionHandlerClient::SignalingState m_signalingState;88 RTCSignalingState m_signalingState; 89 89 }; 90 90 … … 101 101 class DataChannelStateNotifier : public MockNotifier { 102 102 public: 103 DataChannelStateNotifier(RTCDataChannelHandlerClient*, RTCDataChannel HandlerClient::ReadyState);103 DataChannelStateNotifier(RTCDataChannelHandlerClient*, RTCDataChannelState); 104 104 105 105 void fire() override; … … 107 107 private: 108 108 RTCDataChannelHandlerClient* m_client; 109 RTCDataChannel HandlerClient::ReadyState m_state;109 RTCDataChannelState m_state; 110 110 }; 111 111
Note:
See TracChangeset
for help on using the changeset viewer.