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

Side by Side Diff: net/tools/quic/quic_default_packet_writer.cc

Issue 992733002: Remove //net (except for Android test stuff) and sdch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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/tools/quic/quic_default_packet_writer.h ('k') | net/tools/quic/quic_dispatcher.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/tools/quic/quic_default_packet_writer.h"
6
7 #include "net/tools/quic/quic_socket_utils.h"
8
9 namespace net {
10 namespace tools {
11
12 QuicDefaultPacketWriter::QuicDefaultPacketWriter(int fd)
13 : fd_(fd),
14 write_blocked_(false) {}
15
16 QuicDefaultPacketWriter::~QuicDefaultPacketWriter() {}
17
18 WriteResult QuicDefaultPacketWriter::WritePacket(
19 const char* buffer,
20 size_t buf_len,
21 const IPAddressNumber& self_address,
22 const IPEndPoint& peer_address) {
23 DCHECK(!IsWriteBlocked());
24 WriteResult result = QuicSocketUtils::WritePacket(
25 fd_, buffer, buf_len, self_address, peer_address);
26 if (result.status == WRITE_STATUS_BLOCKED) {
27 write_blocked_ = true;
28 }
29 return result;
30 }
31
32 bool QuicDefaultPacketWriter::IsWriteBlockedDataBuffered() const {
33 return false;
34 }
35
36 bool QuicDefaultPacketWriter::IsWriteBlocked() const {
37 return write_blocked_;
38 }
39
40 void QuicDefaultPacketWriter::SetWritable() {
41 write_blocked_ = false;
42 }
43
44 } // namespace tools
45 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/quic_default_packet_writer.h ('k') | net/tools/quic/quic_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698