Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(251)

Side by Side Diff: google_apis/gcm/engine/fake_connection_factory.cc

Issue 118133003: [GCM] Add heartbeat manager and reconnection logic due to heartbeat failure (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Unrevert fixes Created 6 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
OLDNEW
« no previous file with comments | « google_apis/gcm/engine/connection_handler_impl_unittest.cc ('k') | google_apis/gcm/engine/fake_connection_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698