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

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

Issue 2603723002: Add a new QUIC platform API for text utilities. (Closed)
Patch Set: Tests Created 3 years, 12 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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/tools/quic/quic_client.h" 5 #include "net/tools/quic/quic_client.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <netinet/in.h> 8 #include <netinet/in.h>
9 #include <string.h> 9 #include <string.h>
10 #include <sys/epoll.h> 10 #include <sys/epoll.h>
11 #include <sys/socket.h> 11 #include <sys/socket.h>
12 #include <unistd.h> 12 #include <unistd.h>
13 13
14 #include "base/logging.h" 14 #include "base/logging.h"
15 #include "base/run_loop.h" 15 #include "base/run_loop.h"
16 #include "base/strings/string_number_conversions.h"
17 #include "net/base/sockaddr_storage.h" 16 #include "net/base/sockaddr_storage.h"
18 #include "net/quic/core/crypto/quic_random.h" 17 #include "net/quic/core/crypto/quic_random.h"
19 #include "net/quic/core/quic_bug_tracker.h" 18 #include "net/quic/core/quic_bug_tracker.h"
20 #include "net/quic/core/quic_connection.h" 19 #include "net/quic/core/quic_connection.h"
21 #include "net/quic/core/quic_data_reader.h" 20 #include "net/quic/core/quic_data_reader.h"
22 #include "net/quic/core/quic_flags.h" 21 #include "net/quic/core/quic_flags.h"
23 #include "net/quic/core/quic_packets.h" 22 #include "net/quic/core/quic_packets.h"
24 #include "net/quic/core/quic_server_id.h" 23 #include "net/quic/core/quic_server_id.h"
25 #include "net/quic/core/spdy_utils.h" 24 #include "net/quic/core/spdy_utils.h"
26 #include "net/tools/quic/platform/impl/quic_socket_utils.h" 25 #include "net/tools/quic/platform/impl/quic_socket_utils.h"
27 #include "net/tools/quic/quic_epoll_alarm_factory.h" 26 #include "net/tools/quic/quic_epoll_alarm_factory.h"
28 #include "net/tools/quic/quic_epoll_connection_helper.h" 27 #include "net/tools/quic/quic_epoll_connection_helper.h"
29 28
30 #ifndef SO_RXQ_OVFL 29 #ifndef SO_RXQ_OVFL
31 #define SO_RXQ_OVFL 40 30 #define SO_RXQ_OVFL 40
32 #endif 31 #endif
33 32
34 // TODO(rtenneti): Add support for MMSG_MORE. 33 // TODO(rtenneti): Add support for MMSG_MORE.
35 #define MMSG_MORE 0 34 #define MMSG_MORE 0
36 using base::StringPiece; 35 using base::StringPiece;
37 using base::StringToInt;
38 using std::string; 36 using std::string;
39 37
40 namespace net { 38 namespace net {
41 39
42 const int kEpollFlags = EPOLLIN | EPOLLOUT | EPOLLET; 40 const int kEpollFlags = EPOLLIN | EPOLLOUT | EPOLLET;
43 41
44 QuicClient::QuicClient(QuicSocketAddress server_address, 42 QuicClient::QuicClient(QuicSocketAddress server_address,
45 const QuicServerId& server_id, 43 const QuicServerId& server_id,
46 const QuicVersionVector& supported_versions, 44 const QuicVersionVector& supported_versions,
47 EpollServer* epoll_server, 45 EpollServer* epoll_server,
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 return fd_address_map_.back().first; 184 return fd_address_map_.back().first;
187 } 185 }
188 186
189 void QuicClient::ProcessPacket(const QuicSocketAddress& self_address, 187 void QuicClient::ProcessPacket(const QuicSocketAddress& self_address,
190 const QuicSocketAddress& peer_address, 188 const QuicSocketAddress& peer_address,
191 const QuicReceivedPacket& packet) { 189 const QuicReceivedPacket& packet) {
192 session()->ProcessUdpPacket(self_address, peer_address, packet); 190 session()->ProcessUdpPacket(self_address, peer_address, packet);
193 } 191 }
194 192
195 } // namespace net 193 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698