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

Side by Side Diff: content/renderer/media/rtc_peer_connection_handler.cc

Issue 1815363002: Add RetainedRef uses where needed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/media/rtc_peer_connection_handler.h" 5 #include "content/renderer/media/rtc_peer_connection_handler.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 1141 matching lines...) Expand 10 before | Expand all | Expand 10 after
1152 *first_remote_description_); 1152 *first_remote_description_);
1153 } 1153 }
1154 } 1154 }
1155 1155
1156 scoped_refptr<SetSessionDescriptionRequest> set_request( 1156 scoped_refptr<SetSessionDescriptionRequest> set_request(
1157 new rtc::RefCountedObject<SetSessionDescriptionRequest>( 1157 new rtc::RefCountedObject<SetSessionDescriptionRequest>(
1158 base::ThreadTaskRunnerHandle::Get(), request, 1158 base::ThreadTaskRunnerHandle::Get(), request,
1159 weak_factory_.GetWeakPtr(), peer_connection_tracker_, 1159 weak_factory_.GetWeakPtr(), peer_connection_tracker_,
1160 PeerConnectionTracker::ACTION_SET_LOCAL_DESCRIPTION)); 1160 PeerConnectionTracker::ACTION_SET_LOCAL_DESCRIPTION));
1161 1161
1162 signaling_thread()->PostTask(FROM_HERE, 1162 signaling_thread()->PostTask(
1163 base::Bind(&RunClosureWithTrace, 1163 FROM_HERE,
1164 base::Bind(
1165 &RunClosureWithTrace,
1164 base::Bind(&webrtc::PeerConnectionInterface::SetLocalDescription, 1166 base::Bind(&webrtc::PeerConnectionInterface::SetLocalDescription,
1165 native_peer_connection_, set_request, 1167 native_peer_connection_, base::RetainedRef(set_request),
1166 base::Unretained(native_desc)), 1168 base::Unretained(native_desc)),
1167 "SetLocalDescription")); 1169 "SetLocalDescription"));
1168 } 1170 }
1169 1171
1170 void RTCPeerConnectionHandler::setRemoteDescription( 1172 void RTCPeerConnectionHandler::setRemoteDescription(
1171 const blink::WebRTCVoidRequest& request, 1173 const blink::WebRTCVoidRequest& request,
1172 const blink::WebRTCSessionDescription& description) { 1174 const blink::WebRTCSessionDescription& description) {
1173 DCHECK(thread_checker_.CalledOnValidThread()); 1175 DCHECK(thread_checker_.CalledOnValidThread());
1174 TRACE_EVENT0("webrtc", "RTCPeerConnectionHandler::setRemoteDescription"); 1176 TRACE_EVENT0("webrtc", "RTCPeerConnectionHandler::setRemoteDescription");
1175 std::string sdp = base::UTF16ToUTF8(base::StringPiece16(description.sdp())); 1177 std::string sdp = base::UTF16ToUTF8(base::StringPiece16(description.sdp()));
1176 std::string type = 1178 std::string type =
(...skipping 26 matching lines...) Expand all
1203 *first_local_description_, 1205 *first_local_description_,
1204 *first_remote_description_); 1206 *first_remote_description_);
1205 } 1207 }
1206 } 1208 }
1207 1209
1208 scoped_refptr<SetSessionDescriptionRequest> set_request( 1210 scoped_refptr<SetSessionDescriptionRequest> set_request(
1209 new rtc::RefCountedObject<SetSessionDescriptionRequest>( 1211 new rtc::RefCountedObject<SetSessionDescriptionRequest>(
1210 base::ThreadTaskRunnerHandle::Get(), request, 1212 base::ThreadTaskRunnerHandle::Get(), request,
1211 weak_factory_.GetWeakPtr(), peer_connection_tracker_, 1213 weak_factory_.GetWeakPtr(), peer_connection_tracker_,
1212 PeerConnectionTracker::ACTION_SET_REMOTE_DESCRIPTION)); 1214 PeerConnectionTracker::ACTION_SET_REMOTE_DESCRIPTION));
1213 signaling_thread()->PostTask(FROM_HERE, 1215 signaling_thread()->PostTask(
1214 base::Bind(&RunClosureWithTrace, 1216 FROM_HERE,
1217 base::Bind(
1218 &RunClosureWithTrace,
1215 base::Bind(&webrtc::PeerConnectionInterface::SetRemoteDescription, 1219 base::Bind(&webrtc::PeerConnectionInterface::SetRemoteDescription,
1216 native_peer_connection_, set_request, 1220 native_peer_connection_, base::RetainedRef(set_request),
1217 base::Unretained(native_desc)), 1221 base::Unretained(native_desc)),
1218 "SetRemoteDescription")); 1222 "SetRemoteDescription"));
1219 } 1223 }
1220 1224
1221 blink::WebRTCSessionDescription 1225 blink::WebRTCSessionDescription
1222 RTCPeerConnectionHandler::localDescription() { 1226 RTCPeerConnectionHandler::localDescription() {
1223 DCHECK(thread_checker_.CalledOnValidThread()); 1227 DCHECK(thread_checker_.CalledOnValidThread());
1224 TRACE_EVENT0("webrtc", "RTCPeerConnectionHandler::localDescription"); 1228 TRACE_EVENT0("webrtc", "RTCPeerConnectionHandler::localDescription");
1225 1229
1226 // Since local_description returns a pointer to a non-reference-counted object 1230 // Since local_description returns a pointer to a non-reference-counted object
1227 // that lives on the signaling thread, we cannot fetch a pointer to it and use 1231 // that lives on the signaling thread, we cannot fetch a pointer to it and use
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after
1796 } 1800 }
1797 1801
1798 void RTCPeerConnectionHandler::ResetUMAStats() { 1802 void RTCPeerConnectionHandler::ResetUMAStats() {
1799 DCHECK(thread_checker_.CalledOnValidThread()); 1803 DCHECK(thread_checker_.CalledOnValidThread());
1800 num_local_candidates_ipv6_ = 0; 1804 num_local_candidates_ipv6_ = 0;
1801 num_local_candidates_ipv4_ = 0; 1805 num_local_candidates_ipv4_ = 0;
1802 ice_connection_checking_start_ = base::TimeTicks(); 1806 ice_connection_checking_start_ = base::TimeTicks();
1803 memset(ice_state_seen_, 0, sizeof(ice_state_seen_)); 1807 memset(ice_state_seen_, 0, sizeof(ice_state_seen_));
1804 } 1808 }
1805 } // namespace content 1809 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/gpu/gpu_benchmarking_extension.cc ('k') | content/renderer/service_worker/service_worker_context_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698