Index: components/gcm_driver/fake_gcm_client.cc |
diff --git a/components/gcm_driver/fake_gcm_client.cc b/components/gcm_driver/fake_gcm_client.cc |
index 6ad3816e1810e87fd40d459e2225d9288ba390ce..605122249165ac171af3e5e52a8bb201073e7235 100644 |
--- a/components/gcm_driver/fake_gcm_client.cc |
+++ b/components/gcm_driver/fake_gcm_client.cc |
@@ -8,6 +8,7 @@ |
#include "base/logging.h" |
#include "base/message_loop/message_loop.h" |
#include "base/sequenced_task_runner.h" |
+#include "base/strings/string_number_conversions.h" |
#include "base/sys_byteorder.h" |
#include "base/time/time.h" |
#include "google_apis/gcm/base/encryptor.h" |
@@ -21,6 +22,7 @@ FakeGCMClient::FakeGCMClient( |
const scoped_refptr<base::SequencedTaskRunner>& ui_thread, |
const scoped_refptr<base::SequencedTaskRunner>& io_thread) |
: delegate_(NULL), |
+ sequence_id_(0), |
status_(UNINITIALIZED), |
start_mode_(start_mode), |
ui_thread_(ui_thread), |
@@ -68,6 +70,7 @@ void FakeGCMClient::Stop() { |
void FakeGCMClient::CheckOut() { |
DCHECK(io_thread_->RunsTasksOnCurrentThread()); |
status_ = CHECKED_OUT; |
+ sequence_id_++; |
} |
void FakeGCMClient::Register(const std::string& app_id, |
@@ -157,9 +160,8 @@ void FakeGCMClient::DeleteMessages(const std::string& app_id) { |
app_id)); |
} |
-// static |
std::string FakeGCMClient::GetRegistrationIdFromSenderIds( |
- const std::vector<std::string>& sender_ids) { |
+ const std::vector<std::string>& sender_ids) const { |
// GCMService normalizes the sender IDs by making them sorted. |
std::vector<std::string> normalized_sender_ids = sender_ids; |
std::sort(normalized_sender_ids.begin(), normalized_sender_ids.end()); |
@@ -175,6 +177,7 @@ std::string FakeGCMClient::GetRegistrationIdFromSenderIds( |
registration_id += ","; |
registration_id += normalized_sender_ids[i]; |
} |
+ registration_id += base::IntToString(sequence_id_); |
} |
return registration_id; |
} |