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

Unified Diff: webrtc/pc/channel.h

Issue 1823503002: Reland Use CopyOnWriteBuffer instead of Buffer to avoid unnecessary copies. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: 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
Index: webrtc/pc/channel.h
diff --git a/webrtc/pc/channel.h b/webrtc/pc/channel.h
index 1937b0483fa43390be412856cb2e7c5d065ff595..45657f88ee0b07fc340e6ab753080306606a6783 100644
--- a/webrtc/pc/channel.h
+++ b/webrtc/pc/channel.h
@@ -191,10 +191,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);
@@ -210,10 +210,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();
@@ -502,7 +502,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);
@@ -516,8 +516,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.
@@ -534,7 +534,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),
@@ -543,7 +543,7 @@ class DataChannel : public BaseChannel {
}
const SendDataParams& params;
- const rtc::Buffer* payload;
+ const rtc::CopyOnWriteBuffer* payload;
SendDataResult* result;
bool succeeded;
};
@@ -558,7 +558,7 @@ class DataChannel : public BaseChannel {
payload(data, len) {
}
const ReceiveDataParams params;
- const rtc::Buffer payload;
+ const rtc::CopyOnWriteBuffer payload;
};
typedef rtc::TypedMessageData<bool> DataChannelReadyToSendMessageData;
@@ -581,7 +581,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;

Powered by Google App Engine
This is Rietveld 408576698