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

Unified Diff: webrtc/media/sctp/sctpdataengine.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/media/sctp/sctpdataengine.h
diff --git a/webrtc/media/sctp/sctpdataengine.h b/webrtc/media/sctp/sctpdataengine.h
index 310d9747ae7e4728ba5b9918e74c261e23907a5d..8eb99564ca23d7fbacbe72d71e326e464c74a3f8 100644
--- a/webrtc/media/sctp/sctpdataengine.h
+++ b/webrtc/media/sctp/sctpdataengine.h
@@ -24,7 +24,7 @@ enum PreservedErrno {
};
} // namespace cricket
-#include "webrtc/base/buffer.h"
+#include "webrtc/base/copyonwritebuffer.h"
#include "webrtc/media/base/codec.h"
#include "webrtc/media/base/mediachannel.h"
#include "webrtc/media/base/mediaengine.h"
@@ -144,10 +144,10 @@ class SctpDataMediaChannel : public DataMediaChannel,
// sctp that will then post the network interface by OnMessage).
// Returns true iff successful data somewhere on the send-queue/network.
virtual bool SendData(const SendDataParams& params,
- const rtc::Buffer& payload,
+ const rtc::CopyOnWriteBuffer& payload,
SendDataResult* result = NULL);
// A packet is received from the network interface. Posted to OnMessage.
- virtual void OnPacketReceived(rtc::Buffer* packet,
+ virtual void OnPacketReceived(rtc::CopyOnWriteBuffer* packet,
const rtc::PacketTime& packet_time);
// Exposed to allow Post call from c-callbacks.
@@ -155,7 +155,7 @@ class SctpDataMediaChannel : public DataMediaChannel,
// Many of these things are unused by SCTP, but are needed to fulfill
// the MediaChannel interface.
- virtual void OnRtcpReceived(rtc::Buffer* packet,
+ virtual void OnRtcpReceived(rtc::CopyOnWriteBuffer* packet,
const rtc::PacketTime& packet_time) {}
virtual void OnReadyToSend(bool ready) {}
@@ -192,12 +192,12 @@ class SctpDataMediaChannel : public DataMediaChannel,
bool ResetStream(uint32_t ssrc);
// Called by OnMessage to send packet on the network.
- void OnPacketFromSctpToNetwork(rtc::Buffer* buffer);
+ void OnPacketFromSctpToNetwork(rtc::CopyOnWriteBuffer* buffer);
// Called by OnMessage to decide what to do with the packet.
void OnInboundPacketFromSctpToChannel(SctpInboundPacket* packet);
void OnDataFromSctpToChannel(const ReceiveDataParams& params,
- rtc::Buffer* buffer);
- void OnNotificationFromSctp(rtc::Buffer* buffer);
+ const rtc::CopyOnWriteBuffer& buffer);
+ void OnNotificationFromSctp(const rtc::CopyOnWriteBuffer& buffer);
void OnNotificationAssocChange(const sctp_assoc_change& change);
void OnStreamResetEvent(const struct sctp_stream_reset_event* evt);

Powered by Google App Engine
This is Rietveld 408576698