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

Side by Side Diff: webrtc/api/sctputils.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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2013 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 #ifndef WEBRTC_API_SCTPUTILS_H_ 11 #ifndef WEBRTC_API_SCTPUTILS_H_
12 #define WEBRTC_API_SCTPUTILS_H_ 12 #define WEBRTC_API_SCTPUTILS_H_
13 13
14 #include <string> 14 #include <string>
15 15
16 #include "webrtc/api/datachannelinterface.h" 16 #include "webrtc/api/datachannelinterface.h"
17 17
18 namespace rtc { 18 namespace rtc {
19 class Buffer; 19 class CopyOnWriteBuffer;
20 } // namespace rtc 20 } // namespace rtc
21 21
22 namespace webrtc { 22 namespace webrtc {
23 struct DataChannelInit; 23 struct DataChannelInit;
24 24
25 // Read the message type and return true if it's an OPEN message. 25 // Read the message type and return true if it's an OPEN message.
26 bool IsOpenMessage(const rtc::Buffer& payload); 26 bool IsOpenMessage(const rtc::CopyOnWriteBuffer& payload);
27 27
28 bool ParseDataChannelOpenMessage(const rtc::Buffer& payload, 28 bool ParseDataChannelOpenMessage(const rtc::CopyOnWriteBuffer& payload,
29 std::string* label, 29 std::string* label,
30 DataChannelInit* config); 30 DataChannelInit* config);
31 31
32 bool ParseDataChannelOpenAckMessage(const rtc::Buffer& payload); 32 bool ParseDataChannelOpenAckMessage(const rtc::CopyOnWriteBuffer& payload);
33 33
34 bool WriteDataChannelOpenMessage(const std::string& label, 34 bool WriteDataChannelOpenMessage(const std::string& label,
35 const DataChannelInit& config, 35 const DataChannelInit& config,
36 rtc::Buffer* payload); 36 rtc::CopyOnWriteBuffer* payload);
37 37
38 void WriteDataChannelOpenAckMessage(rtc::Buffer* payload); 38 void WriteDataChannelOpenAckMessage(rtc::CopyOnWriteBuffer* payload);
39 } // namespace webrtc 39 } // namespace webrtc
40 40
41 #endif // WEBRTC_API_SCTPUTILS_H_ 41 #endif // WEBRTC_API_SCTPUTILS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698