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

Side by Side Diff: net/tools/quic/quic_simple_client.h

Issue 2547233002: Add a QuicChromiumClock and make QuicClock abstract to match internal code. (Closed)
Patch Set: Created 4 years 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 // A toy client, which connects to a specified port and sends QUIC 5 // A toy client, which connects to a specified port and sends QUIC
6 // request to that endpoint. 6 // request to that endpoint.
7 7
8 #ifndef NET_TOOLS_QUIC_QUIC_SIMPLE_CLIENT_H_ 8 #ifndef NET_TOOLS_QUIC_QUIC_SIMPLE_CLIENT_H_
9 #define NET_TOOLS_QUIC_QUIC_SIMPLE_CLIENT_H_ 9 #define NET_TOOLS_QUIC_QUIC_SIMPLE_CLIENT_H_
10 10
11 #include <stddef.h> 11 #include <stddef.h>
12 12
13 #include <memory> 13 #include <memory>
14 #include <string> 14 #include <string>
15 15
16 #include "base/command_line.h" 16 #include "base/command_line.h"
17 #include "base/macros.h" 17 #include "base/macros.h"
18 #include "base/strings/string_piece.h" 18 #include "base/strings/string_piece.h"
19 #include "net/base/ip_address.h" 19 #include "net/base/ip_address.h"
20 #include "net/base/ip_endpoint.h" 20 #include "net/base/ip_endpoint.h"
21 #include "net/http/http_response_headers.h" 21 #include "net/http/http_response_headers.h"
22 #include "net/log/net_log.h" 22 #include "net/log/net_log.h"
23 #include "net/quic/chromium/quic_chromium_packet_reader.h" 23 #include "net/quic/chromium/quic_chromium_packet_reader.h"
24 #include "net/quic/core/quic_config.h" 24 #include "net/quic/core/quic_config.h"
25 #include "net/quic/core/quic_spdy_stream.h" 25 #include "net/quic/core/quic_spdy_stream.h"
26 #include "net/quic/platform/impl/quic_chromium_clock.h"
26 #include "net/tools/quic/quic_client_base.h" 27 #include "net/tools/quic/quic_client_base.h"
27 28
28 namespace net { 29 namespace net {
29 30
30 class QuicChromiumAlarmFactory; 31 class QuicChromiumAlarmFactory;
31 class QuicChromiumConnectionHelper; 32 class QuicChromiumConnectionHelper;
32 class UDPClientSocket; 33 class UDPClientSocket;
33 34
34 35
35 namespace test { 36 namespace test {
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 77
77 QuicChromiumAlarmFactory* CreateQuicAlarmFactory(); 78 QuicChromiumAlarmFactory* CreateQuicAlarmFactory();
78 QuicChromiumConnectionHelper* CreateQuicConnectionHelper(); 79 QuicChromiumConnectionHelper* CreateQuicConnectionHelper();
79 80
80 // Read a UDP packet and hand it to the framer. 81 // Read a UDP packet and hand it to the framer.
81 bool ReadAndProcessPacket(); 82 bool ReadAndProcessPacket();
82 83
83 void StartPacketReaderIfNotStarted(); 84 void StartPacketReaderIfNotStarted();
84 85
85 // Used by |helper_| to time alarms. 86 // Used by |helper_| to time alarms.
86 QuicClock clock_; 87 QuicChromiumClock clock_;
87 88
88 // Address of the client if the client is connected to the server. 89 // Address of the client if the client is connected to the server.
89 IPEndPoint client_address_; 90 IPEndPoint client_address_;
90 91
91 // UDP socket connected to the server. 92 // UDP socket connected to the server.
92 std::unique_ptr<UDPClientSocket> socket_; 93 std::unique_ptr<UDPClientSocket> socket_;
93 94
94 // Tracks if the client is initialized to connect. 95 // Tracks if the client is initialized to connect.
95 bool initialized_; 96 bool initialized_;
96 97
97 // The log used for the sockets. 98 // The log used for the sockets.
98 NetLog net_log_; 99 NetLog net_log_;
99 100
100 std::unique_ptr<QuicChromiumPacketReader> packet_reader_; 101 std::unique_ptr<QuicChromiumPacketReader> packet_reader_;
101 102
102 bool packet_reader_started_; 103 bool packet_reader_started_;
103 104
104 base::WeakPtrFactory<QuicSimpleClient> weak_factory_; 105 base::WeakPtrFactory<QuicSimpleClient> weak_factory_;
105 106
106 DISALLOW_COPY_AND_ASSIGN(QuicSimpleClient); 107 DISALLOW_COPY_AND_ASSIGN(QuicSimpleClient);
107 }; 108 };
108 109
109 } // namespace net 110 } // namespace net
110 111
111 #endif // NET_TOOLS_QUIC_QUIC_SIMPLE_CLIENT_H_ 112 #endif // NET_TOOLS_QUIC_QUIC_SIMPLE_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698