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_packet_writer.cc

Issue 2324833004: Define Stable API for WebRTC/Quartc (Closed)
Patch Set: Patch Set 4 : Create QuartcFactory. Made modification on the API. Change the constructor of QuartcS… Created 4 years, 2 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 // 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
3 // found in the LICENSE file.
4
5 #include "net/quic/quartc/quartc_packet_writer.h"
6
7 namespace net {
8 QuartcPacketWriter::QuartcPacketWriter(
9 QuartcSessionInterface::Transport* transport)
10 : transport_(transport) {}
11
12 WriteResult QuartcPacketWriter::WritePacket(const char* buffer,
13 size_t buf_len,
14 const IPAddress& self_address,
15 const IPEndPoint& peer_address,
16 PerPacketOptions* options) {
17 DCHECK(transport_);
18 int bytes_written = transport_->Write(buffer, buf_len);
19 if (bytes_written <= 0) {
20 return WriteResult(WRITE_STATUS_BLOCKED, EWOULDBLOCK);
21 }
22 return WriteResult(WRITE_STATUS_OK, bytes_written);
23 }
24
25 bool QuartcPacketWriter::IsWriteBlockedDataBuffered() const {
26 return false;
27 }
28
29 bool QuartcPacketWriter::IsWriteBlocked() const {
30 DCHECK(transport_);
31 return !transport_->CanWrite();
32 }
33
34 // TODO(zhihuang) To figure out what is the better value to return. The
35 // transport in WebRTC network layer may become the bottleneck when determining
36 // the MTU.
37 QuicByteCount QuartcPacketWriter::GetMaxPacketSize(
38 const IPEndPoint& peer_address) const {
39 return kMaxPacketSize;
40 }
41
42 void QuartcPacketWriter::SetWritable() {}
43
44 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698