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

Side by Side Diff: net/socket/socket_test_util.cc

Issue 9958028: Add a new GetNegotiatedProtocol method to StreamSocket and implement in all subclasses. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « net/socket/socket_test_util.h ('k') | net/socket/socks5_client_socket.h » ('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/socket/socket_test_util.h" 5 #include "net/socket/socket_test_util.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 1148 matching lines...) Expand 10 before | Expand all | Expand 10 after
1159 if (is_npn_state_set_) 1159 if (is_npn_state_set_)
1160 return new_npn_value_; 1160 return new_npn_value_;
1161 return data_->was_npn_negotiated; 1161 return data_->was_npn_negotiated;
1162 } 1162 }
1163 1163
1164 bool MockSSLClientSocket::set_was_npn_negotiated(bool negotiated) { 1164 bool MockSSLClientSocket::set_was_npn_negotiated(bool negotiated) {
1165 is_npn_state_set_ = true; 1165 is_npn_state_set_ = true;
1166 return new_npn_value_ = negotiated; 1166 return new_npn_value_ = negotiated;
1167 } 1167 }
1168 1168
1169 NextProto MockSSLClientSocket::protocol_negotiated() const { 1169 NextProto MockSSLClientSocket::GetNegotiatedProtocol() const {
1170 if (is_protocol_negotiated_set_) 1170 if (is_protocol_negotiated_set_)
1171 return protocol_negotiated_; 1171 return protocol_negotiated_;
1172 return data_->protocol_negotiated; 1172 return data_->protocol_negotiated;
1173 } 1173 }
1174 1174
1175 void MockSSLClientSocket::set_protocol_negotiated( 1175 void MockSSLClientSocket::set_protocol_negotiated(
1176 NextProto protocol_negotiated) { 1176 NextProto protocol_negotiated) {
1177 is_protocol_negotiated_set_ = true; 1177 is_protocol_negotiated_set_ = true;
1178 protocol_negotiated_ = protocol_negotiated; 1178 protocol_negotiated_ = protocol_negotiated;
1179 } 1179 }
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
1620 1620
1621 const char kSOCKS5OkRequest[] = 1621 const char kSOCKS5OkRequest[] =
1622 { 0x05, 0x01, 0x00, 0x03, 0x04, 'h', 'o', 's', 't', 0x00, 0x50 }; 1622 { 0x05, 0x01, 0x00, 0x03, 0x04, 'h', 'o', 's', 't', 0x00, 0x50 };
1623 const int kSOCKS5OkRequestLength = arraysize(kSOCKS5OkRequest); 1623 const int kSOCKS5OkRequestLength = arraysize(kSOCKS5OkRequest);
1624 1624
1625 const char kSOCKS5OkResponse[] = 1625 const char kSOCKS5OkResponse[] =
1626 { 0x05, 0x00, 0x00, 0x01, 127, 0, 0, 1, 0x00, 0x50 }; 1626 { 0x05, 0x00, 0x00, 0x01, 127, 0, 0, 1, 0x00, 0x50 };
1627 const int kSOCKS5OkResponseLength = arraysize(kSOCKS5OkResponse); 1627 const int kSOCKS5OkResponseLength = arraysize(kSOCKS5OkResponse);
1628 1628
1629 } // namespace net 1629 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/socket_test_util.h ('k') | net/socket/socks5_client_socket.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698