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

Side by Side Diff: net/quic/quic_crypto_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_server_stream_test.cc ('k') | net/quic/quic_crypto_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_stream.h" 5 #include "net/quic/quic_crypto_stream.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/strings/string_piece.h" 9 #include "base/strings/string_piece.h"
10 #include "net/quic/crypto/crypto_handshake.h" 10 #include "net/quic/crypto/crypto_handshake.h"
11 #include "net/quic/crypto/crypto_utils.h" 11 #include "net/quic/crypto/crypto_utils.h"
12 #include "net/quic/quic_connection.h" 12 #include "net/quic/quic_connection.h"
13 #include "net/quic/quic_session.h" 13 #include "net/quic/quic_session.h"
14 #include "net/quic/quic_utils.h" 14 #include "net/quic/quic_utils.h"
15 15
16 using std::string; 16 using std::string;
17 using base::StringPiece; 17 using base::StringPiece;
18 18
19 namespace net { 19 namespace net {
20 20
21 #define ENDPOINT (session()->is_server() ? "Server: " : " Client: ") 21 #define ENDPOINT \
22 (session()->perspective() == Perspective::IS_SERVER ? "Server: " : "Client:" \
23 " ")
22 24
23 QuicCryptoStream::QuicCryptoStream(QuicSession* session) 25 QuicCryptoStream::QuicCryptoStream(QuicSession* session)
24 : ReliableQuicStream(kCryptoStreamId, session), 26 : ReliableQuicStream(kCryptoStreamId, session),
25 encryption_established_(false), 27 encryption_established_(false),
26 handshake_confirmed_(false) { 28 handshake_confirmed_(false) {
27 crypto_framer_.set_visitor(this); 29 crypto_framer_.set_visitor(this);
28 // The crypto stream is exempt from connection level flow control. 30 // The crypto stream is exempt from connection level flow control.
29 DisableConnectionFlowControlForThisStream(); 31 DisableConnectionFlowControlForThisStream();
30 } 32 }
31 33
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 result_len, 87 result_len,
86 result); 88 result);
87 } 89 }
88 90
89 const QuicCryptoNegotiatedParameters& 91 const QuicCryptoNegotiatedParameters&
90 QuicCryptoStream::crypto_negotiated_params() const { 92 QuicCryptoStream::crypto_negotiated_params() const {
91 return crypto_negotiated_params_; 93 return crypto_negotiated_params_;
92 } 94 }
93 95
94 } // namespace net 96 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_crypto_server_stream_test.cc ('k') | net/quic/quic_crypto_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698