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

Unified Diff: talk/session/media/mediasession.cc

Issue 1241973002: Use std::string references instead of copying contents. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fix use-after-free Created 5 years, 5 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 | « talk/media/webrtc/webrtcvideoengine2.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: talk/session/media/mediasession.cc
diff --git a/talk/session/media/mediasession.cc b/talk/session/media/mediasession.cc
index dc4f4080afc4bbcec5d24e5a8ffae6d57730dcaa..8d07e95a150d8a53e0190fd4f909d8b188b85137 100644
--- a/talk/session/media/mediasession.cc
+++ b/talk/session/media/mediasession.cc
@@ -529,7 +529,7 @@ static bool UpdateTransportInfoForBundle(const ContentGroup& bundle_group,
}
// We should definitely have a transport for the first content.
- std::string selected_content_name = *bundle_group.FirstContentName();
+ const std::string& selected_content_name = *bundle_group.FirstContentName();
const TransportInfo* selected_transport_info =
sdesc->GetTransportInfoByName(selected_content_name);
if (!selected_transport_info) {
@@ -537,9 +537,9 @@ static bool UpdateTransportInfoForBundle(const ContentGroup& bundle_group,
}
// Set the other contents to use the same ICE credentials.
- const std::string selected_ufrag =
+ const std::string& selected_ufrag =
selected_transport_info->description.ice_ufrag;
- const std::string selected_pwd =
+ const std::string& selected_pwd =
selected_transport_info->description.ice_pwd;
for (TransportInfos::iterator it =
sdesc->transport_infos().begin();
« no previous file with comments | « talk/media/webrtc/webrtcvideoengine2.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698