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

Unified Diff: webrtc/pc/channel.cc

Issue 1984983002: Remove use of RtpHeaderExtension and clean up (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Addressed comments Created 4 years, 7 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
Index: webrtc/pc/channel.cc
diff --git a/webrtc/pc/channel.cc b/webrtc/pc/channel.cc
index 67c16ec64aa1a47cb177e4ef6f3b4c7e5d8abec4..e32d24f19461d6ee02ff32fa73d3b76b876b6ff7 100644
--- a/webrtc/pc/channel.cc
+++ b/webrtc/pc/channel.cc
@@ -43,6 +43,20 @@ struct SendPacketMessageData : public rtc::MessageData {
rtc::PacketOptions options;
};
+#if defined(ENABLE_EXTERNAL_AUTH)
+// Returns the named header extension if found among all extensions,
+// empty extension otherwise.
+inline const webrtc::RtpExtension FindHeaderExtension(
danilchap 2016/05/18 20:00:09 why changing function signature and returning copy
danilchap 2016/05/18 20:00:09 no need for inline inside .cc
Irfan 2016/05/19 00:56:22 Done.
+ const std::vector<webrtc::RtpExtension>& extensions,
+ const std::string& uri) {
+ for (auto extension : extensions) {
danilchap 2016/05/18 20:00:09 const auto& to avoid unnecessary copy (and beeing
Irfan 2016/05/19 00:56:22 Done.
+ if (extension.uri == uri)
+ return extension;
+ }
+ return webrtc::RtpExtension();
+}
+#endif
+
} // namespace
enum {
@@ -1387,15 +1401,15 @@ bool BaseChannel::UpdateRemoteStreams_w(
}
void BaseChannel::MaybeCacheRtpAbsSendTimeHeaderExtension_w(
- const std::vector<RtpHeaderExtension>& extensions) {
+ const std::vector<webrtc::RtpExtension>& extensions) {
// Absolute Send Time extension id is used only with external auth,
// so do not bother searching for it and making asyncronious call to set
// something that is not used.
#if defined(ENABLE_EXTERNAL_AUTH)
- const RtpHeaderExtension* send_time_extension =
- FindHeaderExtension(extensions, kRtpAbsoluteSenderTimeHeaderExtension);
+ const webrtc::RtpExtension send_time_extension =
+ FindHeaderExtension(extensions, webrtc::RtpExtension::kAbsSendTimeUri);
int rtp_abs_sendtime_extn_id =
- send_time_extension ? send_time_extension->id : -1;
+ send_time_extension.id ? send_time_extension.id : -1;
invoker_.AsyncInvoke<void>(
network_thread_, Bind(&BaseChannel::CacheRtpAbsSendTimeHeaderExtension_n,
this, rtp_abs_sendtime_extn_id));

Powered by Google App Engine
This is Rietveld 408576698