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

Side by Side Diff: webrtc/pc/srtpfilter.h

Issue 2109893002: Reland: Remove global list of SRTP sessions. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Use libsrtp API to get/set userdata. Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | webrtc/pc/srtpfilter.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2009 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2009 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 #ifndef WEBRTC_PC_SRTPFILTER_H_ 11 #ifndef WEBRTC_PC_SRTPFILTER_H_
12 #define WEBRTC_PC_SRTPFILTER_H_ 12 #define WEBRTC_PC_SRTPFILTER_H_
13 13
14 #include <list> 14 #include <list>
15 #include <map> 15 #include <map>
16 #include <memory> 16 #include <memory>
17 #include <string> 17 #include <string>
18 #include <vector> 18 #include <vector>
19 19
20 #include "webrtc/base/basictypes.h" 20 #include "webrtc/base/basictypes.h"
21 #include "webrtc/base/constructormagic.h" 21 #include "webrtc/base/constructormagic.h"
22 #include "webrtc/base/criticalsection.h" 22 #include "webrtc/base/criticalsection.h"
23 #include "webrtc/base/sigslotrepeater.h" 23 #include "webrtc/base/sigslotrepeater.h"
24 #include "webrtc/base/sslstreamadapter.h" 24 #include "webrtc/base/sslstreamadapter.h"
25 #include "webrtc/base/thread_checker.h"
25 #include "webrtc/media/base/cryptoparams.h" 26 #include "webrtc/media/base/cryptoparams.h"
26 #include "webrtc/p2p/base/sessiondescription.h" 27 #include "webrtc/p2p/base/sessiondescription.h"
27 28
28 // Forward declaration to avoid pulling in libsrtp headers here 29 // Forward declaration to avoid pulling in libsrtp headers here
29 struct srtp_event_data_t; 30 struct srtp_event_data_t;
30 struct srtp_ctx_t; 31 struct srtp_ctx_t;
31 struct srtp_policy_t; 32 struct srtp_policy_t;
32 33
33 namespace cricket { 34 namespace cricket {
34 35
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 219
219 private: 220 private:
220 bool SetKey(int type, int cs, const uint8_t* key, int len); 221 bool SetKey(int type, int cs, const uint8_t* key, int len);
221 // Returns send stream current packet index from srtp db. 222 // Returns send stream current packet index from srtp db.
222 bool GetSendStreamPacketIndex(void* data, int in_len, int64_t* index); 223 bool GetSendStreamPacketIndex(void* data, int in_len, int64_t* index);
223 224
224 static bool Init(); 225 static bool Init();
225 void HandleEvent(const srtp_event_data_t* ev); 226 void HandleEvent(const srtp_event_data_t* ev);
226 static void HandleEventThunk(srtp_event_data_t* ev); 227 static void HandleEventThunk(srtp_event_data_t* ev);
227 228
228 static std::list<SrtpSession*>* sessions(); 229 rtc::ThreadChecker thread_checker_;
229
230 srtp_ctx_t* session_; 230 srtp_ctx_t* session_;
231 int rtp_auth_tag_len_; 231 int rtp_auth_tag_len_;
232 int rtcp_auth_tag_len_; 232 int rtcp_auth_tag_len_;
233 std::unique_ptr<SrtpStat> srtp_stat_; 233 std::unique_ptr<SrtpStat> srtp_stat_;
234 static bool inited_; 234 static bool inited_;
235 static rtc::GlobalLockPod lock_; 235 static rtc::GlobalLockPod lock_;
236 int last_send_seq_num_; 236 int last_send_seq_num_;
237 RTC_DISALLOW_COPY_AND_ASSIGN(SrtpSession); 237 RTC_DISALLOW_COPY_AND_ASSIGN(SrtpSession);
238 }; 238 };
239 239
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 std::map<FailureKey, FailureStat> failures_; 305 std::map<FailureKey, FailureStat> failures_;
306 // Threshold in ms to silent the signaling errors. 306 // Threshold in ms to silent the signaling errors.
307 int signal_silent_time_; 307 int signal_silent_time_;
308 308
309 RTC_DISALLOW_COPY_AND_ASSIGN(SrtpStat); 309 RTC_DISALLOW_COPY_AND_ASSIGN(SrtpStat);
310 }; 310 };
311 311
312 } // namespace cricket 312 } // namespace cricket
313 313
314 #endif // WEBRTC_PC_SRTPFILTER_H_ 314 #endif // WEBRTC_PC_SRTPFILTER_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/pc/srtpfilter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698