| OLD | NEW |
| 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_impl.h" | 5 #include "net/http/http_stream_factory_impl.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| 11 #include "base/strings/string_number_conversions.h" | 11 #include "base/strings/string_number_conversions.h" |
| 12 #include "net/base/net_log.h" | 12 #include "net/base/net_log.h" |
| 13 #include "net/base/net_util.h" | 13 #include "net/base/net_util.h" |
| 14 #include "net/http/http_network_session.h" | 14 #include "net/http/http_network_session.h" |
| 15 #include "net/http/http_server_properties.h" | 15 #include "net/http/http_server_properties.h" |
| 16 #include "net/http/http_stream_factory_impl_job.h" | 16 #include "net/http/http_stream_factory_impl_job.h" |
| 17 #include "net/http/http_stream_factory_impl_request.h" | 17 #include "net/http/http_stream_factory_impl_request.h" |
| 18 #include "net/spdy/spdy_http_stream.h" | 18 #include "net/spdy/spdy_http_stream.h" |
| 19 #include "url/gurl.h" | 19 #include "url/gurl.h" |
| 20 | 20 |
| 21 namespace net { | 21 namespace net { |
| 22 | 22 |
| 23 namespace { | 23 namespace { |
| 24 | 24 |
| 25 GURL UpgradeUrlToHttps(const GURL& original_url, int port) { | 25 GURL UpgradeUrlToHttps(const GURL& original_url, int port) { |
| 26 GURL::Replacements replacements; | 26 GURL::Replacements replacements; |
| 27 // new_sheme and new_port need to be in scope here because GURL::Replacements | 27 // new_port needs to be in scope here because GURL::Replacements references |
| 28 // references the memory contained by them directly. | 28 // the memory contained by it directly. |
| 29 const std::string new_scheme = "https"; | |
| 30 const std::string new_port = base::IntToString(port); | 29 const std::string new_port = base::IntToString(port); |
| 31 replacements.SetSchemeStr(new_scheme); | 30 replacements.SetSchemeStr("https"); |
| 32 replacements.SetPortStr(new_port); | 31 replacements.SetPortStr(new_port); |
| 33 return original_url.ReplaceComponents(replacements); | 32 return original_url.ReplaceComponents(replacements); |
| 34 } | 33 } |
| 35 | 34 |
| 36 } // namespace | 35 } // namespace |
| 37 | 36 |
| 38 HttpStreamFactoryImpl::HttpStreamFactoryImpl(HttpNetworkSession* session, | 37 HttpStreamFactoryImpl::HttpStreamFactoryImpl(HttpNetworkSession* session, |
| 39 bool for_websockets) | 38 bool for_websockets) |
| 40 : session_(session), | 39 : session_(session), |
| 41 for_websockets_(for_websockets) {} | 40 for_websockets_(for_websockets) {} |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 delete job; | 294 delete job; |
| 296 } | 295 } |
| 297 | 296 |
| 298 void HttpStreamFactoryImpl::OnPreconnectsComplete(const Job* job) { | 297 void HttpStreamFactoryImpl::OnPreconnectsComplete(const Job* job) { |
| 299 preconnect_job_set_.erase(job); | 298 preconnect_job_set_.erase(job); |
| 300 delete job; | 299 delete job; |
| 301 OnPreconnectsCompleteInternal(); | 300 OnPreconnectsCompleteInternal(); |
| 302 } | 301 } |
| 303 | 302 |
| 304 } // namespace net | 303 } // namespace net |
| OLD | NEW |