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

Side by Side Diff: net/http/http_server_properties.cc

Issue 1212813006: Pretty print AlternativeService in test macros. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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/http/http_server_properties.h ('k') | no next file » | 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/http/http_server_properties.h" 5 #include "net/http/http_server_properties.h"
6 6
7 #include <iostream>
8
7 #include "base/logging.h" 9 #include "base/logging.h"
8 #include "base/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
9 #include "base/strings/stringprintf.h" 11 #include "base/strings/stringprintf.h"
10 #include "net/socket/ssl_client_socket.h" 12 #include "net/socket/ssl_client_socket.h"
11 #include "net/ssl/ssl_config.h" 13 #include "net/ssl/ssl_config.h"
12 14
13 namespace net { 15 namespace net {
14 16
15 const char kAlternateProtocolHeader[] = "Alternate-Protocol"; 17 const char kAlternateProtocolHeader[] = "Alternate-Protocol";
16 18
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 std::string AlternativeService::ToString() const { 105 std::string AlternativeService::ToString() const {
104 return base::StringPrintf("%s %s:%d", AlternateProtocolToString(protocol), 106 return base::StringPrintf("%s %s:%d", AlternateProtocolToString(protocol),
105 host.c_str(), port); 107 host.c_str(), port);
106 } 108 }
107 109
108 std::string AlternativeServiceInfo::ToString() const { 110 std::string AlternativeServiceInfo::ToString() const {
109 return base::StringPrintf("%s, p=%f", alternative_service.ToString().c_str(), 111 return base::StringPrintf("%s, p=%f", alternative_service.ToString().c_str(),
110 probability); 112 probability);
111 } 113 }
112 114
115 std::ostream& operator<<(std::ostream& os,
116 const AlternativeService& alternative_service) {
117 return (os << alternative_service.ToString());
118 }
119
113 // static 120 // static
114 void HttpServerProperties::ForceHTTP11(SSLConfig* ssl_config) { 121 void HttpServerProperties::ForceHTTP11(SSLConfig* ssl_config) {
115 ssl_config->next_protos.clear(); 122 ssl_config->next_protos.clear();
116 ssl_config->next_protos.push_back(kProtoHTTP11); 123 ssl_config->next_protos.push_back(kProtoHTTP11);
117 } 124 }
118 125
119 } // namespace net 126 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_server_properties.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698