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

Unified Diff: webrtc/api/peerconnectioninterface.h

Issue 2834543005: Add comments about PeerConnection::Close and PeerConnectionObserver. (Closed)
Patch Set: Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/peerconnectioninterface.h
diff --git a/webrtc/api/peerconnectioninterface.h b/webrtc/api/peerconnectioninterface.h
index d30834dc5b4d91fda12e7afbaa354002e1b28995..e384fba3dbc2adbe4dabdc324e5d4624cdc9a424 100644
--- a/webrtc/api/peerconnectioninterface.h
+++ b/webrtc/api/peerconnectioninterface.h
@@ -753,6 +753,10 @@ class PeerConnectionInterface : public rtc::RefCountInterface {
// Terminates all media, closes the transports, and in general releases any
// resources used by the PeerConnection. This is an irreversible operation.
+ //
+ // Note that after this method completes, the PeerConnection will no longer
+ // use the PeerConnectionObserver interface passed in on construction, and
+ // thus the observer object can be safely destroyed.
virtual void Close() = 0;
protected:
@@ -880,6 +884,15 @@ class PeerConnectionFactoryInterface : public rtc::RefCountInterface {
virtual void SetOptions(const Options& options) = 0;
+ // |allocator| and |cert_generator| may be null, in which case default
+ // implementations will be used.
+ //
+ // |observer| must not be null.
+ //
+ // Note that this method does not take ownership of |observer|; it's the
+ // responsibility of the caller to delete it. It can be safely deleted after
+ // Close has been called on the returned PeerConnection, which ensures no
+ // more observer callbacks will be invoked.
virtual rtc::scoped_refptr<PeerConnectionInterface> CreatePeerConnection(
const PeerConnectionInterface::RTCConfiguration& configuration,
std::unique_ptr<cricket::PortAllocator> allocator,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698