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

Side by Side Diff: net/quic/quartc/quartc_stream.cc

Issue 2740453006: Add QuicStringPiece which is actually StringPiece. (Closed)
Patch Set: fix compile error and rebase Created 3 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
« no previous file with comments | « net/quic/quartc/quartc_session_test.cc ('k') | net/quic/test_tools/crypto_test_utils.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/quic/quartc/quartc_stream.h" 5 #include "net/quic/quartc/quartc_stream.h"
6 #include "net/quic/platform/api/quic_string_piece.h"
6 7
7 namespace net { 8 namespace net {
8 9
9 QuartcStream::QuartcStream(QuicStreamId id, QuicSession* session) 10 QuartcStream::QuartcStream(QuicStreamId id, QuicSession* session)
10 : QuicStream(id, session) {} 11 : QuicStream(id, session) {}
11 QuartcStream::~QuartcStream() {} 12 QuartcStream::~QuartcStream() {}
12 13
13 void QuartcStream::OnDataAvailable() { 14 void QuartcStream::OnDataAvailable() {
14 struct iovec iov; 15 struct iovec iov;
15 while (sequencer()->GetReadableRegions(&iov, 1) == 1) { 16 while (sequencer()->GetReadableRegions(&iov, 1) == 1) {
(...skipping 30 matching lines...) Expand all
46 return queued_data_bytes(); 47 return queued_data_bytes();
47 } 48 }
48 49
49 bool QuartcStream::fin_sent() { 50 bool QuartcStream::fin_sent() {
50 return QuicStream::fin_sent(); 51 return QuicStream::fin_sent();
51 } 52 }
52 53
53 void QuartcStream::Write(const char* data, 54 void QuartcStream::Write(const char* data,
54 size_t size, 55 size_t size,
55 const WriteParameters& param) { 56 const WriteParameters& param) {
56 WriteOrBufferData(base::StringPiece(data, size), param.fin, nullptr); 57 WriteOrBufferData(QuicStringPiece(data, size), param.fin, nullptr);
57 } 58 }
58 59
59 void QuartcStream::Close() { 60 void QuartcStream::Close() {
60 QuicStream::session()->CloseStream(id()); 61 QuicStream::session()->CloseStream(id());
61 } 62 }
62 63
63 void QuartcStream::SetDelegate(QuartcStreamInterface::Delegate* delegate) { 64 void QuartcStream::SetDelegate(QuartcStreamInterface::Delegate* delegate) {
64 if (delegate_) { 65 if (delegate_) {
65 LOG(WARNING) << "The delegate for Stream " << id() 66 LOG(WARNING) << "The delegate for Stream " << id()
66 << " has already been set."; 67 << " has already been set.";
67 } 68 }
68 delegate_ = delegate; 69 delegate_ = delegate;
69 DCHECK(delegate_); 70 DCHECK(delegate_);
70 } 71 }
71 72
72 } // namespace net 73 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quartc/quartc_session_test.cc ('k') | net/quic/test_tools/crypto_test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698