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" |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 } else if (option.empty() && it == spdy_options.begin()) { | 95 } else if (option.empty() && it == spdy_options.begin()) { |
96 continue; | 96 continue; |
97 } else { | 97 } else { |
98 LOG(DFATAL) << "Unrecognized spdy option: " << option; | 98 LOG(DFATAL) << "Unrecognized spdy option: " << option; |
99 } | 99 } |
100 } | 100 } |
101 } | 101 } |
102 | 102 |
103 //----------------------------------------------------------------------------- | 103 //----------------------------------------------------------------------------- |
104 | 104 |
105 int HttpNetworkLayer::CreateTransaction(scoped_ptr<HttpTransaction>* trans) { | 105 int HttpNetworkLayer::CreateTransaction(scoped_ptr<HttpTransaction>* trans, |
| 106 HttpTransactionDelegate* delegate) { |
106 if (suspended_) | 107 if (suspended_) |
107 return ERR_NETWORK_IO_SUSPENDED; | 108 return ERR_NETWORK_IO_SUSPENDED; |
108 | 109 |
109 trans->reset(new HttpNetworkTransaction(GetSession())); | 110 trans->reset(new HttpNetworkTransaction(GetSession())); |
110 return OK; | 111 return OK; |
111 } | 112 } |
112 | 113 |
113 HttpCache* HttpNetworkLayer::GetCache() { | 114 HttpCache* HttpNetworkLayer::GetCache() { |
114 return NULL; | 115 return NULL; |
115 } | 116 } |
116 | 117 |
117 HttpNetworkSession* HttpNetworkLayer::GetSession() { | 118 HttpNetworkSession* HttpNetworkLayer::GetSession() { |
118 return session_; | 119 return session_; |
119 } | 120 } |
120 | 121 |
121 void HttpNetworkLayer::OnSuspend() { | 122 void HttpNetworkLayer::OnSuspend() { |
122 suspended_ = true; | 123 suspended_ = true; |
123 | 124 |
124 if (session_) | 125 if (session_) |
125 session_->CloseIdleConnections(); | 126 session_->CloseIdleConnections(); |
126 } | 127 } |
127 | 128 |
128 void HttpNetworkLayer::OnResume() { | 129 void HttpNetworkLayer::OnResume() { |
129 suspended_ = false; | 130 suspended_ = false; |
130 } | 131 } |
131 | 132 |
132 } // namespace net | 133 } // namespace net |
OLD | NEW |