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

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

Issue 317723004: [GCM] Add ConnectionListener support, and hook up to debug page (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 23 matching lines...) Expand all
34 void FakeConnectionFactory::Connect() { 34 void FakeConnectionFactory::Connect() {
35 mcs_proto::LoginRequest login_request; 35 mcs_proto::LoginRequest login_request;
36 request_builder_.Run(&login_request); 36 request_builder_.Run(&login_request);
37 connection_handler_->Init(login_request, NULL); 37 connection_handler_->Init(login_request, NULL);
38 } 38 }
39 39
40 bool FakeConnectionFactory::IsEndpointReachable() const { 40 bool FakeConnectionFactory::IsEndpointReachable() const {
41 return connection_handler_.get() && connection_handler_->CanSendMessage(); 41 return connection_handler_.get() && connection_handler_->CanSendMessage();
42 } 42 }
43 43
44 std::string FakeConnectionFactory::GetConnectionStateString() const {
45 return "";
46 }
47
44 base::TimeTicks FakeConnectionFactory::NextRetryAttempt() const { 48 base::TimeTicks FakeConnectionFactory::NextRetryAttempt() const {
45 return base::TimeTicks(); 49 return base::TimeTicks();
46 } 50 }
47 51
48 void FakeConnectionFactory::SignalConnectionReset( 52 void FakeConnectionFactory::SignalConnectionReset(
49 ConnectionResetReason reason) { 53 ConnectionResetReason reason) {
50 if (!delay_reconnect_) 54 if (!delay_reconnect_)
51 Connect(); 55 Connect();
52 else 56 else
53 reconnect_pending_ = true; 57 reconnect_pending_ = true;
54 } 58 }
55 59
60 void FakeConnectionFactory::SetConnectionListener(
61 ConnectionListener* listener) {
62 }
63
56 } // namespace gcm 64 } // namespace gcm
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698