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

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

Issue 2578583002: Provide a mechanism for the GCM driver to send message receipts to GCM.
Patch Set: Fix issue with rebase Created 3 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
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_H_ 5 #ifndef COMPONENTS_GCM_DRIVER_GCM_CLIENT_H_
6 #define COMPONENTS_GCM_DRIVER_GCM_CLIENT_H_ 6 #define COMPONENTS_GCM_DRIVER_GCM_CLIENT_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
11 #include <memory> 11 #include <memory>
12 #include <string> 12 #include <string>
13 #include <vector> 13 #include <vector>
14 14
15 #include "base/memory/linked_ptr.h" 15 #include "base/memory/linked_ptr.h"
16 #include "components/gcm_driver/common/gcm_messages.h" 16 #include "components/gcm_driver/common/gcm_messages.h"
17 #include "components/gcm_driver/crypto/gcm_encryption_provider.h" 17 #include "components/gcm_driver/crypto/gcm_encryption_provider.h"
18 #include "components/gcm_driver/gcm_activity.h" 18 #include "components/gcm_driver/gcm_activity.h"
19 #include "components/gcm_driver/gcm_message_status.h"
19 #include "components/gcm_driver/registration_info.h" 20 #include "components/gcm_driver/registration_info.h"
20 21
21 template <class T> class scoped_refptr; 22 template <class T> class scoped_refptr;
22 23
23 namespace base { 24 namespace base {
24 class FilePath; 25 class FilePath;
25 class SequencedTaskRunner; 26 class SequencedTaskRunner;
26 class Timer; 27 class Timer;
27 } 28 }
28 29
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 // |app_id|: application ID. 171 // |app_id|: application ID.
171 // |message_id|: ID of the message being sent. 172 // |message_id|: ID of the message being sent.
172 // |result|: the type of the error if an error occured, success otherwise. 173 // |result|: the type of the error if an error occured, success otherwise.
173 virtual void OnSendFinished(const std::string& app_id, 174 virtual void OnSendFinished(const std::string& app_id,
174 const std::string& message_id, 175 const std::string& message_id,
175 Result result) = 0; 176 Result result) = 0;
176 177
177 // Called when a message has been received. 178 // Called when a message has been received.
178 // |app_id|: application ID. 179 // |app_id|: application ID.
179 // |message|: message received. 180 // |message|: message received.
180 virtual void OnMessageReceived(const std::string& app_id, 181 // |optional_optional_receipt_callback|: Optional callback to invoke if
181 const IncomingMessage& message) = 0; 182 // desired when processing the message is complete if the receiver wants to
183 // return a delivery receipt. The callback must be invoked on the IO thread.
184 virtual void OnMessageReceived(
185 const std::string& app_id,
186 const IncomingMessage& message,
187 const MessageReceiptCallback& optional_receipt_callback) = 0;
182 188
183 // Called when some messages have been deleted from the server. 189 // Called when some messages have been deleted from the server.
184 // |app_id|: application ID. 190 // |app_id|: application ID.
185 virtual void OnMessagesDeleted(const std::string& app_id) = 0; 191 virtual void OnMessagesDeleted(const std::string& app_id) = 0;
186 192
187 // Called when a message failed to send to the server. 193 // Called when a message failed to send to the server.
188 // |app_id|: application ID. 194 // |app_id|: application ID.
189 // |send_error_detials|: Details of the send error event, like mesasge ID. 195 // |send_error_detials|: Details of the send error event, like mesasge ID.
190 virtual void OnMessageSendError( 196 virtual void OnMessageSendError(
191 const std::string& app_id, 197 const std::string& app_id,
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 // to be set, and allows that component to later revoke the setting. It should 338 // to be set, and allows that component to later revoke the setting. It should
333 // be unique. 339 // be unique.
334 virtual void AddHeartbeatInterval(const std::string& scope, 340 virtual void AddHeartbeatInterval(const std::string& scope,
335 int interval_ms) = 0; 341 int interval_ms) = 0;
336 virtual void RemoveHeartbeatInterval(const std::string& scope) = 0; 342 virtual void RemoveHeartbeatInterval(const std::string& scope) = 0;
337 }; 343 };
338 344
339 } // namespace gcm 345 } // namespace gcm
340 346
341 #endif // COMPONENTS_GCM_DRIVER_GCM_CLIENT_H_ 347 #endif // COMPONENTS_GCM_DRIVER_GCM_CLIENT_H_
OLDNEW
« no previous file with comments | « components/gcm_driver/gcm_account_mapper_unittest.cc ('k') | components/gcm_driver/gcm_client_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698