OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/browser/sync/notifier/communicator/ssl_socket_adapter.h" | 5 #include "chrome/browser/sync/notifier/communicator/ssl_socket_adapter.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "chrome/browser/net/url_request_context_getter.h" | 9 #include "chrome/browser/net/url_request_context_getter.h" |
10 #include "chrome/browser/profile.h" | 10 #include "chrome/browser/profile.h" |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 : connect_callback_(NULL), | 230 : connect_callback_(NULL), |
231 read_callback_(NULL), | 231 read_callback_(NULL), |
232 write_callback_(NULL), | 232 write_callback_(NULL), |
233 read_buffer_len_(0), | 233 read_buffer_len_(0), |
234 write_buffer_len_(0), | 234 write_buffer_len_(0), |
235 socket_(socket) { | 235 socket_(socket) { |
236 socket_->SignalConnectEvent.connect(this, &TransportSocket::OnConnectEvent); | 236 socket_->SignalConnectEvent.connect(this, &TransportSocket::OnConnectEvent); |
237 } | 237 } |
238 | 238 |
239 int TransportSocket::Connect(net::CompletionCallback* callback, | 239 int TransportSocket::Connect(net::CompletionCallback* callback, |
240 net::LoadLog* /* load_log */) { | 240 const net::BoundNetLog& /* net_log */) { |
241 connect_callback_ = callback; | 241 connect_callback_ = callback; |
242 return socket_->Connect(addr_); | 242 return socket_->Connect(addr_); |
243 } | 243 } |
244 | 244 |
245 void TransportSocket::Disconnect() { | 245 void TransportSocket::Disconnect() { |
246 socket_->Close(); | 246 socket_->Close(); |
247 } | 247 } |
248 | 248 |
249 bool TransportSocket::IsConnected() const { | 249 bool TransportSocket::IsConnected() const { |
250 return (socket_->GetState() == talk_base::Socket::CS_CONNECTED); | 250 return (socket_->GetState() == talk_base::Socket::CS_CONNECTED); |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 } | 377 } |
378 } | 378 } |
379 callback->RunWithParams(Tuple1<int>(result)); | 379 callback->RunWithParams(Tuple1<int>(result)); |
380 return true; | 380 return true; |
381 } else { | 381 } else { |
382 return false; | 382 return false; |
383 } | 383 } |
384 } | 384 } |
385 | 385 |
386 } // namespace notifier | 386 } // namespace notifier |
OLD | NEW |