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_network_layer.h" | 5 #include "net/http/http_network_layer.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
9 #include "base/string_split.h" | 9 #include "base/string_split.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
11 #include "net/http/http_network_session.h" | 11 #include "net/http/http_network_session.h" |
12 #include "net/http/http_network_transaction.h" | 12 #include "net/http/http_network_transaction.h" |
13 #include "net/http/http_server_properties_impl.h" | 13 #include "net/http/http_server_properties_impl.h" |
| 14 #include "net/http/http_stream_factory_impl_job.h" |
14 #include "net/spdy/spdy_framer.h" | 15 #include "net/spdy/spdy_framer.h" |
15 #include "net/spdy/spdy_session.h" | 16 #include "net/spdy/spdy_session.h" |
16 #include "net/spdy/spdy_session_pool.h" | 17 #include "net/spdy/spdy_session_pool.h" |
17 | 18 |
18 namespace net { | 19 namespace net { |
19 | 20 |
20 //----------------------------------------------------------------------------- | 21 //----------------------------------------------------------------------------- |
21 HttpNetworkLayer::HttpNetworkLayer(HttpNetworkSession* session) | 22 HttpNetworkLayer::HttpNetworkLayer(HttpNetworkSession* session) |
22 : session_(session), | 23 : session_(session), |
23 suspended_(false) { | 24 suspended_(false) { |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 if (base::StringToInt(value, &streams) && streams > 0) | 94 if (base::StringToInt(value, &streams) && streams > 0) |
94 SpdySession::set_init_max_concurrent_streams(streams); | 95 SpdySession::set_init_max_concurrent_streams(streams); |
95 } else if (option.empty() && it == spdy_options.begin()) { | 96 } else if (option.empty() && it == spdy_options.begin()) { |
96 continue; | 97 continue; |
97 } else { | 98 } else { |
98 LOG(DFATAL) << "Unrecognized spdy option: " << option; | 99 LOG(DFATAL) << "Unrecognized spdy option: " << option; |
99 } | 100 } |
100 } | 101 } |
101 } | 102 } |
102 | 103 |
| 104 // static |
| 105 void HttpNetworkLayer::EnableQuic(const std::string& value) { |
| 106 int port; |
| 107 if (base::StringToInt(value, &port) && port > 0) { |
| 108 HttpStreamFactory::set_force_quic_port(port); |
| 109 } |
| 110 } |
| 111 |
103 //----------------------------------------------------------------------------- | 112 //----------------------------------------------------------------------------- |
104 | 113 |
105 int HttpNetworkLayer::CreateTransaction(scoped_ptr<HttpTransaction>* trans, | 114 int HttpNetworkLayer::CreateTransaction(scoped_ptr<HttpTransaction>* trans, |
106 HttpTransactionDelegate* delegate) { | 115 HttpTransactionDelegate* delegate) { |
107 if (suspended_) | 116 if (suspended_) |
108 return ERR_NETWORK_IO_SUSPENDED; | 117 return ERR_NETWORK_IO_SUSPENDED; |
109 | 118 |
110 trans->reset(new HttpNetworkTransaction(GetSession())); | 119 trans->reset(new HttpNetworkTransaction(GetSession())); |
111 return OK; | 120 return OK; |
112 } | 121 } |
(...skipping 11 matching lines...) Expand all Loading... |
124 | 133 |
125 if (session_) | 134 if (session_) |
126 session_->CloseIdleConnections(); | 135 session_->CloseIdleConnections(); |
127 } | 136 } |
128 | 137 |
129 void HttpNetworkLayer::OnResume() { | 138 void HttpNetworkLayer::OnResume() { |
130 suspended_ = false; | 139 suspended_ = false; |
131 } | 140 } |
132 | 141 |
133 } // namespace net | 142 } // namespace net |
OLD | NEW |