From 4988e439c1a14779f32b4dc9c289d9e4bad467af Mon Sep 17 00:00:00 2001 From: bnc Date: Mon, 30 Mar 2015 20:06:25 -0700 Subject: Introduce AlternativeServiceInfo. * Introduce AlternativeServiceInfo and use it instead of AlternateProtocolInfo in HttpServerPropertiesImpl. * Change language in method and variable names and comments to consistently talk about alternative service instead of alternate protocol (except for threshold related occurrences). * Update HttpServerPropertiesManager to save by key "alternative_service" instead of "alternate_protocol", while still being able to read old preferences. * Add TODO(bnc) at a couple of places. BUG=392575 Review URL: https://codereview.chromium.org/1043973002 Cr-Commit-Position: refs/heads/master@{#322968} --- net/http/http_server_properties.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'net/http/http_server_properties.cc') diff --git a/net/http/http_server_properties.cc b/net/http/http_server_properties.cc index f002102..174b174 100644 --- a/net/http/http_server_properties.cc +++ b/net/http/http_server_properties.cc @@ -100,9 +100,14 @@ AlternateProtocol AlternateProtocolFromNextProto(NextProto next_proto) { return UNINITIALIZED_ALTERNATE_PROTOCOL; } -std::string AlternateProtocolInfo::ToString() const { - return base::StringPrintf("%d:%s p=%f", port, - AlternateProtocolToString(protocol), probability); +std::string AlternativeService::ToString() const { + return base::StringPrintf("(%s, %s, %d)", AlternateProtocolToString(protocol), + host.c_str(), port); +} + +std::string AlternativeServiceInfo::ToString() const { + return base::StringPrintf("%s, p=%f", alternative_service.ToString().c_str(), + probability); } // static -- cgit v1.1