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

Side by Side Diff: google_apis/gcm/engine/connection_handler.h

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 #ifndef GOOGLE_APIS_GCM_ENGINE_CONNECTION_HANDLER_H_ 5 #ifndef GOOGLE_APIS_GCM_ENGINE_CONNECTION_HANDLER_H_
6 #define GOOGLE_APIS_GCM_ENGINE_CONNECTION_HANDLER_H_ 6 #define GOOGLE_APIS_GCM_ENGINE_CONNECTION_HANDLER_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "google_apis/gcm/base/gcm_export.h" 9 #include "google_apis/gcm/base/gcm_export.h"
10 10
(...skipping 30 matching lines...) Expand all
41 41
42 ConnectionHandler(); 42 ConnectionHandler();
43 virtual ~ConnectionHandler(); 43 virtual ~ConnectionHandler();
44 44
45 // Starts a new MCS connection handshake (using |login_request|) and, upon 45 // Starts a new MCS connection handshake (using |login_request|) and, upon
46 // success, begins listening for incoming/outgoing messages. 46 // success, begins listening for incoming/outgoing messages.
47 // 47 //
48 // Note: It is correct and expected to call Init more than once, as connection 48 // Note: It is correct and expected to call Init more than once, as connection
49 // issues are encountered and new connections must be made. 49 // issues are encountered and new connections must be made.
50 virtual void Init(const mcs_proto::LoginRequest& login_request, 50 virtual void Init(const mcs_proto::LoginRequest& login_request,
51 scoped_ptr<net::StreamSocket> socket) = 0; 51 net::StreamSocket* socket) = 0;
52 52
53 // Checks that a handshake has been completed and a message is not already 53 // Checks that a handshake has been completed and a message is not already
54 // in flight. 54 // in flight.
55 virtual bool CanSendMessage() const = 0; 55 virtual bool CanSendMessage() const = 0;
56 56
57 // Send an MCS protobuf message. CanSendMessage() must be true. 57 // Send an MCS protobuf message. CanSendMessage() must be true.
58 virtual void SendMessage(const google::protobuf::MessageLite& message) = 0; 58 virtual void SendMessage(const google::protobuf::MessageLite& message) = 0;
59 }; 59 };
60 60
61 } // namespace gcm 61 } // namespace gcm
62 62
63 #endif // GOOGLE_APIS_GCM_ENGINE_CONNECTION_HANDLER_H_ 63 #endif // GOOGLE_APIS_GCM_ENGINE_CONNECTION_HANDLER_H_
OLDNEW
« no previous file with comments | « google_apis/gcm/engine/connection_factory_impl.cc ('k') | google_apis/gcm/engine/connection_handler_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698