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

Unified Diff: webrtc/api/webrtcsession.h

Issue 2590753002: Implement current/pending session description methods. (Closed)
Patch Set: Fixing null pointer deref. Created 4 years 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 | « webrtc/api/peerconnectionproxy.h ('k') | webrtc/api/webrtcsession.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/webrtcsession.h
diff --git a/webrtc/api/webrtcsession.h b/webrtc/api/webrtcsession.h
index fa46ada883f744c908432fcdcdfee9a9f5ebeb3d..ef31560509879ec3abeb4705ee1c20a0ecb1cc72 100644
--- a/webrtc/api/webrtcsession.h
+++ b/webrtc/api/webrtcsession.h
@@ -247,10 +247,24 @@ class WebRtcSession :
void MaybeStartGathering();
const SessionDescriptionInterface* local_description() const {
- return local_desc_.get();
+ return pending_local_description_ ? pending_local_description_.get()
+ : current_local_description_.get();
}
const SessionDescriptionInterface* remote_description() const {
- return remote_desc_.get();
+ return pending_remote_description_ ? pending_remote_description_.get()
+ : current_remote_description_.get();
+ }
+ const SessionDescriptionInterface* current_local_description() const {
+ return current_local_description_.get();
+ }
+ const SessionDescriptionInterface* current_remote_description() const {
+ return current_remote_description_.get();
+ }
+ const SessionDescriptionInterface* pending_local_description() const {
+ return pending_local_description_.get();
+ }
+ const SessionDescriptionInterface* pending_remote_description() const {
+ return pending_remote_description_.get();
}
// Get the id used as a media stream track's "id" field from ssrc.
@@ -354,6 +368,17 @@ class WebRtcSession :
kAnswer,
};
+ // Non-const versions of local_description()/remote_description(), for use
+ // internally.
+ SessionDescriptionInterface* mutable_local_description() {
+ return pending_local_description_ ? pending_local_description_.get()
+ : current_local_description_.get();
+ }
+ SessionDescriptionInterface* mutable_remote_description() {
+ return pending_remote_description_ ? pending_remote_description_.get()
+ : current_remote_description_.get();
+ }
+
// Log session state.
void LogState(State old_state, State new_state);
@@ -519,8 +544,10 @@ class WebRtcSession :
IceObserver* ice_observer_;
PeerConnectionInterface::IceConnectionState ice_connection_state_;
bool ice_connection_receiving_;
- std::unique_ptr<SessionDescriptionInterface> local_desc_;
- std::unique_ptr<SessionDescriptionInterface> remote_desc_;
+ std::unique_ptr<SessionDescriptionInterface> current_local_description_;
+ std::unique_ptr<SessionDescriptionInterface> pending_local_description_;
+ std::unique_ptr<SessionDescriptionInterface> current_remote_description_;
+ std::unique_ptr<SessionDescriptionInterface> pending_remote_description_;
// If the remote peer is using a older version of implementation.
bool older_version_remote_peer_;
bool dtls_enabled_;
« no previous file with comments | « webrtc/api/peerconnectionproxy.h ('k') | webrtc/api/webrtcsession.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698