| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "google_apis/gcm/engine/fake_connection_factory.h" | 5 #include "google_apis/gcm/engine/fake_connection_factory.h" |
| 6 | 6 |
| 7 #include "google_apis/gcm/engine/fake_connection_handler.h" | 7 #include "google_apis/gcm/engine/fake_connection_handler.h" |
| 8 #include "google_apis/gcm/protocol/mcs.pb.h" | 8 #include "google_apis/gcm/protocol/mcs.pb.h" |
| 9 #include "net/socket/stream_socket.h" | 9 #include "net/socket/stream_socket.h" |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 write_callback)); | 25 write_callback)); |
| 26 } | 26 } |
| 27 | 27 |
| 28 ConnectionHandler* FakeConnectionFactory::GetConnectionHandler() const { | 28 ConnectionHandler* FakeConnectionFactory::GetConnectionHandler() const { |
| 29 return connection_handler_.get(); | 29 return connection_handler_.get(); |
| 30 } | 30 } |
| 31 | 31 |
| 32 void FakeConnectionFactory::Connect() { | 32 void FakeConnectionFactory::Connect() { |
| 33 mcs_proto::LoginRequest login_request; | 33 mcs_proto::LoginRequest login_request; |
| 34 request_builder_.Run(&login_request); | 34 request_builder_.Run(&login_request); |
| 35 connection_handler_->Init(login_request, scoped_ptr<net::StreamSocket>()); | 35 connection_handler_->Init(login_request, NULL); |
| 36 } | 36 } |
| 37 | 37 |
| 38 bool FakeConnectionFactory::IsEndpointReachable() const { | 38 bool FakeConnectionFactory::IsEndpointReachable() const { |
| 39 return connection_handler_.get() && connection_handler_->CanSendMessage(); | 39 return connection_handler_.get() && connection_handler_->CanSendMessage(); |
| 40 } | 40 } |
| 41 | 41 |
| 42 base::TimeTicks FakeConnectionFactory::NextRetryAttempt() const { | 42 base::TimeTicks FakeConnectionFactory::NextRetryAttempt() const { |
| 43 return base::TimeTicks(); | 43 return base::TimeTicks(); |
| 44 } | 44 } |
| 45 | 45 |
| 46 void FakeConnectionFactory::SignalConnectionReset() { | 46 void FakeConnectionFactory::SignalConnectionReset() { |
| 47 Connect(); | 47 Connect(); |
| 48 } | 48 } |
| 49 | 49 |
| 50 } // namespace gcm | 50 } // namespace gcm |
| OLD | NEW |