| 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 #include "net/tools/quic/quic_dispatcher.h" | 5 #include "net/tools/quic/quic_dispatcher.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| 11 #include "net/quic/quic_blocked_writer_interface.h" | 11 #include "net/quic/quic_blocked_writer_interface.h" |
| 12 #include "net/quic/quic_utils.h" | 12 #include "net/quic/quic_utils.h" |
| 13 #include "net/tools/quic/quic_epoll_connection_helper.h" | 13 #include "net/tools/quic/quic_epoll_connection_helper.h" |
| 14 #include "net/tools/quic/quic_socket_utils.h" | 14 #include "net/tools/quic/quic_socket_utils.h" |
| 15 | 15 |
| 16 namespace net { | 16 namespace net { |
| 17 namespace tools { | 17 namespace tools { |
| 18 | 18 |
| 19 using std::make_pair; | 19 using std::make_pair; |
| 20 | 20 |
| 21 class DeleteSessionsAlarm : public EpollAlarm { | 21 class DeleteSessionsAlarm : public EpollAlarm { |
| 22 public: | 22 public: |
| 23 explicit DeleteSessionsAlarm(QuicDispatcher* dispatcher) | 23 explicit DeleteSessionsAlarm(QuicDispatcher* dispatcher) |
| 24 : dispatcher_(dispatcher) { | 24 : dispatcher_(dispatcher) { |
| 25 } | 25 } |
| 26 | 26 |
| 27 virtual int64 OnAlarm() { | 27 virtual int64 OnAlarm() OVERRIDE { |
| 28 EpollAlarm::OnAlarm(); | 28 EpollAlarm::OnAlarm(); |
| 29 dispatcher_->DeleteSessions(); | 29 dispatcher_->DeleteSessions(); |
| 30 return 0; | 30 return 0; |
| 31 } | 31 } |
| 32 | 32 |
| 33 private: | 33 private: |
| 34 QuicDispatcher* dispatcher_; | 34 QuicDispatcher* dispatcher_; |
| 35 }; | 35 }; |
| 36 | 36 |
| 37 QuicDispatcher::QuicDispatcher(const QuicConfig& config, | 37 QuicDispatcher::QuicDispatcher(const QuicConfig& config, |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 new QuicEpollConnectionHelper(this, epoll_server); | 183 new QuicEpollConnectionHelper(this, epoll_server); |
| 184 return new QuicServerSession( | 184 return new QuicServerSession( |
| 185 config_, crypto_config_, | 185 config_, crypto_config_, |
| 186 new QuicConnection(guid, client_address, helper, true), this); | 186 new QuicConnection(guid, client_address, helper, true), this); |
| 187 } | 187 } |
| 188 | 188 |
| 189 } // namespace tools | 189 } // namespace tools |
| 190 } // namespace net | 190 } // namespace net |
| 191 | 191 |
| 192 | 192 |
| OLD | NEW |