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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 HttpTransactionDelegate* delegate) { |
107 if (suspended_) | 107 if (suspended_) |
108 return ERR_NETWORK_IO_SUSPENDED; | 108 return ERR_NETWORK_IO_SUSPENDED; |
109 | 109 |
110 trans->reset(new HttpNetworkTransaction(GetSession())); | 110 HttpNetworkTransaction* new_trans = new HttpNetworkTransaction(GetSession()); |
| 111 new_trans->set_delegate(delegate); |
| 112 trans->reset(new_trans); |
111 return OK; | 113 return OK; |
112 } | 114 } |
113 | 115 |
114 HttpCache* HttpNetworkLayer::GetCache() { | 116 HttpCache* HttpNetworkLayer::GetCache() { |
115 return NULL; | 117 return NULL; |
116 } | 118 } |
117 | 119 |
118 HttpNetworkSession* HttpNetworkLayer::GetSession() { | 120 HttpNetworkSession* HttpNetworkLayer::GetSession() { |
119 return session_; | 121 return session_; |
120 } | 122 } |
121 | 123 |
122 void HttpNetworkLayer::OnSuspend() { | 124 void HttpNetworkLayer::OnSuspend() { |
123 suspended_ = true; | 125 suspended_ = true; |
124 | 126 |
125 if (session_) | 127 if (session_) |
126 session_->CloseIdleConnections(); | 128 session_->CloseIdleConnections(); |
127 } | 129 } |
128 | 130 |
129 void HttpNetworkLayer::OnResume() { | 131 void HttpNetworkLayer::OnResume() { |
130 suspended_ = false; | 132 suspended_ = false; |
131 } | 133 } |
132 | 134 |
133 } // namespace net | 135 } // namespace net |
OLD | NEW |