| 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 "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 return rc; | 118 return rc; |
| 119 } | 119 } |
| 120 | 120 |
| 121 DVLOG(1) << "Listening on " << server_address_.ToString(); | 121 DVLOG(1) << "Listening on " << server_address_.ToString(); |
| 122 | 122 |
| 123 socket_.swap(socket); | 123 socket_.swap(socket); |
| 124 | 124 |
| 125 dispatcher_.reset(new QuicSimpleDispatcher( | 125 dispatcher_.reset(new QuicSimpleDispatcher( |
| 126 config_, &crypto_config_, &version_manager_, | 126 config_, &crypto_config_, &version_manager_, |
| 127 std::unique_ptr<QuicConnectionHelperInterface>(helper_), | 127 std::unique_ptr<QuicConnectionHelperInterface>(helper_), |
| 128 std::unique_ptr<QuicServerSessionBase::Helper>( | 128 std::unique_ptr<QuicCryptoServerStream::Helper>( |
| 129 new QuicSimpleServerSessionHelper(QuicRandom::GetInstance())), | 129 new QuicSimpleServerSessionHelper(QuicRandom::GetInstance())), |
| 130 std::unique_ptr<QuicAlarmFactory>(alarm_factory_))); | 130 std::unique_ptr<QuicAlarmFactory>(alarm_factory_))); |
| 131 QuicSimpleServerPacketWriter* writer = | 131 QuicSimpleServerPacketWriter* writer = |
| 132 new QuicSimpleServerPacketWriter(socket_.get(), dispatcher_.get()); | 132 new QuicSimpleServerPacketWriter(socket_.get(), dispatcher_.get()); |
| 133 dispatcher_->InitializeWithWriter(writer); | 133 dispatcher_->InitializeWithWriter(writer); |
| 134 | 134 |
| 135 StartReading(); | 135 StartReading(); |
| 136 | 136 |
| 137 return OK; | 137 return OK; |
| 138 } | 138 } |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 } | 185 } |
| 186 | 186 |
| 187 QuicReceivedPacket packet(read_buffer_->data(), result, | 187 QuicReceivedPacket packet(read_buffer_->data(), result, |
| 188 helper_->GetClock()->Now(), false); | 188 helper_->GetClock()->Now(), false); |
| 189 dispatcher_->ProcessPacket(server_address_, client_address_, packet); | 189 dispatcher_->ProcessPacket(server_address_, client_address_, packet); |
| 190 | 190 |
| 191 StartReading(); | 191 StartReading(); |
| 192 } | 192 } |
| 193 | 193 |
| 194 } // namespace net | 194 } // namespace net |
| OLD | NEW |