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

Unified Diff: webrtc/pc/channel.h

Issue 1785713005: Use CopyOnWriteBuffer instead of Buffer to avoid unnecessary copies. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Feedback from tommi. Created 4 years, 9 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 | « webrtc/media/sctp/sctpdataengine_unittest.cc ('k') | webrtc/pc/channel.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/pc/channel.h
diff --git a/webrtc/pc/channel.h b/webrtc/pc/channel.h
index a7c0a3e67a89a5d91edb015e5e1733f88a1d2147..3611602e782fc45e49ca141583c989425c10150a 100644
--- a/webrtc/pc/channel.h
+++ b/webrtc/pc/channel.h
@@ -190,10 +190,10 @@ class BaseChannel
void FlushRtcpMessages();
// NetworkInterface implementation, called by MediaEngine
- bool SendPacket(rtc::Buffer* packet,
- const rtc::PacketOptions& options) override;
- bool SendRtcp(rtc::Buffer* packet, const rtc::PacketOptions& options)
- override;
+ bool SendPacket(rtc::CopyOnWriteBuffer* packet,
+ const rtc::PacketOptions& options) override;
+ bool SendRtcp(rtc::CopyOnWriteBuffer* packet,
+ const rtc::PacketOptions& options) override;
// From TransportChannel
void OnWritableState(TransportChannel* channel);
@@ -209,10 +209,10 @@ class BaseChannel
bool PacketIsRtcp(const TransportChannel* channel, const char* data,
size_t len);
bool SendPacket(bool rtcp,
- rtc::Buffer* packet,
+ rtc::CopyOnWriteBuffer* packet,
const rtc::PacketOptions& options);
- virtual bool WantsPacket(bool rtcp, rtc::Buffer* packet);
- void HandlePacket(bool rtcp, rtc::Buffer* packet,
+ virtual bool WantsPacket(bool rtcp, const rtc::CopyOnWriteBuffer* packet);
+ void HandlePacket(bool rtcp, rtc::CopyOnWriteBuffer* packet,
const rtc::PacketTime& packet_time);
void EnableMedia_w();
@@ -493,7 +493,7 @@ class DataChannel : public BaseChannel {
bool Init();
virtual bool SendData(const SendDataParams& params,
- const rtc::Buffer& payload,
+ const rtc::CopyOnWriteBuffer& payload,
SendDataResult* result);
void StartMediaMonitor(int cms);
@@ -507,8 +507,8 @@ class DataChannel : public BaseChannel {
sigslot::signal2<DataChannel*, const DataMediaInfo&> SignalMediaMonitor;
sigslot::signal2<DataChannel*, const std::vector<ConnectionInfo>&>
SignalConnectionMonitor;
- sigslot::signal3<DataChannel*, const ReceiveDataParams&, const rtc::Buffer&>
- SignalDataReceived;
+ sigslot::signal3<DataChannel*, const ReceiveDataParams&,
+ const rtc::CopyOnWriteBuffer&> SignalDataReceived;
// Signal for notifying when the channel becomes ready to send data.
// That occurs when the channel is enabled, the transport is writable,
// both local and remote descriptions are set, and the channel is unblocked.
@@ -525,7 +525,7 @@ class DataChannel : public BaseChannel {
private:
struct SendDataMessageData : public rtc::MessageData {
SendDataMessageData(const SendDataParams& params,
- const rtc::Buffer* payload,
+ const rtc::CopyOnWriteBuffer* payload,
SendDataResult* result)
: params(params),
payload(payload),
@@ -534,7 +534,7 @@ class DataChannel : public BaseChannel {
}
const SendDataParams& params;
- const rtc::Buffer* payload;
+ const rtc::CopyOnWriteBuffer* payload;
SendDataResult* result;
bool succeeded;
};
@@ -549,7 +549,7 @@ class DataChannel : public BaseChannel {
payload(data, len) {
}
const ReceiveDataParams params;
- const rtc::Buffer payload;
+ const rtc::CopyOnWriteBuffer payload;
};
typedef rtc::TypedMessageData<bool> DataChannelReadyToSendMessageData;
@@ -572,7 +572,7 @@ class DataChannel : public BaseChannel {
ContentAction action,
std::string* error_desc);
virtual void ChangeState();
- virtual bool WantsPacket(bool rtcp, rtc::Buffer* packet);
+ virtual bool WantsPacket(bool rtcp, const rtc::CopyOnWriteBuffer* packet);
virtual void OnMessage(rtc::Message* pmsg);
virtual void GetSrtpCryptoSuites(std::vector<int>* crypto_suites) const;
« no previous file with comments | « webrtc/media/sctp/sctpdataengine_unittest.cc ('k') | webrtc/pc/channel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698