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

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

Issue 2808843002: Add operator<<(ostream, AlternativeService) for test output formatting. (Closed)
Patch Set: Created 3 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
« no previous file with comments | « net/http/http_server_properties.h ('k') | net/http/http_server_properties_impl_unittest.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/http/http_server_properties.h" 5 #include "net/http/http_server_properties.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/metrics/histogram_macros.h" 8 #include "base/metrics/histogram_macros.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "net/socket/ssl_client_socket.h" 10 #include "net/socket/ssl_client_socket.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 85
86 std::string AlternativeServiceInfo::ToString() const { 86 std::string AlternativeServiceInfo::ToString() const {
87 base::Time::Exploded exploded; 87 base::Time::Exploded exploded;
88 expiration.LocalExplode(&exploded); 88 expiration.LocalExplode(&exploded);
89 return base::StringPrintf( 89 return base::StringPrintf(
90 "%s, expires %04d-%02d-%02d %02d:%02d:%02d", 90 "%s, expires %04d-%02d-%02d %02d:%02d:%02d",
91 alternative_service.ToString().c_str(), exploded.year, exploded.month, 91 alternative_service.ToString().c_str(), exploded.year, exploded.month,
92 exploded.day_of_month, exploded.hour, exploded.minute, exploded.second); 92 exploded.day_of_month, exploded.hour, exploded.minute, exploded.second);
93 } 93 }
94 94
95 std::ostream& operator<<(std::ostream& os,
96 const AlternativeService& alternative_service) {
97 os << alternative_service.ToString();
98 return os;
99 }
100
95 // static 101 // static
96 void HttpServerProperties::ForceHTTP11(SSLConfig* ssl_config) { 102 void HttpServerProperties::ForceHTTP11(SSLConfig* ssl_config) {
97 ssl_config->alpn_protos.clear(); 103 ssl_config->alpn_protos.clear();
98 ssl_config->alpn_protos.push_back(kProtoHTTP11); 104 ssl_config->alpn_protos.push_back(kProtoHTTP11);
99 } 105 }
100 106
101 } // namespace net 107 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_server_properties.h ('k') | net/http/http_server_properties_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698