| 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 <utility> | 7 #include <utility> | 
| 8 | 8 | 
| 9 #include "base/debug/stack_trace.h" | 9 #include "base/debug/stack_trace.h" | 
| 10 #include "base/logging.h" | 10 #include "base/logging.h" | 
| (...skipping 12 matching lines...) Expand all  Loading... | 
| 23 using base::StringPiece; | 23 using base::StringPiece; | 
| 24 | 24 | 
| 25 namespace { | 25 namespace { | 
| 26 | 26 | 
| 27 // An alarm that informs the QuicDispatcher to delete old sessions. | 27 // An alarm that informs the QuicDispatcher to delete old sessions. | 
| 28 class DeleteSessionsAlarm : public QuicAlarm::Delegate { | 28 class DeleteSessionsAlarm : public QuicAlarm::Delegate { | 
| 29  public: | 29  public: | 
| 30   explicit DeleteSessionsAlarm(QuicDispatcher* dispatcher) | 30   explicit DeleteSessionsAlarm(QuicDispatcher* dispatcher) | 
| 31       : dispatcher_(dispatcher) {} | 31       : dispatcher_(dispatcher) {} | 
| 32 | 32 | 
| 33   QuicTime OnAlarm() override { | 33   void OnAlarm() override { dispatcher_->DeleteSessions(); } | 
| 34     dispatcher_->DeleteSessions(); |  | 
| 35     // Let the dispatcher register the alarm at appropriate time. |  | 
| 36     return QuicTime::Zero(); |  | 
| 37   } |  | 
| 38 | 34 | 
| 39  private: | 35  private: | 
| 40   // Not owned. | 36   // Not owned. | 
| 41   QuicDispatcher* dispatcher_; | 37   QuicDispatcher* dispatcher_; | 
| 42 | 38 | 
| 43   DISALLOW_COPY_AND_ASSIGN(DeleteSessionsAlarm); | 39   DISALLOW_COPY_AND_ASSIGN(DeleteSessionsAlarm); | 
| 44 }; | 40 }; | 
| 45 | 41 | 
| 46 }  // namespace | 42 }  // namespace | 
| 47 | 43 | 
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 482 | 478 | 
| 483 QuicPacketWriter* QuicDispatcher::CreatePerConnectionWriter() { | 479 QuicPacketWriter* QuicDispatcher::CreatePerConnectionWriter() { | 
| 484   return new QuicPerConnectionPacketWriter(writer_.get()); | 480   return new QuicPerConnectionPacketWriter(writer_.get()); | 
| 485 } | 481 } | 
| 486 | 482 | 
| 487 void QuicDispatcher::SetLastError(QuicErrorCode error) { | 483 void QuicDispatcher::SetLastError(QuicErrorCode error) { | 
| 488   last_error_ = error; | 484   last_error_ = error; | 
| 489 } | 485 } | 
| 490 | 486 | 
| 491 }  // namespace net | 487 }  // namespace net | 
| OLD | NEW | 
|---|