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

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

Issue 1439973006: Reland Fix leak of RTCPeerConnectionHandler if PeerConnection.close() is called from js.… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix bug and add expectation. Created 5 years, 1 month 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 #ifndef CONTENT_RENDERER_MEDIA_RTC_PEER_CONNECTION_HANDLER_H_ 5 #ifndef CONTENT_RENDERER_MEDIA_RTC_PEER_CONNECTION_HANDLER_H_
6 #define CONTENT_RENDERER_MEDIA_RTC_PEER_CONNECTION_HANDLER_H_ 6 #define CONTENT_RENDERER_MEDIA_RTC_PEER_CONNECTION_HANDLER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 const FirstSessionDescription& remote); 218 const FirstSessionDescription& remote);
219 219
220 // Virtual to allow mocks to override. 220 // Virtual to allow mocks to override.
221 virtual scoped_refptr<base::SingleThreadTaskRunner> signaling_thread() const; 221 virtual scoped_refptr<base::SingleThreadTaskRunner> signaling_thread() const;
222 222
223 void RunSynchronousClosureOnSignalingThread(const base::Closure& closure, 223 void RunSynchronousClosureOnSignalingThread(const base::Closure& closure,
224 const char* trace_event_name); 224 const char* trace_event_name);
225 225
226 base::ThreadChecker thread_checker_; 226 base::ThreadChecker thread_checker_;
227 227
228 // |client_| is a weak pointer, and is valid until stop() has returned. 228 // |client_| is a weak pointer to the blink object (blink::RTCPeerConnection)
229 blink::WebRTCPeerConnectionHandlerClient* client_; 229 // that owns this object.
230 // It is valid for the lifetime of this object.
231 blink::WebRTCPeerConnectionHandlerClient* const client_;
232 // True if this PeerConnection has been closed.
233 // After the PeerConnection has been closed, this object may no longer
234 // forward callbacks to blink.
235 bool is_closed_;
230 236
231 // |dependency_factory_| is a raw pointer, and is valid for the lifetime of 237 // |dependency_factory_| is a raw pointer, and is valid for the lifetime of
232 // RenderThreadImpl. 238 // RenderThreadImpl.
233 PeerConnectionDependencyFactory* const dependency_factory_; 239 PeerConnectionDependencyFactory* const dependency_factory_;
234 240
235 blink::WebFrame* frame_ = nullptr; 241 blink::WebFrame* frame_ = nullptr;
236 242
237 ScopedVector<WebRtcMediaStreamAdapter> local_streams_; 243 ScopedVector<WebRtcMediaStreamAdapter> local_streams_;
238 244
239 base::WeakPtr<PeerConnectionTracker> peer_connection_tracker_; 245 base::WeakPtr<PeerConnectionTracker> peer_connection_tracker_;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 bool ice_state_seen_[webrtc::PeerConnectionInterface::kIceConnectionMax] = {}; 277 bool ice_state_seen_[webrtc::PeerConnectionInterface::kIceConnectionMax] = {};
272 278
273 base::WeakPtrFactory<RTCPeerConnectionHandler> weak_factory_; 279 base::WeakPtrFactory<RTCPeerConnectionHandler> weak_factory_;
274 280
275 DISALLOW_COPY_AND_ASSIGN(RTCPeerConnectionHandler); 281 DISALLOW_COPY_AND_ASSIGN(RTCPeerConnectionHandler);
276 }; 282 };
277 283
278 } // namespace content 284 } // namespace content
279 285
280 #endif // CONTENT_RENDERER_MEDIA_RTC_PEER_CONNECTION_HANDLER_H_ 286 #endif // CONTENT_RENDERER_MEDIA_RTC_PEER_CONNECTION_HANDLER_H_
OLDNEW
« no previous file with comments | « content/renderer/media/mock_peer_connection_impl.h ('k') | content/renderer/media/rtc_peer_connection_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698