diff options
author | jianli@chromium.org <jianli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-24 01:35:01 +0000 |
---|---|---|
committer | jianli@chromium.org <jianli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-24 01:35:01 +0000 |
commit | 5da9380c7854a095cdb8388575ea1a93fa1def6f (patch) | |
tree | 61e6f835b12840961c8b796303fc672a2cfd1b7b /google_apis/gcm/monitoring | |
parent | e90f4a7ba319c021416cc6b2cbdd05e20927f1ca (diff) | |
download | chromium_src-5da9380c7854a095cdb8388575ea1a93fa1def6f.zip chromium_src-5da9380c7854a095cdb8388575ea1a93fa1def6f.tar.gz chromium_src-5da9380c7854a095cdb8388575ea1a93fa1def6f.tar.bz2 |
Move all gcm activity types out of GCMStatsRecorder
This is needed to remove dependency on GCMStatsRecorder from GCMClient.
BUG=356716
TEST=existing tests
TBR=arv@chromium.org
Review URL: https://codereview.chromium.org/294053017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@272675 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'google_apis/gcm/monitoring')
-rw-r--r-- | google_apis/gcm/monitoring/gcm_stats_recorder.cc | 44 | ||||
-rw-r--r-- | google_apis/gcm/monitoring/gcm_stats_recorder.h | 63 | ||||
-rw-r--r-- | google_apis/gcm/monitoring/gcm_stats_recorder_unittest.cc | 10 |
3 files changed, 6 insertions, 111 deletions
diff --git a/google_apis/gcm/monitoring/gcm_stats_recorder.cc b/google_apis/gcm/monitoring/gcm_stats_recorder.cc index d08c611..f6c3e0f 100644 --- a/google_apis/gcm/monitoring/gcm_stats_recorder.cc +++ b/google_apis/gcm/monitoring/gcm_stats_recorder.cc @@ -140,50 +140,6 @@ std::string GetUnregistrationStatusString( } // namespace -GCMStatsRecorder::Activity::Activity() - : time(base::Time::Now()) { -} - -GCMStatsRecorder::Activity::~Activity() { -} - -GCMStatsRecorder::CheckinActivity::CheckinActivity() { -} - -GCMStatsRecorder::CheckinActivity::~CheckinActivity() { -} - -GCMStatsRecorder::ConnectionActivity::ConnectionActivity() { -} - -GCMStatsRecorder::ConnectionActivity::~ConnectionActivity() { -} - -GCMStatsRecorder::RegistrationActivity::RegistrationActivity() { -} - -GCMStatsRecorder::RegistrationActivity::~RegistrationActivity() { -} - -GCMStatsRecorder::ReceivingActivity::ReceivingActivity() - : message_byte_size(0) { -} - -GCMStatsRecorder::ReceivingActivity::~ReceivingActivity() { -} - -GCMStatsRecorder::SendingActivity::SendingActivity() { -} - -GCMStatsRecorder::SendingActivity::~SendingActivity() { -} - -GCMStatsRecorder::RecordedActivities::RecordedActivities() { -} - -GCMStatsRecorder::RecordedActivities::~RecordedActivities() { -} - GCMStatsRecorder::GCMStatsRecorder() : is_recording_(false), delegate_(NULL) { } diff --git a/google_apis/gcm/monitoring/gcm_stats_recorder.h b/google_apis/gcm/monitoring/gcm_stats_recorder.h index bc2afb2..45cf5fc 100644 --- a/google_apis/gcm/monitoring/gcm_stats_recorder.h +++ b/google_apis/gcm/monitoring/gcm_stats_recorder.h @@ -15,6 +15,7 @@ #include "google_apis/gcm/engine/mcs_client.h" #include "google_apis/gcm/engine/registration_request.h" #include "google_apis/gcm/engine/unregistration_request.h" +#include "google_apis/gcm/gcm_activity.h" namespace gcm { @@ -33,68 +34,6 @@ class GCM_EXPORT GCMStatsRecorder { DELETED_MESSAGES, }; - // Contains data that are common to all activity kinds below. - struct GCM_EXPORT Activity { - Activity(); - virtual ~Activity(); - - base::Time time; - std::string event; // A short description of the event. - std::string details; // Any additional detail about the event. - }; - - // Contains relevant data of a connection activity. - struct GCM_EXPORT ConnectionActivity : Activity { - ConnectionActivity(); - virtual ~ConnectionActivity(); - }; - - // Contains relevant data of a check-in activity. - struct GCM_EXPORT CheckinActivity : Activity { - CheckinActivity(); - virtual ~CheckinActivity(); - }; - - // Contains relevant data of a registration/unregistration step. - struct GCM_EXPORT RegistrationActivity : Activity { - RegistrationActivity(); - virtual ~RegistrationActivity(); - - std::string app_id; - std::string sender_ids; // Comma separated sender ids. - }; - - // Contains relevant data of a message receiving event. - struct GCM_EXPORT ReceivingActivity : Activity { - ReceivingActivity(); - virtual ~ReceivingActivity(); - - std::string app_id; - std::string from; - int message_byte_size; - }; - - // Contains relevant data of a send-message step. - struct GCM_EXPORT SendingActivity : Activity { - SendingActivity(); - virtual ~SendingActivity(); - - std::string app_id; - std::string receiver_id; - std::string message_id; - }; - - struct GCM_EXPORT RecordedActivities { - RecordedActivities(); - virtual ~RecordedActivities(); - - std::vector<GCMStatsRecorder::CheckinActivity> checkin_activities; - std::vector<GCMStatsRecorder::ConnectionActivity> connection_activities; - std::vector<GCMStatsRecorder::RegistrationActivity> registration_activities; - std::vector<GCMStatsRecorder::ReceivingActivity> receiving_activities; - std::vector<GCMStatsRecorder::SendingActivity> sending_activities; - }; - // A delegate interface that allows the GCMStatsRecorder instance to interact // with its container. class Delegate { diff --git a/google_apis/gcm/monitoring/gcm_stats_recorder_unittest.cc b/google_apis/gcm/monitoring/gcm_stats_recorder_unittest.cc index c9256c7..c8756ec 100644 --- a/google_apis/gcm/monitoring/gcm_stats_recorder_unittest.cc +++ b/google_apis/gcm/monitoring/gcm_stats_recorder_unittest.cc @@ -286,7 +286,7 @@ class GCMStatsRecorderTest : public testing::Test { protected: void VerifyCheckin( - const std::deque<GCMStatsRecorder::CheckinActivity>& queue, + const std::deque<CheckinActivity>& queue, const std::string& event, const std::string& details, const std::string& remark) { @@ -295,7 +295,7 @@ class GCMStatsRecorderTest : public testing::Test { } void VerifyConnection( - const std::deque<GCMStatsRecorder::ConnectionActivity>& queue, + const std::deque<ConnectionActivity>& queue, const std::string& event, const std::string& details, const std::string& remark) { @@ -304,7 +304,7 @@ class GCMStatsRecorderTest : public testing::Test { } void VerifyRegistration( - const std::deque<GCMStatsRecorder::RegistrationActivity>& queue, + const std::deque<RegistrationActivity>& queue, const std::string& sender_ids, const std::string& event, const std::string& details, @@ -316,7 +316,7 @@ class GCMStatsRecorderTest : public testing::Test { } void VerifyReceivingData( - const std::deque<GCMStatsRecorder::ReceivingActivity>& queue, + const std::deque<ReceivingActivity>& queue, const std::string& event, const std::string& details, const std::string& remark) { @@ -328,7 +328,7 @@ class GCMStatsRecorderTest : public testing::Test { } void VerifySendingData( - const std::deque<GCMStatsRecorder::SendingActivity>& queue, + const std::deque<SendingActivity>& queue, const std::string& event, const std::string& details, const std::string& remark) { EXPECT_EQ(kAppId, queue.front().app_id) << remark; |