| OLD | NEW |
| 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 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 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/quic_chromium_packet_reader.h" | 23 #include "net/quic/quic_chromium_packet_reader.h" |
| 24 #include "net/quic/quic_config.h" | 24 #include "net/quic/quic_config.h" |
| 25 #include "net/quic/quic_spdy_stream.h" | 25 #include "net/quic/quic_spdy_stream.h" |
| 26 #include "net/tools/quic/quic_client_base.h" | 26 #include "net/tools/quic/quic_client_base.h" |
| 27 | 27 |
| 28 namespace net { | 28 namespace net { |
| 29 | 29 |
| 30 struct HttpRequestInfo; | 30 struct HttpRequestInfo; |
| 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 { |
| 36 class QuicClientPeer; | 37 class QuicClientPeer; |
| 37 } // namespace test | 38 } // namespace test |
| 38 | 39 |
| 39 class QuicSimpleClient : public QuicClientBase, | 40 class QuicSimpleClient : public QuicClientBase, |
| 40 public QuicSpdyStream::Visitor, | 41 public QuicSpdyStream::Visitor, |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 } | 161 } |
| 161 | 162 |
| 162 void set_store_response(bool val) { store_response_ = val; } | 163 void set_store_response(bool val) { store_response_ = val; } |
| 163 | 164 |
| 164 size_t latest_response_code() const; | 165 size_t latest_response_code() const; |
| 165 const std::string& latest_response_headers() const; | 166 const std::string& latest_response_headers() const; |
| 166 const std::string& latest_response_body() const; | 167 const std::string& latest_response_body() const; |
| 167 | 168 |
| 168 protected: | 169 protected: |
| 169 virtual QuicChromiumConnectionHelper* CreateQuicConnectionHelper(); | 170 virtual QuicChromiumConnectionHelper* CreateQuicConnectionHelper(); |
| 171 virtual QuicChromiumAlarmFactory* CreateQuicAlarmFactory(); |
| 170 virtual QuicPacketWriter* CreateQuicPacketWriter(); | 172 virtual QuicPacketWriter* CreateQuicPacketWriter(); |
| 171 | 173 |
| 172 private: | 174 private: |
| 173 friend class net::test::QuicClientPeer; | 175 friend class net::test::QuicClientPeer; |
| 174 | 176 |
| 175 // Specific QuicClient class for storing data to resend. | 177 // Specific QuicClient class for storing data to resend. |
| 176 class ClientQuicDataToResend : public QuicDataToResend { | 178 class ClientQuicDataToResend : public QuicDataToResend { |
| 177 public: | 179 public: |
| 178 // Takes ownership of |headers|. | 180 // Takes ownership of |headers|. |
| 179 ClientQuicDataToResend(HttpRequestInfo* headers, | 181 ClientQuicDataToResend(HttpRequestInfo* headers, |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 bool packet_reader_started_; | 262 bool packet_reader_started_; |
| 261 | 263 |
| 262 base::WeakPtrFactory<QuicSimpleClient> weak_factory_; | 264 base::WeakPtrFactory<QuicSimpleClient> weak_factory_; |
| 263 | 265 |
| 264 DISALLOW_COPY_AND_ASSIGN(QuicSimpleClient); | 266 DISALLOW_COPY_AND_ASSIGN(QuicSimpleClient); |
| 265 }; | 267 }; |
| 266 | 268 |
| 267 } // namespace net | 269 } // namespace net |
| 268 | 270 |
| 269 #endif // NET_TOOLS_QUIC_QUIC_SIMPLE_CLIENT_H_ | 271 #endif // NET_TOOLS_QUIC_QUIC_SIMPLE_CLIENT_H_ |
| OLD | NEW |