| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |