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

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

Issue 184273011: Merge 253787 "[GCM] Make sure GCM checkout logic is invoked when..." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1847/src/
Patch Set: Created 6 years, 9 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_MCS_CLIENT_H_ 5 #ifndef GOOGLE_APIS_GCM_ENGINE_MCS_CLIENT_H_
6 #define GOOGLE_APIS_GCM_ENGINE_MCS_CLIENT_H_ 6 #define GOOGLE_APIS_GCM_ENGINE_MCS_CLIENT_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 115
116 // Sends a message, with or without reliable message queueing (RMQ) support. 116 // Sends a message, with or without reliable message queueing (RMQ) support.
117 // Will asynchronously invoke the OnMessageSent callback regardless. 117 // Will asynchronously invoke the OnMessageSent callback regardless.
118 // Whether to use RMQ depends on whether the protobuf has |ttl| set or not. 118 // Whether to use RMQ depends on whether the protobuf has |ttl| set or not.
119 // |ttl == 0| denotes the message should only be sent if the connection is 119 // |ttl == 0| denotes the message should only be sent if the connection is
120 // open. |ttl > 0| will keep the message saved for |ttl| seconds, after which 120 // open. |ttl > 0| will keep the message saved for |ttl| seconds, after which
121 // it will be dropped if it was unable to be sent. When a message is dropped, 121 // it will be dropped if it was unable to be sent. When a message is dropped,
122 // |message_sent_callback_| is invoked with a TTL expiration error. 122 // |message_sent_callback_| is invoked with a TTL expiration error.
123 virtual void SendMessage(const MCSMessage& message); 123 virtual void SendMessage(const MCSMessage& message);
124 124
125 // Disconnects the client and permanently destroys the persistent GCM store.
126 // WARNING: This is permanent, and the client must be recreated with new
127 // credentials afterwards.
128 // TODO(jianli): destroying the persistent GCM store should be moved to
129 // GCMClient.
130 void Destroy();
131
132 // Returns the current state of the client. 125 // Returns the current state of the client.
133 State state() const { return state_; } 126 State state() const { return state_; }
134 127
135 protected: 128 protected:
136 // Sets a |gcm_store| for testing. Does not take ownership. 129 // Sets a |gcm_store| for testing. Does not take ownership.
137 // TODO(fgorski): Remove this method. Create GCMEngineFactory that will create 130 // TODO(fgorski): Remove this method. Create GCMEngineFactory that will create
138 // components of the engine. 131 // components of the engine.
139 void SetGCMStoreForTesting(GCMStore* gcm_store); 132 void SetGCMStoreForTesting(GCMStore* gcm_store);
140 133
141 private: 134 private:
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 HeartbeatManager heartbeat_manager_; 261 HeartbeatManager heartbeat_manager_;
269 262
270 base::WeakPtrFactory<MCSClient> weak_ptr_factory_; 263 base::WeakPtrFactory<MCSClient> weak_ptr_factory_;
271 264
272 DISALLOW_COPY_AND_ASSIGN(MCSClient); 265 DISALLOW_COPY_AND_ASSIGN(MCSClient);
273 }; 266 };
274 267
275 } // namespace gcm 268 } // namespace gcm
276 269
277 #endif // GOOGLE_APIS_GCM_ENGINE_MCS_CLIENT_H_ 270 #endif // GOOGLE_APIS_GCM_ENGINE_MCS_CLIENT_H_
OLDNEW
« no previous file with comments | « chrome/browser/sync/profile_sync_service_factory.cc ('k') | google_apis/gcm/engine/mcs_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698