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

Side by Side Diff: net/quic/crypto/crypto_framer.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/crypto/common_cert_set.cc ('k') | net/quic/crypto/crypto_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 (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/quic/crypto/crypto_framer.h" 5 #include "net/quic/crypto/crypto_framer.h"
6 6
7 #include "net/quic/crypto/crypto_protocol.h" 7 #include "net/quic/crypto/crypto_protocol.h"
8 #include "net/quic/quic_data_reader.h" 8 #include "net/quic/quic_data_reader.h"
9 #include "net/quic/quic_data_writer.h" 9 #include "net/quic/quic_data_writer.h"
10 10
11 using base::StringPiece; 11 using base::StringPiece;
12 using std::make_pair; 12 using std::make_pair;
13 using std::pair; 13 using std::pair;
14 using std::vector; 14 using std::vector;
15 15
16 namespace net { 16 namespace net {
17 17
18 namespace { 18 namespace {
19 19
20 const size_t kQuicTagSize = sizeof(uint32); 20 const size_t kQuicTagSize = sizeof(uint32);
21 const size_t kCryptoEndOffsetSize = sizeof(uint32); 21 const size_t kCryptoEndOffsetSize = sizeof(uint32);
22 const size_t kNumEntriesSize = sizeof(uint16); 22 const size_t kNumEntriesSize = sizeof(uint16);
23 23
24 // OneShotVisitor is a framer visitor that records a single handshake message. 24 // OneShotVisitor is a framer visitor that records a single handshake message.
25 class OneShotVisitor : public CryptoFramerVisitorInterface { 25 class OneShotVisitor : public CryptoFramerVisitorInterface {
26 public: 26 public:
27 OneShotVisitor() : error_(false) {} 27 OneShotVisitor() : error_(false) {}
28 28
29 virtual void OnError(CryptoFramer* framer) override { error_ = true; } 29 void OnError(CryptoFramer* framer) override { error_ = true; }
30 30
31 virtual void OnHandshakeMessage( 31 void OnHandshakeMessage(const CryptoHandshakeMessage& message) override {
32 const CryptoHandshakeMessage& message) override {
33 out_.reset(new CryptoHandshakeMessage(message)); 32 out_.reset(new CryptoHandshakeMessage(message));
34 } 33 }
35 34
36 bool error() const { return error_; } 35 bool error() const { return error_; }
37 36
38 CryptoHandshakeMessage* release() { return out_.release(); } 37 CryptoHandshakeMessage* release() { return out_.release(); }
39 38
40 private: 39 private:
41 scoped_ptr<CryptoHandshakeMessage> out_; 40 scoped_ptr<CryptoHandshakeMessage> out_;
42 bool error_; 41 bool error_;
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 } 280 }
282 *end_offset += pad_length; 281 *end_offset += pad_length;
283 if (!writer->WriteUInt32(*end_offset)) { 282 if (!writer->WriteUInt32(*end_offset)) {
284 DCHECK(false) << "Failed to write end offset."; 283 DCHECK(false) << "Failed to write end offset.";
285 return false; 284 return false;
286 } 285 }
287 return true; 286 return true;
288 } 287 }
289 288
290 } // namespace net 289 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/crypto/common_cert_set.cc ('k') | net/quic/crypto/crypto_framer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698