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

Unified Diff: webrtc/api/objc/RTCDataChannel.mm

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/api/objc/RTCDataChannel.mm
diff --git a/webrtc/api/objc/RTCDataChannel.mm b/webrtc/api/objc/RTCDataChannel.mm
index 5778cb5b7afd19602c754c6467268cbd0c6c06a2..98599058ee8ebec28ba52f096ad3a816c56b8034 100644
--- a/webrtc/api/objc/RTCDataChannel.mm
+++ b/webrtc/api/objc/RTCDataChannel.mm
@@ -53,8 +53,8 @@ class DataChannelDelegateAdapter : public DataChannelObserver {
- (instancetype)initWithData:(NSData *)data isBinary:(BOOL)isBinary {
NSParameterAssert(data);
if (self = [super init]) {
- rtc::Buffer buffer(reinterpret_cast<const uint8_t*>(data.bytes),
- data.length);
+ rtc::CopyOnWriteBuffer buffer(
+ reinterpret_cast<const uint8_t*>(data.bytes), data.length);
_dataBuffer.reset(new webrtc::DataBuffer(buffer, isBinary));
}
return self;

Powered by Google App Engine
This is Rietveld 408576698