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

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

Issue 1841863002: Update monet. (Closed) Base URL: https://github.com/domokit/monet.git@master
Patch Set: Created 4 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
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_stream_factory.h" 5 #include "net/http/http_stream_factory.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "base/strings/string_split.h" 9 #include "base/strings/string_split.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 21 matching lines...) Expand all
32 const base::WeakPtr<HttpServerProperties>& http_server_properties, 32 const base::WeakPtr<HttpServerProperties>& http_server_properties,
33 const std::vector<std::string>& alternate_protocol_values, 33 const std::vector<std::string>& alternate_protocol_values,
34 const HostPortPair& http_host_port_pair, 34 const HostPortPair& http_host_port_pair,
35 const HttpNetworkSession& session) { 35 const HttpNetworkSession& session) {
36 AlternateProtocol protocol = UNINITIALIZED_ALTERNATE_PROTOCOL; 36 AlternateProtocol protocol = UNINITIALIZED_ALTERNATE_PROTOCOL;
37 int port = 0; 37 int port = 0;
38 double probability = 1; 38 double probability = 1;
39 bool is_valid = true; 39 bool is_valid = true;
40 for (size_t i = 0; i < alternate_protocol_values.size(); ++i) { 40 for (size_t i = 0; i < alternate_protocol_values.size(); ++i) {
41 const std::string& alternate_protocol_str = alternate_protocol_values[i]; 41 const std::string& alternate_protocol_str = alternate_protocol_values[i];
42 if (StartsWithASCII(alternate_protocol_str, "p=", true)) { 42 if (base::StartsWith(alternate_protocol_str, "p=",
43 base::CompareCase::SENSITIVE)) {
43 if (!base::StringToDouble(alternate_protocol_str.substr(2), 44 if (!base::StringToDouble(alternate_protocol_str.substr(2),
44 &probability) || 45 &probability) ||
45 probability < 0 || probability > 1) { 46 probability < 0 || probability > 1) {
46 DVLOG(1) << kAlternateProtocolHeader 47 DVLOG(1) << kAlternateProtocolHeader
47 << " header has unrecognizable probability: " 48 << " header has unrecognizable probability: "
48 << alternate_protocol_values[i]; 49 << alternate_protocol_values[i];
49 is_valid = false; 50 is_valid = false;
50 break; 51 break;
51 } 52 }
52 continue; 53 continue;
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 replacements.SetHost(endpoint->host().c_str(), 109 replacements.SetHost(endpoint->host().c_str(),
109 url::Component(0, endpoint->host().size())); 110 url::Component(0, endpoint->host().size()));
110 return url.ReplaceComponents(replacements); 111 return url.ReplaceComponents(replacements);
111 } 112 }
112 return url; 113 return url;
113 } 114 }
114 115
115 HttpStreamFactory::HttpStreamFactory() {} 116 HttpStreamFactory::HttpStreamFactory() {}
116 117
117 } // namespace net 118 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_server_properties_manager_unittest.cc ('k') | net/http/http_stream_parser_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698