OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_simple_server.h" | 5 #include "net/tools/quic/quic_simple_server.h" |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 | 8 |
9 #include "net/base/ip_endpoint.h" | 9 #include "net/base/ip_endpoint.h" |
10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 } | 55 } |
56 | 56 |
57 private: | 57 private: |
58 QuicSimpleServerPacketWriter* shared_writer_; // Not owned. | 58 QuicSimpleServerPacketWriter* shared_writer_; // Not owned. |
59 }; | 59 }; |
60 | 60 |
61 } // namespace | 61 } // namespace |
62 | 62 |
63 QuicSimpleServer::QuicSimpleServer(const QuicConfig& config, | 63 QuicSimpleServer::QuicSimpleServer(const QuicConfig& config, |
64 const QuicVersionVector& supported_versions) | 64 const QuicVersionVector& supported_versions) |
65 : helper_(base::MessageLoop::current()->message_loop_proxy().get(), | 65 : helper_(base::MessageLoop::current()->task_runner().get(), |
66 &clock_, | 66 &clock_, |
67 QuicRandom::GetInstance()), | 67 QuicRandom::GetInstance()), |
68 config_(config), | 68 config_(config), |
69 crypto_config_(kSourceAddressTokenSecret, QuicRandom::GetInstance()), | 69 crypto_config_(kSourceAddressTokenSecret, QuicRandom::GetInstance()), |
70 supported_versions_(supported_versions), | 70 supported_versions_(supported_versions), |
71 read_pending_(false), | 71 read_pending_(false), |
72 synchronous_read_count_(0), | 72 synchronous_read_count_(0), |
73 read_buffer_(new IOBufferWithSize(kReadBufferSize)), | 73 read_buffer_(new IOBufferWithSize(kReadBufferSize)), |
74 weak_factory_(this) { | 74 weak_factory_(this) { |
75 Initialize(); | 75 Initialize(); |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 } | 212 } |
213 | 213 |
214 QuicEncryptedPacket packet(read_buffer_->data(), result, false); | 214 QuicEncryptedPacket packet(read_buffer_->data(), result, false); |
215 dispatcher_->ProcessPacket(server_address_, client_address_, packet); | 215 dispatcher_->ProcessPacket(server_address_, client_address_, packet); |
216 | 216 |
217 StartReading(); | 217 StartReading(); |
218 } | 218 } |
219 | 219 |
220 } // namespace tools | 220 } // namespace tools |
221 } // namespace net | 221 } // namespace net |
OLD | NEW |