| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 return channel; | 60 return channel; |
| 61 } | 61 } |
| 62 | 62 |
| 63 RTCDataChannel* RTCDataChannel::create(ExecutionContext* context, WebRTCPeerConn
ectionHandler* peerConnectionHandler, const String& label, const WebRTCDataChann
elInit& init, ExceptionState& exceptionState) | 63 RTCDataChannel* RTCDataChannel::create(ExecutionContext* context, WebRTCPeerConn
ectionHandler* peerConnectionHandler, const String& label, const WebRTCDataChann
elInit& init, ExceptionState& exceptionState) |
| 64 { | 64 { |
| 65 OwnPtr<WebRTCDataChannelHandler> handler = adoptPtr(peerConnectionHandler->c
reateDataChannel(label, init)); | 65 OwnPtr<WebRTCDataChannelHandler> handler = adoptPtr(peerConnectionHandler->c
reateDataChannel(label, init)); |
| 66 if (!handler) { | 66 if (!handler) { |
| 67 exceptionState.throwDOMException(NotSupportedError, "RTCDataChannel is n
ot supported"); | 67 exceptionState.throwDOMException(NotSupportedError, "RTCDataChannel is n
ot supported"); |
| 68 return nullptr; | 68 return nullptr; |
| 69 } | 69 } |
| 70 RTCDataChannel* channel = new RTCDataChannel(context, handler.release()); | 70 RTCDataChannel* channel = new RTCDataChannel(context, std::move(handler)); |
| 71 channel->suspendIfNeeded(); | 71 channel->suspendIfNeeded(); |
| 72 | 72 |
| 73 return channel; | 73 return channel; |
| 74 } | 74 } |
| 75 | 75 |
| 76 RTCDataChannel::RTCDataChannel(ExecutionContext* context, PassOwnPtr<WebRTCDataC
hannelHandler> handler) | 76 RTCDataChannel::RTCDataChannel(ExecutionContext* context, PassOwnPtr<WebRTCDataC
hannelHandler> handler) |
| 77 : ActiveScriptWrappable(this) | 77 : ActiveScriptWrappable(this) |
| 78 , ActiveDOMObject(context) | 78 , ActiveDOMObject(context) |
| 79 , m_handler(std::move(handler)) | 79 , m_handler(std::move(handler)) |
| 80 , m_readyState(ReadyStateConnecting) | 80 , m_readyState(ReadyStateConnecting) |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 } | 389 } |
| 390 | 390 |
| 391 DEFINE_TRACE(RTCDataChannel) | 391 DEFINE_TRACE(RTCDataChannel) |
| 392 { | 392 { |
| 393 visitor->trace(m_scheduledEvents); | 393 visitor->trace(m_scheduledEvents); |
| 394 EventTargetWithInlineData::trace(visitor); | 394 EventTargetWithInlineData::trace(visitor); |
| 395 ActiveDOMObject::trace(visitor); | 395 ActiveDOMObject::trace(visitor); |
| 396 } | 396 } |
| 397 | 397 |
| 398 } // namespace blink | 398 } // namespace blink |
| OLD | NEW |