Commit e83d5c13 authored by johnme's avatar johnme Committed by Commit bot

Pass incoming sender_id to GCMStatsRecorderAndroid

BUG=none

Review-Url: https://codereview.chromium.org/2250263007
Cr-Commit-Position: refs/heads/master@{#413379}
parent cbe7b172
......@@ -106,7 +106,8 @@ void GCMDriverAndroid::OnMessageReceived(
message_byte_size += message.raw_data.size();
}
recorder_.RecordDataMessageReceived(app_id, message_byte_size);
recorder_.RecordDataMessageReceived(app_id, message.sender_id,
message_byte_size);
DispatchMessage(app_id, message);
}
......
......@@ -104,12 +104,14 @@ void GCMStatsRecorderAndroid::RecordRegistration(const std::string& app_id,
void GCMStatsRecorderAndroid::RecordDataMessageReceived(
const std::string& app_id,
const std::string& from,
int message_byte_size) {
if (!is_recording_)
return;
ReceivingActivity activity;
activity.app_id = app_id;
activity.from = from;
activity.message_byte_size = message_byte_size;
activity.event = "Data msg received";
......
......@@ -57,6 +57,7 @@ class GCMStatsRecorderAndroid {
// Records that a data message has been received for |app_id|.
void RecordDataMessageReceived(const std::string& app_id,
const std::string& from,
int message_byte_size);
// Records a message decryption failure caused by |result| for |app_id|.
......
......@@ -14,6 +14,7 @@ namespace gcm {
namespace {
const char kTestAppId[] = "test_app_id";
const char kTestSenderId[] = "test_sender_id";
class GCMStatsRecorderAndroidTest : public ::testing::Test,
public GCMStatsRecorderAndroid::Delegate {
......@@ -53,7 +54,8 @@ TEST_F(GCMStatsRecorderAndroidTest, RecordsAndCallsDelegate) {
recorder.RecordUnregistrationResponse(kTestAppId, true /* success */);
EXPECT_EQ(4u, activity_recorded_calls());
recorder.RecordDataMessageReceived(kTestAppId, 42 /* message_byte_size */);
recorder.RecordDataMessageReceived(kTestAppId, kTestSenderId,
42 /* message_byte_size */);
EXPECT_EQ(5u, activity_recorded_calls());
recorder.RecordDecryptionFailure(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment