OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // TODO(ukai): code is similar with http_network_transaction.cc. We should | 5 // TODO(ukai): code is similar with http_network_transaction.cc. We should |
6 // think about ways to share code, if possible. | 6 // think about ways to share code, if possible. |
7 | 7 |
8 #include "net/socket_stream/socket_stream.h" | 8 #include "net/socket_stream/socket_stream.h" |
9 | 9 |
10 #include <set> | 10 #include <set> |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 return; | 189 return; |
190 closing_ = true; | 190 closing_ = true; |
191 // Close asynchronously, so that delegate won't be called | 191 // Close asynchronously, so that delegate won't be called |
192 // back before returning Close(). | 192 // back before returning Close(). |
193 MessageLoop::current()->PostTask( | 193 MessageLoop::current()->PostTask( |
194 FROM_HERE, | 194 FROM_HERE, |
195 NewRunnableMethod(this, &SocketStream::DoLoop, OK)); | 195 NewRunnableMethod(this, &SocketStream::DoLoop, OK)); |
196 } | 196 } |
197 | 197 |
198 void SocketStream::RestartWithAuth( | 198 void SocketStream::RestartWithAuth( |
199 const std::wstring& username, const std::wstring& password) { | 199 const string16& username, const string16& password) { |
200 DCHECK(MessageLoop::current()) << | 200 DCHECK(MessageLoop::current()) << |
201 "The current MessageLoop must exist"; | 201 "The current MessageLoop must exist"; |
202 DCHECK_EQ(MessageLoop::TYPE_IO, MessageLoop::current()->type()) << | 202 DCHECK_EQ(MessageLoop::TYPE_IO, MessageLoop::current()->type()) << |
203 "The current MessageLoop must be TYPE_IO"; | 203 "The current MessageLoop must be TYPE_IO"; |
204 DCHECK(auth_handler_.get()); | 204 DCHECK(auth_handler_.get()); |
205 if (!socket_.get()) { | 205 if (!socket_.get()) { |
206 LOG(ERROR) << "Socket is closed before restarting with auth."; | 206 LOG(ERROR) << "Socket is closed before restarting with auth."; |
207 return; | 207 return; |
208 } | 208 } |
209 | 209 |
(...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
985 | 985 |
986 SSLConfigService* SocketStream::ssl_config_service() const { | 986 SSLConfigService* SocketStream::ssl_config_service() const { |
987 return context_->ssl_config_service(); | 987 return context_->ssl_config_service(); |
988 } | 988 } |
989 | 989 |
990 ProxyService* SocketStream::proxy_service() const { | 990 ProxyService* SocketStream::proxy_service() const { |
991 return context_->proxy_service(); | 991 return context_->proxy_service(); |
992 } | 992 } |
993 | 993 |
994 } // namespace net | 994 } // namespace net |
OLD | NEW |