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

Side by Side Diff: webrtc/p2p/quic/reliablequicstream.cc

Issue 1886383002: Make ReliableQuicStream::Write use base::StringPiece, not std::string (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2016 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
(...skipping 25 matching lines...) Expand all
36 36
37 void ReliableQuicStream::OnClose() { 37 void ReliableQuicStream::OnClose() {
38 net::ReliableQuicStream::OnClose(); 38 net::ReliableQuicStream::OnClose();
39 SignalClosed(id(), connection_error()); 39 SignalClosed(id(), connection_error());
40 } 40 }
41 41
42 rtc::StreamResult ReliableQuicStream::Write(const char* data, 42 rtc::StreamResult ReliableQuicStream::Write(const char* data,
43 size_t len, 43 size_t len,
44 bool fin) { 44 bool fin) {
45 // Writes the data, or buffers it. 45 // Writes the data, or buffers it.
46 WriteOrBufferData(std::string(data, len), fin, nullptr); 46 WriteOrBufferData(base::StringPiece(data, len), fin, nullptr);
47 if (HasBufferedData()) { 47 if (HasBufferedData()) {
48 return rtc::StreamResult(rtc::SR_BLOCK); 48 return rtc::StreamResult(rtc::SR_BLOCK);
49 } 49 }
50 return rtc::StreamResult(rtc::SR_SUCCESS); 50 return rtc::StreamResult(rtc::SR_SUCCESS);
51 } 51 }
52 52
53 void ReliableQuicStream::Close() { 53 void ReliableQuicStream::Close() {
54 net::ReliableQuicStream::session()->CloseStream(id()); 54 net::ReliableQuicStream::session()->CloseStream(id());
55 } 55 }
56 56
57 void ReliableQuicStream::OnCanWrite() { 57 void ReliableQuicStream::OnCanWrite() {
58 uint64_t prev_queued_bytes = queued_data_bytes(); 58 uint64_t prev_queued_bytes = queued_data_bytes();
59 net::ReliableQuicStream::OnCanWrite(); 59 net::ReliableQuicStream::OnCanWrite();
60 uint64_t queued_bytes_written = prev_queued_bytes - queued_data_bytes(); 60 uint64_t queued_bytes_written = prev_queued_bytes - queued_data_bytes();
61 SignalQueuedBytesWritten(id(), queued_bytes_written); 61 SignalQueuedBytesWritten(id(), queued_bytes_written);
62 } 62 }
63 63
64 } // namespace cricket 64 } // namespace cricket
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698