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

Side by Side Diff: google_apis/gcm/gcm_client_impl.h

Issue 165993005: [GCM] Make sure GCM checkout logic is invoked when the profile is signed out (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix trybots Created 6 years, 10 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_GCM_CLIENT_IMPL_H_ 5 #ifndef GOOGLE_APIS_GCM_GCM_CLIENT_IMPL_H_
6 #define GOOGLE_APIS_GCM_GCM_CLIENT_IMPL_H_ 6 #define GOOGLE_APIS_GCM_GCM_CLIENT_IMPL_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 virtual ~GCMClientImpl(); 47 virtual ~GCMClientImpl();
48 48
49 // Overridden from GCMClient: 49 // Overridden from GCMClient:
50 virtual void Initialize( 50 virtual void Initialize(
51 const checkin_proto::ChromeBuildProto& chrome_build_proto, 51 const checkin_proto::ChromeBuildProto& chrome_build_proto,
52 const base::FilePath& store_path, 52 const base::FilePath& store_path,
53 const scoped_refptr<base::SequencedTaskRunner>& blocking_task_runner, 53 const scoped_refptr<base::SequencedTaskRunner>& blocking_task_runner,
54 const scoped_refptr<net::URLRequestContextGetter>& 54 const scoped_refptr<net::URLRequestContextGetter>&
55 url_request_context_getter, 55 url_request_context_getter,
56 Delegate* delegate) OVERRIDE; 56 Delegate* delegate) OVERRIDE;
57 virtual void CheckIn() OVERRIDE;
57 virtual void CheckOut() OVERRIDE; 58 virtual void CheckOut() OVERRIDE;
58 virtual void Register(const std::string& app_id, 59 virtual void Register(const std::string& app_id,
59 const std::string& cert, 60 const std::string& cert,
60 const std::vector<std::string>& sender_ids) OVERRIDE; 61 const std::vector<std::string>& sender_ids) OVERRIDE;
61 virtual void Unregister(const std::string& app_id) OVERRIDE; 62 virtual void Unregister(const std::string& app_id) OVERRIDE;
62 virtual void Send(const std::string& app_id, 63 virtual void Send(const std::string& app_id,
63 const std::string& receiver_id, 64 const std::string& receiver_id,
64 const OutgoingMessage& message) OVERRIDE; 65 const OutgoingMessage& message) OVERRIDE;
65 virtual bool IsReady() const OVERRIDE;
66 66
67 private: 67 private:
68 // State representation of the GCMClient. 68 // State representation of the GCMClient.
69 enum State { 69 enum State {
70 // Uninitialized. 70 // Uninitialized.
71 UNINITIALIZED, 71 UNINITIALIZED,
72 // GCM store loading is in progress. 72 // GCM store loading is in progress.
73 LOADING, 73 LOADING,
74 // Initial device checkin is in progress. 74 // Initial device checkin is in progress.
75 INITIAL_DEVICE_CHECKIN, 75 INITIAL_DEVICE_CHECKIN,
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 void SetDeviceCredentialsCallback(bool success); 142 void SetDeviceCredentialsCallback(bool success);
143 143
144 // Completes the registration request. 144 // Completes the registration request.
145 void OnRegisterCompleted(const std::string& app_id, 145 void OnRegisterCompleted(const std::string& app_id,
146 RegistrationRequest::Status status, 146 RegistrationRequest::Status status,
147 const std::string& registration_id); 147 const std::string& registration_id);
148 148
149 // Completes the unregistration request. 149 // Completes the unregistration request.
150 void OnUnregisterCompleted(const std::string& app_id, bool status); 150 void OnUnregisterCompleted(const std::string& app_id, bool status);
151 151
152 // Completes the GCM store destroy request.
153 void OnGCMStoreDestroyed(bool success);
154
152 // Handles incoming data message and dispatches it the a relevant user 155 // Handles incoming data message and dispatches it the a relevant user
153 // delegate. 156 // delegate.
154 void HandleIncomingMessage(const gcm::MCSMessage& message); 157 void HandleIncomingMessage(const gcm::MCSMessage& message);
155 158
156 // Fires OnMessageSendError event on |delegate|, with specified |app_id| and 159 // Fires OnMessageSendError event on |delegate|, with specified |app_id| and
157 // message ID obtained from |incoming_message| if one is available. 160 // message ID obtained from |incoming_message| if one is available.
158 void NotifyDelegateOnMessageSendError( 161 void NotifyDelegateOnMessageSendError(
159 GCMClient::Delegate* delegate, 162 GCMClient::Delegate* delegate,
160 const std::string& app_id, 163 const std::string& app_id,
161 const IncomingMessage& incoming_message); 164 const IncomingMessage& incoming_message);
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 211
209 // Factory for creating references in callbacks. 212 // Factory for creating references in callbacks.
210 base::WeakPtrFactory<GCMClientImpl> weak_ptr_factory_; 213 base::WeakPtrFactory<GCMClientImpl> weak_ptr_factory_;
211 214
212 DISALLOW_COPY_AND_ASSIGN(GCMClientImpl); 215 DISALLOW_COPY_AND_ASSIGN(GCMClientImpl);
213 }; 216 };
214 217
215 } // namespace gcm 218 } // namespace gcm
216 219
217 #endif // GOOGLE_APIS_GCM_GCM_CLIENT_IMPL_H_ 220 #endif // GOOGLE_APIS_GCM_GCM_CLIENT_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698