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

Side by Side Diff: components/gcm_driver/gcm_client_impl.h

Issue 445683003: [GCM] Exposing persistence of account mappings in GCM Driver (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updates based on self review Created 6 years, 4 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 COMPONENTS_GCM_DRIVER_GCM_CLIENT_IMPL_H_ 5 #ifndef COMPONENTS_GCM_DRIVER_GCM_CLIENT_IMPL_H_
6 #define COMPONENTS_GCM_DRIVER_GCM_CLIENT_IMPL_H_ 6 #define COMPONENTS_GCM_DRIVER_GCM_CLIENT_IMPL_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 const std::vector<std::string>& sender_ids) OVERRIDE; 98 const std::vector<std::string>& sender_ids) OVERRIDE;
99 virtual void Unregister(const std::string& app_id) OVERRIDE; 99 virtual void Unregister(const std::string& app_id) OVERRIDE;
100 virtual void Send(const std::string& app_id, 100 virtual void Send(const std::string& app_id,
101 const std::string& receiver_id, 101 const std::string& receiver_id,
102 const OutgoingMessage& message) OVERRIDE; 102 const OutgoingMessage& message) OVERRIDE;
103 virtual void SetRecording(bool recording) OVERRIDE; 103 virtual void SetRecording(bool recording) OVERRIDE;
104 virtual void ClearActivityLogs() OVERRIDE; 104 virtual void ClearActivityLogs() OVERRIDE;
105 virtual GCMStatistics GetStatistics() const OVERRIDE; 105 virtual GCMStatistics GetStatistics() const OVERRIDE;
106 virtual void SetAccountsForCheckin( 106 virtual void SetAccountsForCheckin(
107 const std::map<std::string, std::string>& account_tokens) OVERRIDE; 107 const std::map<std::string, std::string>& account_tokens) OVERRIDE;
108 virtual void UpdateAccountMapping(
109 const AccountMapping& account_mapping) OVERRIDE;
110 virtual void RemoveAccountMapping(const std::string& account_id) OVERRIDE;
108 111
109 // GCMStatsRecorder::Delegate implemenation. 112 // GCMStatsRecorder::Delegate implemenation.
110 virtual void OnActivityRecorded() OVERRIDE; 113 virtual void OnActivityRecorded() OVERRIDE;
111 114
112 // ConnectionFactory::ConnectionListener implementation. 115 // ConnectionFactory::ConnectionListener implementation.
113 virtual void OnConnected(const GURL& current_server, 116 virtual void OnConnected(const GURL& current_server,
114 const net::IPEndPoint& ip_endpoint) OVERRIDE; 117 const net::IPEndPoint& ip_endpoint) OVERRIDE;
115 virtual void OnDisconnected() OVERRIDE; 118 virtual void OnDisconnected() OVERRIDE;
116 119
117 private: 120 private:
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 base::TimeDelta GetTimeToNextCheckin() const; 218 base::TimeDelta GetTimeToNextCheckin() const;
216 // Callback for setting last checkin information in the |gcm_store_|. 219 // Callback for setting last checkin information in the |gcm_store_|.
217 void SetLastCheckinInfoCallback(bool success); 220 void SetLastCheckinInfoCallback(bool success);
218 221
219 // Callback for persisting device credentials in the |gcm_store_|. 222 // Callback for persisting device credentials in the |gcm_store_|.
220 void SetDeviceCredentialsCallback(bool success); 223 void SetDeviceCredentialsCallback(bool success);
221 224
222 // Callback for persisting registration info in the |gcm_store_|. 225 // Callback for persisting registration info in the |gcm_store_|.
223 void UpdateRegistrationCallback(bool success); 226 void UpdateRegistrationCallback(bool success);
224 227
228 // Callback for all store operations that do not try to recover, if write in
229 // |gcm_store_| fails.
230 void DefaultStoreCallback(bool success);
231
225 // Completes the registration request. 232 // Completes the registration request.
226 void OnRegisterCompleted(const std::string& app_id, 233 void OnRegisterCompleted(const std::string& app_id,
227 const std::vector<std::string>& sender_ids, 234 const std::vector<std::string>& sender_ids,
228 RegistrationRequest::Status status, 235 RegistrationRequest::Status status,
229 const std::string& registration_id); 236 const std::string& registration_id);
230 237
231 // Completes the unregistration request. 238 // Completes the unregistration request.
232 void OnUnregisterCompleted(const std::string& app_id, 239 void OnUnregisterCompleted(const std::string& app_id,
233 UnregistrationRequest::Status status); 240 UnregistrationRequest::Status status);
234 241
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 319
313 // Factory for creating references in callbacks. 320 // Factory for creating references in callbacks.
314 base::WeakPtrFactory<GCMClientImpl> weak_ptr_factory_; 321 base::WeakPtrFactory<GCMClientImpl> weak_ptr_factory_;
315 322
316 DISALLOW_COPY_AND_ASSIGN(GCMClientImpl); 323 DISALLOW_COPY_AND_ASSIGN(GCMClientImpl);
317 }; 324 };
318 325
319 } // namespace gcm 326 } // namespace gcm
320 327
321 #endif // COMPONENTS_GCM_DRIVER_GCM_CLIENT_IMPL_H_ 328 #endif // COMPONENTS_GCM_DRIVER_GCM_CLIENT_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698