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

Unified Diff: webrtc/media/sctp/sctpdataengine.h

Issue 1995993002: Only initialize usrsctp when it's used and uninitialize when it's not being used. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Remove thread checker and add {}'s. 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
« no previous file with comments | « no previous file | webrtc/media/sctp/sctpdataengine.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/sctp/sctpdataengine.h
diff --git a/webrtc/media/sctp/sctpdataengine.h b/webrtc/media/sctp/sctpdataengine.h
index 8eb99564ca23d7fbacbe72d71e326e464c74a3f8..f9a3b5a6547e00dacbffafab6b0404311e608eb9 100644
--- a/webrtc/media/sctp/sctpdataengine.h
+++ b/webrtc/media/sctp/sctpdataengine.h
@@ -25,6 +25,7 @@ enum PreservedErrno {
} // namespace cricket
#include "webrtc/base/copyonwritebuffer.h"
+#include "webrtc/base/gtest_prod_util.h"
#include "webrtc/media/base/codec.h"
#include "webrtc/media/base/mediachannel.h"
#include "webrtc/media/base/mediaengine.h"
@@ -75,19 +76,13 @@ class SctpDataMediaChannel;
class SctpDataEngine : public DataEngineInterface, public sigslot::has_slots<> {
public:
SctpDataEngine();
- virtual ~SctpDataEngine();
+ ~SctpDataEngine() override;
- virtual DataMediaChannel* CreateChannel(DataChannelType data_channel_type);
-
- virtual const std::vector<DataCodec>& data_codecs() { return codecs_; }
-
- static int SendThresholdCallback(struct socket* sock, uint32_t sb_free);
+ DataMediaChannel* CreateChannel(DataChannelType data_channel_type) override;
+ const std::vector<DataCodec>& data_codecs() override { return codecs_; }
private:
- static int usrsctp_engines_count;
- std::vector<DataCodec> codecs_;
-
- static SctpDataMediaChannel* GetChannelFromSocket(struct socket* sock);
+ const std::vector<DataCodec> codecs_;
};
// TODO(ldixon): Make into a special type of TypedMessageData.
@@ -161,11 +156,16 @@ class SctpDataMediaChannel : public DataMediaChannel,
void OnSendThresholdCallback();
// Helper for debugging.
- void set_debug_name(const std::string& debug_name) {
+ void set_debug_name_for_testing(const char* debug_name) {
debug_name_ = debug_name;
}
- const std::string& debug_name() const { return debug_name_; }
const struct socket* socket() const { return sock_; }
+
+ private:
+ FRIEND_TEST_ALL_PREFIXES(SctpDataMediaChannelTest, EngineSignalsRightChannel);
+ static int SendThresholdCallback(struct socket* sock, uint32_t sb_free);
+ static SctpDataMediaChannel* GetChannelFromSocket(struct socket* sock);
+
private:
sockaddr_conn GetSctpSockAddr(int port);
@@ -229,8 +229,8 @@ class SctpDataMediaChannel : public DataMediaChannel,
StreamSet queued_reset_streams_;
StreamSet sent_reset_streams_;
- // A human-readable name for debugging messages.
- std::string debug_name_;
+ // A static human-readable name for debugging messages.
+ const char* debug_name_;
};
} // namespace cricket
« no previous file with comments | « no previous file | webrtc/media/sctp/sctpdataengine.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698