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

Side by Side Diff: net/quic/quic_message_stream.cc

Issue 474383003: Initial P2P implementation for WebRTC on QUIC prototype Base URL: https://chromium.googlesource.com/chromium/src.git@tests-squashed
Patch Set: Created 6 years, 4 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 | « net/quic/quic_message_stream.h ('k') | net/quic/quic_p2p_client_session.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "net/quic/quic_message_stream.h"
6
7 #include "net/base/iovec.h"
8
9 namespace net {
10
11 QuicMessageStream::QuicMessageStream(QuicStreamId id,
12 QuicSession* session,
13 ReadDelegate* delegate)
14 : QuicDataStream(id, session),
15 delegate_(delegate) {
16 DCHECK_NE(kCryptoStreamId, id);
17 }
18
19 QuicMessageStream::~QuicMessageStream() {
20 }
21
22 int QuicMessageStream::WriteStreamData(base::StringPiece data, bool fin) {
23 struct iovec iov = {const_cast<char*>(data.data()),
24 static_cast<size_t>(data.size())};
25 QuicConsumedData consumed_data = WritevData(&iov, 1, fin, NULL);
26 return consumed_data.bytes_consumed;
27 }
28
29 void QuicMessageStream::OnClose() {
30 delegate_->OnStreamClose(id());
31 }
32
33 uint32 QuicMessageStream::ProcessData(const char* data, uint32 data_len) {
34 delegate_->OnStreamRead(id(), data, data_len);
35 return data_len;
36 }
37
38 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_message_stream.h ('k') | net/quic/quic_p2p_client_session.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698