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

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

Issue 1916283003: [K6] Replace bind() + GCed pointers with retainedRef() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Kuroneko_5c
Patch Set: Rebase 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 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 exceptionState.throwDOMException(InvalidStateError, kSignalingStateClose dMessage); 105 exceptionState.throwDOMException(InvalidStateError, kSignalingStateClose dMessage);
106 return true; 106 return true;
107 } 107 }
108 108
109 return false; 109 return false;
110 } 110 }
111 111
112 void asyncCallErrorCallback(RTCPeerConnectionErrorCallback* errorCallback, DOMEx ception* exception) 112 void asyncCallErrorCallback(RTCPeerConnectionErrorCallback* errorCallback, DOMEx ception* exception)
113 { 113 {
114 DCHECK(errorCallback); 114 DCHECK(errorCallback);
115 Microtask::enqueueMicrotask(bind(&RTCPeerConnectionErrorCallback::handleEven t, errorCallback, exception)); 115 Microtask::enqueueMicrotask(bind(&RTCPeerConnectionErrorCallback::handleEven t, retainedRef(errorCallback), retainedRef(exception)));
116 } 116 }
117 117
118 bool callErrorCallbackIfSignalingStateClosed(RTCPeerConnection::SignalingState s tate, RTCPeerConnectionErrorCallback* errorCallback) 118 bool callErrorCallbackIfSignalingStateClosed(RTCPeerConnection::SignalingState s tate, RTCPeerConnectionErrorCallback* errorCallback)
119 { 119 {
120 if (state == RTCPeerConnection::SignalingStateClosed) { 120 if (state == RTCPeerConnection::SignalingStateClosed) {
121 if (errorCallback) 121 if (errorCallback)
122 asyncCallErrorCallback(errorCallback, DOMException::create(InvalidSt ateError, kSignalingStateClosedMessage)); 122 asyncCallErrorCallback(errorCallback, DOMException::create(InvalidSt ateError, kSignalingStateClosedMessage));
123 123
124 return true; 124 return true;
125 } 125 }
(...skipping 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after
1156 m_iceConnectionState = iceConnectionState; 1156 m_iceConnectionState = iceConnectionState;
1157 return true; 1157 return true;
1158 } 1158 }
1159 return false; 1159 return false;
1160 } 1160 }
1161 1161
1162 void RTCPeerConnection::changeIceConnectionState(ICEConnectionState iceConnectio nState) 1162 void RTCPeerConnection::changeIceConnectionState(ICEConnectionState iceConnectio nState)
1163 { 1163 {
1164 if (m_iceConnectionState != ICEConnectionStateClosed) { 1164 if (m_iceConnectionState != ICEConnectionStateClosed) {
1165 scheduleDispatchEvent(Event::create(EventTypeNames::iceconnectionstatech ange), 1165 scheduleDispatchEvent(Event::create(EventTypeNames::iceconnectionstatech ange),
1166 WTF::bind(&RTCPeerConnection::setIceConnectionState, this, iceConnec tionState)); 1166 WTF::bind(&RTCPeerConnection::setIceConnectionState, retainedRef(thi s), iceConnectionState));
1167 } 1167 }
1168 } 1168 }
1169 1169
1170 void RTCPeerConnection::closeInternal() 1170 void RTCPeerConnection::closeInternal()
1171 { 1171 {
1172 DCHECK(m_signalingState != RTCPeerConnection::SignalingStateClosed); 1172 DCHECK(m_signalingState != RTCPeerConnection::SignalingStateClosed);
1173 m_peerHandler->stop(); 1173 m_peerHandler->stop();
1174 m_closed = true; 1174 m_closed = true;
1175 1175
1176 changeIceConnectionState(ICEConnectionStateClosed); 1176 changeIceConnectionState(ICEConnectionStateClosed);
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
1213 { 1213 {
1214 visitor->trace(m_localStreams); 1214 visitor->trace(m_localStreams);
1215 visitor->trace(m_remoteStreams); 1215 visitor->trace(m_remoteStreams);
1216 visitor->trace(m_dispatchScheduledEventRunner); 1216 visitor->trace(m_dispatchScheduledEventRunner);
1217 visitor->trace(m_scheduledEvents); 1217 visitor->trace(m_scheduledEvents);
1218 EventTargetWithInlineData::trace(visitor); 1218 EventTargetWithInlineData::trace(visitor);
1219 ActiveDOMObject::trace(visitor); 1219 ActiveDOMObject::trace(visitor);
1220 } 1220 }
1221 1221
1222 } // namespace blink 1222 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698