OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef GOOGLE_APIS_GCM_GCM_STATS_RECORDER_IMPL_H_ | 5 #ifndef COMPONENTS_GCM_DRIVER_GCM_STATS_RECORDER_IMPL_H_ |
6 #define GOOGLE_APIS_GCM_GCM_STATS_RECORDER_IMPL_H_ | 6 #define COMPONENTS_GCM_DRIVER_GCM_STATS_RECORDER_IMPL_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
13 #include "google_apis/gcm/base/gcm_export.h" | 13 #include "components/gcm_driver/gcm_activity.h" |
14 #include "google_apis/gcm/engine/connection_factory.h" | 14 #include "google_apis/gcm/engine/connection_factory.h" |
15 #include "google_apis/gcm/engine/mcs_client.h" | 15 #include "google_apis/gcm/engine/mcs_client.h" |
16 #include "google_apis/gcm/engine/registration_request.h" | 16 #include "google_apis/gcm/engine/registration_request.h" |
17 #include "google_apis/gcm/engine/unregistration_request.h" | 17 #include "google_apis/gcm/engine/unregistration_request.h" |
18 #include "google_apis/gcm/gcm_activity.h" | |
19 #include "google_apis/gcm/monitoring/gcm_stats_recorder.h" | 18 #include "google_apis/gcm/monitoring/gcm_stats_recorder.h" |
20 | 19 |
21 namespace gcm { | 20 namespace gcm { |
22 | 21 |
23 // Records GCM internal stats and activities for debugging purpose. Recording | 22 // Records GCM internal stats and activities for debugging purpose. Recording |
24 // can be turned on/off by calling SetRecording(...) function. It is turned off | 23 // can be turned on/off by calling SetRecording(...) function. It is turned off |
25 // by default. | 24 // by default. |
26 // This class is not thread safe. It is meant to be owned by a gcm client | 25 // This class is not thread safe. It is meant to be owned by a gcm client |
27 // instance. | 26 // instance. |
28 class GCM_EXPORT GCMStatsRecorderImpl : public GCMStatsRecorder { | 27 class GCMStatsRecorderImpl : public GCMStatsRecorder { |
29 public: | 28 public: |
30 GCMStatsRecorderImpl(); | 29 GCMStatsRecorderImpl(); |
31 virtual ~GCMStatsRecorderImpl(); | 30 virtual ~GCMStatsRecorderImpl(); |
32 | 31 |
33 // Indicates whether the recorder is currently recording activities or not. | 32 // Indicates whether the recorder is currently recording activities or not. |
34 bool is_recording() const { | 33 bool is_recording() const { |
35 return is_recording_; | 34 return is_recording_; |
36 } | 35 } |
37 | 36 |
38 // Turns recording on/off. | 37 // Turns recording on/off. |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 std::deque<ConnectionActivity> connection_activities_; | 145 std::deque<ConnectionActivity> connection_activities_; |
147 std::deque<RegistrationActivity> registration_activities_; | 146 std::deque<RegistrationActivity> registration_activities_; |
148 std::deque<ReceivingActivity> receiving_activities_; | 147 std::deque<ReceivingActivity> receiving_activities_; |
149 std::deque<SendingActivity> sending_activities_; | 148 std::deque<SendingActivity> sending_activities_; |
150 | 149 |
151 DISALLOW_COPY_AND_ASSIGN(GCMStatsRecorderImpl); | 150 DISALLOW_COPY_AND_ASSIGN(GCMStatsRecorderImpl); |
152 }; | 151 }; |
153 | 152 |
154 } // namespace gcm | 153 } // namespace gcm |
155 | 154 |
156 #endif // GOOGLE_APIS_GCM_GCM_STATS_RECORDER_IMPL_H_ | 155 #endif // COMPONENTS_GCM_DRIVER_GCM_STATS_RECORDER_IMPL_H_ |
OLD | NEW |