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

Unified Diff: components/gcm_driver/fake_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 side-by-side diff with in-line comments
Download patch
Index: components/gcm_driver/fake_gcm_client.h
diff --git a/components/gcm_driver/fake_gcm_client.h b/components/gcm_driver/fake_gcm_client.h
index 251b0fd5b22fe49d83ff94857fae1f775510d225..bd1d3ec9529b15856c128a1c65ce87f722fefc69 100644
--- a/components/gcm_driver/fake_gcm_client.h
+++ b/components/gcm_driver/fake_gcm_client.h
@@ -11,6 +11,7 @@
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "components/gcm_driver/gcm_client.h"
+#include "components/gcm_driver/gcm_message_status.h"
#include "components/gcm_driver/gcm_stats_recorder_impl.h"
namespace base {
@@ -87,6 +88,7 @@ class FakeGCMClient : public GCMClient {
// Simulate receiving something from the server.
// Called on UI thread.
void ReceiveMessage(const std::string& app_id,
+ const std::string& message_id,
const IncomingMessage& message);
void DeleteMessages(const std::string& app_id);
@@ -94,6 +96,10 @@ class FakeGCMClient : public GCMClient {
start_mode_overridding_ = overridding;
}
+ const std::string& receipt_app_id() const { return receipt_app_id_; }
+ const std::string& receipt_message_id() const { return receipt_message_id_; }
+ GCMMessageStatus receipt_status() const { return receipt_status_; }
+
private:
// Called on IO thread.
void DoStart();
@@ -105,12 +111,16 @@ class FakeGCMClient : public GCMClient {
const linked_ptr<RegistrationInfo>& registration_info);
void SendFinished(const std::string& app_id, const OutgoingMessage& message);
void MessageReceived(const std::string& app_id,
- const IncomingMessage& message);
+ const IncomingMessage& message,
+ const MessageReceiptCallback& optional_receipt_callback);
void MessagesDeleted(const std::string& app_id);
void MessageSendError(const std::string& app_id,
const SendErrorDetails& send_error_details);
void SendAcknowledgement(const std::string& app_id,
const std::string& message_id);
+ void SendMessageReceipt(const std::string& message_id,
+ const std::string& app_id,
+ GCMMessageStatus status);
Delegate* delegate_;
std::string product_category_for_subtypes_;
@@ -121,6 +131,9 @@ class FakeGCMClient : public GCMClient {
scoped_refptr<base::SequencedTaskRunner> io_thread_;
std::map<std::string, std::pair<std::string, std::string>> instance_id_data_;
GCMStatsRecorderImpl recorder_;
+ std::string receipt_app_id_;
+ std::string receipt_message_id_;
+ GCMMessageStatus receipt_status_;
base::WeakPtrFactory<FakeGCMClient> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(FakeGCMClient);
« no previous file with comments | « chrome/browser/push_messaging/push_messaging_service_unittest.cc ('k') | components/gcm_driver/fake_gcm_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698