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

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

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

Powered by Google App Engine
This is Rietveld 408576698