Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Side by Side Diff: net/tools/quic/quic_dispatcher.cc

Issue 678073004: Standardize usage of virtual/override/final specifiers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/tools/quic/quic_dispatcher.h ('k') | net/tools/quic/quic_dispatcher_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/debug/stack_trace.h" 9 #include "base/debug/stack_trace.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 14 matching lines...) Expand all
25 25
26 using base::StringPiece; 26 using base::StringPiece;
27 using std::make_pair; 27 using std::make_pair;
28 28
29 class DeleteSessionsAlarm : public EpollAlarm { 29 class DeleteSessionsAlarm : public EpollAlarm {
30 public: 30 public:
31 explicit DeleteSessionsAlarm(QuicDispatcher* dispatcher) 31 explicit DeleteSessionsAlarm(QuicDispatcher* dispatcher)
32 : dispatcher_(dispatcher) { 32 : dispatcher_(dispatcher) {
33 } 33 }
34 34
35 virtual int64 OnAlarm() override { 35 int64 OnAlarm() override {
36 EpollAlarm::OnAlarm(); 36 EpollAlarm::OnAlarm();
37 dispatcher_->DeleteSessions(); 37 dispatcher_->DeleteSessions();
38 return 0; 38 return 0;
39 } 39 }
40 40
41 private: 41 private:
42 QuicDispatcher* dispatcher_; 42 QuicDispatcher* dispatcher_;
43 }; 43 };
44 44
45 class QuicDispatcher::QuicFramerVisitor : public QuicFramerVisitorInterface { 45 class QuicDispatcher::QuicFramerVisitor : public QuicFramerVisitorInterface {
46 public: 46 public:
47 explicit QuicFramerVisitor(QuicDispatcher* dispatcher) 47 explicit QuicFramerVisitor(QuicDispatcher* dispatcher)
48 : dispatcher_(dispatcher), 48 : dispatcher_(dispatcher),
49 connection_id_(0) {} 49 connection_id_(0) {}
50 50
51 // QuicFramerVisitorInterface implementation 51 // QuicFramerVisitorInterface implementation
52 virtual void OnPacket() override {} 52 void OnPacket() override {}
53 virtual bool OnUnauthenticatedPublicHeader( 53 bool OnUnauthenticatedPublicHeader(
54 const QuicPacketPublicHeader& header) override { 54 const QuicPacketPublicHeader& header) override {
55 connection_id_ = header.connection_id; 55 connection_id_ = header.connection_id;
56 return dispatcher_->OnUnauthenticatedPublicHeader(header); 56 return dispatcher_->OnUnauthenticatedPublicHeader(header);
57 } 57 }
58 virtual bool OnUnauthenticatedHeader( 58 bool OnUnauthenticatedHeader(const QuicPacketHeader& header) override {
59 const QuicPacketHeader& header) override {
60 dispatcher_->OnUnauthenticatedHeader(header); 59 dispatcher_->OnUnauthenticatedHeader(header);
61 return false; 60 return false;
62 } 61 }
63 virtual void OnError(QuicFramer* framer) override { 62 void OnError(QuicFramer* framer) override {
64 DVLOG(1) << QuicUtils::ErrorToString(framer->error()); 63 DVLOG(1) << QuicUtils::ErrorToString(framer->error());
65 } 64 }
66 65
67 virtual bool OnProtocolVersionMismatch( 66 bool OnProtocolVersionMismatch(QuicVersion /*received_version*/) override {
68 QuicVersion /*received_version*/) override {
69 if (dispatcher_->time_wait_list_manager()->IsConnectionIdInTimeWait( 67 if (dispatcher_->time_wait_list_manager()->IsConnectionIdInTimeWait(
70 connection_id_)) { 68 connection_id_)) {
71 // Keep processing after protocol mismatch - this will be dealt with by 69 // Keep processing after protocol mismatch - this will be dealt with by
72 // the TimeWaitListManager. 70 // the TimeWaitListManager.
73 return true; 71 return true;
74 } else { 72 } else {
75 DLOG(DFATAL) << "Version mismatch, connection ID (" << connection_id_ 73 DLOG(DFATAL) << "Version mismatch, connection ID (" << connection_id_
76 << ") not in time wait list."; 74 << ") not in time wait list.";
77 return false; 75 return false;
78 } 76 }
79 } 77 }
80 78
81 // The following methods should never get called because we always return 79 // The following methods should never get called because we always return
82 // false from OnUnauthenticatedHeader(). As a result, we never process the 80 // false from OnUnauthenticatedHeader(). As a result, we never process the
83 // payload of the packet. 81 // payload of the packet.
84 virtual void OnPublicResetPacket( 82 void OnPublicResetPacket(const QuicPublicResetPacket& /*packet*/) override {
85 const QuicPublicResetPacket& /*packet*/) override {
86 DCHECK(false); 83 DCHECK(false);
87 } 84 }
88 virtual void OnVersionNegotiationPacket( 85 void OnVersionNegotiationPacket(
89 const QuicVersionNegotiationPacket& /*packet*/) override { 86 const QuicVersionNegotiationPacket& /*packet*/) override {
90 DCHECK(false); 87 DCHECK(false);
91 } 88 }
92 virtual void OnDecryptedPacket(EncryptionLevel level) override { 89 void OnDecryptedPacket(EncryptionLevel level) override { DCHECK(false); }
93 DCHECK(false); 90 bool OnPacketHeader(const QuicPacketHeader& /*header*/) override {
94 }
95 virtual bool OnPacketHeader(const QuicPacketHeader& /*header*/) override {
96 DCHECK(false); 91 DCHECK(false);
97 return false; 92 return false;
98 } 93 }
99 virtual void OnRevivedPacket() override { 94 void OnRevivedPacket() override { DCHECK(false); }
95 void OnFecProtectedPayload(StringPiece /*payload*/) override {
100 DCHECK(false); 96 DCHECK(false);
101 } 97 }
102 virtual void OnFecProtectedPayload(StringPiece /*payload*/) override { 98 bool OnStreamFrame(const QuicStreamFrame& /*frame*/) override {
103 DCHECK(false);
104 }
105 virtual bool OnStreamFrame(const QuicStreamFrame& /*frame*/) override {
106 DCHECK(false); 99 DCHECK(false);
107 return false; 100 return false;
108 } 101 }
109 virtual bool OnAckFrame(const QuicAckFrame& /*frame*/) override { 102 bool OnAckFrame(const QuicAckFrame& /*frame*/) override {
110 DCHECK(false); 103 DCHECK(false);
111 return false; 104 return false;
112 } 105 }
113 virtual bool OnCongestionFeedbackFrame( 106 bool OnCongestionFeedbackFrame(
114 const QuicCongestionFeedbackFrame& /*frame*/) override { 107 const QuicCongestionFeedbackFrame& /*frame*/) override {
115 DCHECK(false); 108 DCHECK(false);
116 return false; 109 return false;
117 } 110 }
118 virtual bool OnStopWaitingFrame( 111 bool OnStopWaitingFrame(const QuicStopWaitingFrame& /*frame*/) override {
119 const QuicStopWaitingFrame& /*frame*/) override {
120 DCHECK(false); 112 DCHECK(false);
121 return false; 113 return false;
122 } 114 }
123 virtual bool OnPingFrame(const QuicPingFrame& /*frame*/) override { 115 bool OnPingFrame(const QuicPingFrame& /*frame*/) override {
124 DCHECK(false); 116 DCHECK(false);
125 return false; 117 return false;
126 } 118 }
127 virtual bool OnRstStreamFrame(const QuicRstStreamFrame& /*frame*/) override { 119 bool OnRstStreamFrame(const QuicRstStreamFrame& /*frame*/) override {
128 DCHECK(false); 120 DCHECK(false);
129 return false; 121 return false;
130 } 122 }
131 virtual bool OnConnectionCloseFrame( 123 bool OnConnectionCloseFrame(
132 const QuicConnectionCloseFrame & /*frame*/) override { 124 const QuicConnectionCloseFrame& /*frame*/) override {
133 DCHECK(false); 125 DCHECK(false);
134 return false; 126 return false;
135 } 127 }
136 virtual bool OnGoAwayFrame(const QuicGoAwayFrame& /*frame*/) override { 128 bool OnGoAwayFrame(const QuicGoAwayFrame& /*frame*/) override {
137 DCHECK(false); 129 DCHECK(false);
138 return false; 130 return false;
139 } 131 }
140 virtual bool OnWindowUpdateFrame(const QuicWindowUpdateFrame& /*frame*/) 132 bool OnWindowUpdateFrame(const QuicWindowUpdateFrame& /*frame*/) override {
141 override {
142 DCHECK(false); 133 DCHECK(false);
143 return false; 134 return false;
144 } 135 }
145 virtual bool OnBlockedFrame(const QuicBlockedFrame& frame) override { 136 bool OnBlockedFrame(const QuicBlockedFrame& frame) override {
146 DCHECK(false); 137 DCHECK(false);
147 return false; 138 return false;
148 } 139 }
149 virtual void OnFecData(const QuicFecData& /*fec*/) override { 140 void OnFecData(const QuicFecData& /*fec*/) override { DCHECK(false); }
150 DCHECK(false); 141 void OnPacketComplete() override { DCHECK(false); }
151 }
152 virtual void OnPacketComplete() override {
153 DCHECK(false);
154 }
155 142
156 private: 143 private:
157 QuicDispatcher* dispatcher_; 144 QuicDispatcher* dispatcher_;
158 145
159 // Latched in OnUnauthenticatedPublicHeader for use later. 146 // Latched in OnUnauthenticatedPublicHeader for use later.
160 QuicConnectionId connection_id_; 147 QuicConnectionId connection_id_;
161 }; 148 };
162 149
163 QuicPacketWriter* QuicDispatcher::DefaultPacketWriterFactory::Create( 150 QuicPacketWriter* QuicDispatcher::DefaultPacketWriterFactory::Create(
164 QuicPacketWriter* writer, 151 QuicPacketWriter* writer,
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 framer_.set_version(time_wait_list_manager_->GetQuicVersionFromConnectionId( 399 framer_.set_version(time_wait_list_manager_->GetQuicVersionFromConnectionId(
413 header.connection_id)); 400 header.connection_id));
414 401
415 // Continue parsing the packet to extract the sequence number. Then 402 // Continue parsing the packet to extract the sequence number. Then
416 // send it to the time wait manager in OnUnathenticatedHeader. 403 // send it to the time wait manager in OnUnathenticatedHeader.
417 return true; 404 return true;
418 } 405 }
419 406
420 } // namespace tools 407 } // namespace tools
421 } // namespace net 408 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/quic_dispatcher.h ('k') | net/tools/quic/quic_dispatcher_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698