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

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

Issue 2049003002: Wrap GCed raw pointer parameters of WTF::bind with Persistent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase. split RejectedPromise case to another CL. use wrapPersistent in HTMLSlotElement. Created 4 years, 6 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, wrapCrossThreadPersistent(errorCallback), wrapCrossThreadPersistent(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 1044 matching lines...) Expand 10 before | Expand all | Expand 10 after
1170 m_iceConnectionState = iceConnectionState; 1170 m_iceConnectionState = iceConnectionState;
1171 return true; 1171 return true;
1172 } 1172 }
1173 return false; 1173 return false;
1174 } 1174 }
1175 1175
1176 void RTCPeerConnection::changeIceConnectionState(ICEConnectionState iceConnectio nState) 1176 void RTCPeerConnection::changeIceConnectionState(ICEConnectionState iceConnectio nState)
1177 { 1177 {
1178 if (m_iceConnectionState != ICEConnectionStateClosed) { 1178 if (m_iceConnectionState != ICEConnectionStateClosed) {
1179 scheduleDispatchEvent(Event::create(EventTypeNames::iceconnectionstatech ange), 1179 scheduleDispatchEvent(Event::create(EventTypeNames::iceconnectionstatech ange),
1180 WTF::bind(&RTCPeerConnection::setIceConnectionState, this, iceConnec tionState)); 1180 WTF::bind(&RTCPeerConnection::setIceConnectionState, wrapCrossThread Persistent(this), iceConnectionState));
1181 } 1181 }
1182 } 1182 }
1183 1183
1184 void RTCPeerConnection::closeInternal() 1184 void RTCPeerConnection::closeInternal()
1185 { 1185 {
1186 DCHECK(m_signalingState != RTCPeerConnection::SignalingStateClosed); 1186 DCHECK(m_signalingState != RTCPeerConnection::SignalingStateClosed);
1187 m_peerHandler->stop(); 1187 m_peerHandler->stop();
1188 m_closed = true; 1188 m_closed = true;
1189 1189
1190 changeIceConnectionState(ICEConnectionStateClosed); 1190 changeIceConnectionState(ICEConnectionStateClosed);
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
1227 { 1227 {
1228 visitor->trace(m_localStreams); 1228 visitor->trace(m_localStreams);
1229 visitor->trace(m_remoteStreams); 1229 visitor->trace(m_remoteStreams);
1230 visitor->trace(m_dispatchScheduledEventRunner); 1230 visitor->trace(m_dispatchScheduledEventRunner);
1231 visitor->trace(m_scheduledEvents); 1231 visitor->trace(m_scheduledEvents);
1232 EventTargetWithInlineData::trace(visitor); 1232 EventTargetWithInlineData::trace(visitor);
1233 ActiveDOMObject::trace(visitor); 1233 ActiveDOMObject::trace(visitor);
1234 } 1234 }
1235 1235
1236 } // namespace blink 1236 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698