Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(902)

Side by Side Diff: third_party/WebKit/Source/modules/mediastream/RTCDataChannel.cpp

Issue 1978173002: Remove OwnPtr::release() calls in modules/ (part 2). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698