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

Unified Diff: google_apis/gcm/engine/gcm_store_impl.cc

Issue 148293002: [GCM] Add basic collapse key support for upstream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 6 years, 11 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: google_apis/gcm/engine/gcm_store_impl.cc
diff --git a/google_apis/gcm/engine/gcm_store_impl.cc b/google_apis/gcm/engine/gcm_store_impl.cc
index daf7d362fd90adb3005a612c7d894a872e4e2fd4..8c46ce04b6600b234334c4971d0fbdd5e21b33f8 100644
--- a/google_apis/gcm/engine/gcm_store_impl.cc
+++ b/google_apis/gcm/engine/gcm_store_impl.cc
@@ -710,6 +710,25 @@ bool GCMStoreImpl::AddOutgoingMessage(const std::string& persistent_id,
return false;
}
+void GCMStoreImpl::OverwriteOutgoingMessage(const std::string& persistent_id,
+ const MCSMessage& message,
+ const UpdateCallback& callback) {
+ DCHECK_EQ(message.tag(), kDataMessageStanzaTag);
+ std::string app_id = reinterpret_cast<const mcs_proto::DataMessageStanza*>(
+ &message.GetProtobuf())->from();
fgorski 2014/01/27 17:39:38 app_id is stored in category
Nicolas Zea 2014/01/28 08:15:35 from is supposed to store project id, and category
fgorski 2014/01/28 18:10:27 Ok. For upstream messages the following holds true
Nicolas Zea 2014/01/31 11:58:43 Done.
+ DCHECK(!app_id.empty());
+ // There should already be pending messages for this app.
+ DCHECK(app_message_counts_.count(app_id));
+ // TODO(zea); consider verifying the specific message already exists.
+ blocking_task_runner_->PostTask(
+ FROM_HERE,
+ base::Bind(&GCMStoreImpl::Backend::AddOutgoingMessage,
+ backend_,
+ persistent_id,
+ message,
+ callback));
+}
+
void GCMStoreImpl::RemoveOutgoingMessage(const std::string& persistent_id,
const UpdateCallback& callback) {
blocking_task_runner_->PostTask(

Powered by Google App Engine
This is Rietveld 408576698