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

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

Issue 1009543004: Create a Perspective enum to use instead of a bool is_server to improve (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added NET_EXPORT_PRIVATE to fix compiler error Created 5 years, 9 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_crypto_client_stream_test.cc ('k') | net/quic/quic_crypto_server_stream_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/quic_crypto_server_stream.h" 5 #include "net/quic/quic_crypto_server_stream.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "crypto/secure_hash.h" 8 #include "crypto/secure_hash.h"
9 #include "net/quic/crypto/cached_network_parameters.h" 9 #include "net/quic/crypto/cached_network_parameters.h"
10 #include "net/quic/crypto/crypto_protocol.h" 10 #include "net/quic/crypto/crypto_protocol.h"
(...skipping 15 matching lines...) Expand all
26 } 26 }
27 27
28 QuicCryptoServerStream::QuicCryptoServerStream( 28 QuicCryptoServerStream::QuicCryptoServerStream(
29 const QuicCryptoServerConfig& crypto_config, 29 const QuicCryptoServerConfig& crypto_config,
30 QuicSession* session) 30 QuicSession* session)
31 : QuicCryptoStream(session), 31 : QuicCryptoStream(session),
32 crypto_config_(crypto_config), 32 crypto_config_(crypto_config),
33 validate_client_hello_cb_(nullptr), 33 validate_client_hello_cb_(nullptr),
34 num_handshake_messages_(0), 34 num_handshake_messages_(0),
35 num_server_config_update_messages_sent_(0) { 35 num_server_config_update_messages_sent_(0) {
36 DCHECK(session->connection()->is_server()); 36 DCHECK_EQ(Perspective::IS_SERVER, session->connection()->perspective());
37 } 37 }
38 38
39 QuicCryptoServerStream::~QuicCryptoServerStream() { 39 QuicCryptoServerStream::~QuicCryptoServerStream() {
40 CancelOutstandingCallbacks(); 40 CancelOutstandingCallbacks();
41 } 41 }
42 42
43 void QuicCryptoServerStream::CancelOutstandingCallbacks() { 43 void QuicCryptoServerStream::CancelOutstandingCallbacks() {
44 // Detach from the validation callback. Calling this multiple times is safe. 44 // Detach from the validation callback. Calling this multiple times is safe.
45 if (validate_client_hello_cb_ != nullptr) { 45 if (validate_client_hello_cb_ != nullptr) {
46 validate_client_hello_cb_->Cancel(); 46 validate_client_hello_cb_->Cancel();
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 252
253 void QuicCryptoServerStream::ValidateCallback::RunImpl( 253 void QuicCryptoServerStream::ValidateCallback::RunImpl(
254 const CryptoHandshakeMessage& client_hello, 254 const CryptoHandshakeMessage& client_hello,
255 const Result& result) { 255 const Result& result) {
256 if (parent_ != nullptr) { 256 if (parent_ != nullptr) {
257 parent_->FinishProcessingHandshakeMessage(client_hello, result); 257 parent_->FinishProcessingHandshakeMessage(client_hello, result);
258 } 258 }
259 } 259 }
260 260
261 } // namespace net 261 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_crypto_client_stream_test.cc ('k') | net/quic/quic_crypto_server_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698