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

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

Issue 1648763002: Create QuicSession (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 10 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
(Empty)
1 /*
2 * Copyright 2011 The WebRTC Project Authors. All rights reserved.
3 *
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11 #include "net/base/net_errors.h"
12
13 #include "webrtc/base/checks.h"
14 #include "webrtc/p2p/base/reliablequicstream.h"
15
16 namespace cricket {
17
18 ReliableQuicStream::ReliableQuicStream(net::QuicStreamId id,
19 net::QuicSession* session)
20 : net::ReliableQuicStream(id, session) {
21 RTC_DCHECK_NE(net::kCryptoStreamId, id);
22 }
23
24 ReliableQuicStream::~ReliableQuicStream() {}
25
26 void ReliableQuicStream::OnDataAvailable() {
27 struct iovec iov;
28 while (sequencer()->GetReadableRegions(&iov, 1) == 1) {
29 SignalDataReceived(id(), reinterpret_cast<const char*>(iov.iov_base),
30 iov.iov_len);
31 sequencer()->MarkConsumed(iov.iov_len);
32 }
33 }
pthatcher1 2016/01/30 03:01:52 Are you going to write a simple unit test for this
mikescarlett 2016/02/03 17:41:01 Yes I will.
34
35 void ReliableQuicStream::OnClose() {
36 net::ReliableQuicStream::OnClose();
37
38 SignalStreamClosed(id(), connection_error());
39 }
40
41 int ReliableQuicStream::Write(base::StringPiece data) {
42 // Writes the data, or buffers it.
43 WriteOrBufferData(data, false, nullptr);
44 if (!HasBufferedData()) {
45 return data.size();
46 }
47
48 return net::ERR_IO_PENDING;
pthatcher1 2016/01/30 03:01:52 Can you convert this to an rtc::StreamResult?
pthatcher1 2016/01/30 03:01:52 If prefer it in the reverse: if (HasBufferedData(
mikescarlett 2016/02/03 17:41:01 Reversed if statement.
mikescarlett 2016/02/03 17:41:01 Converted to rtc::StreamResult. Also changed the m
49 }
50
51 } // namespace cricket
OLDNEW
« webrtc/p2p/base/reliablequicstream.h ('K') | « webrtc/p2p/base/reliablequicstream.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698