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

Unified Diff: talk/app/webrtc/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
« no previous file with comments | « no previous file | webrtc/api/datachannel.h » ('j') | webrtc/media/sctp/sctpdataengine.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: talk/app/webrtc/objc/RTCDataChannel.mm
diff --git a/talk/app/webrtc/objc/RTCDataChannel.mm b/talk/app/webrtc/objc/RTCDataChannel.mm
index 114b916fb467e1c7255464242853e5783d83e48e..6cfa5623c4b3df572405eb2e48789a802c92c7fe 100644
--- a/talk/app/webrtc/objc/RTCDataChannel.mm
+++ b/talk/app/webrtc/objc/RTCDataChannel.mm
@@ -153,8 +153,8 @@ std::string StdStringFromNSString(NSString* nsString) {
- (instancetype)initWithData:(NSData*)data isBinary:(BOOL)isBinary {
NSAssert(data, @"data cannot be nil");
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;
« no previous file with comments | « no previous file | webrtc/api/datachannel.h » ('j') | webrtc/media/sctp/sctpdataengine.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698