OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef GOOGLE_APIS_GCM_GCM_ACTIVITY_H_ | |
6 #define GOOGLE_APIS_GCM_GCM_ACTIVITY_H_ | |
7 | |
8 #include <string> | |
9 #include <vector> | |
10 | |
11 #include "base/time/time.h" | |
12 #include "google_apis/gcm/base/gcm_export.h" | |
13 | |
14 namespace gcm { | |
15 | |
16 // Contains data that are common to all activity kinds below. | |
17 struct GCM_EXPORT Activity { | |
18 Activity(); | |
19 virtual ~Activity(); | |
20 | |
21 base::Time time; | |
22 std::string event; // A short description of the event. | |
23 std::string details; // Any additional detail about the event. | |
24 }; | |
25 | |
26 // Contains relevant data of a connection activity. | |
27 struct GCM_EXPORT ConnectionActivity : Activity { | |
28 ConnectionActivity(); | |
29 virtual ~ConnectionActivity(); | |
30 }; | |
31 | |
32 // Contains relevant data of a check-in activity. | |
33 struct GCM_EXPORT CheckinActivity : Activity { | |
34 CheckinActivity(); | |
35 virtual ~CheckinActivity(); | |
36 }; | |
37 | |
38 // Contains relevant data of a registration/unregistration step. | |
39 struct GCM_EXPORT RegistrationActivity : Activity { | |
40 RegistrationActivity(); | |
41 virtual ~RegistrationActivity(); | |
42 | |
43 std::string app_id; | |
44 std::string sender_ids; // Comma separated sender ids. | |
45 }; | |
46 | |
47 // Contains relevant data of a message receiving event. | |
48 struct GCM_EXPORT ReceivingActivity : Activity { | |
49 ReceivingActivity(); | |
50 virtual ~ReceivingActivity(); | |
51 | |
52 std::string app_id; | |
53 std::string from; | |
54 int message_byte_size; | |
55 }; | |
56 | |
57 // Contains relevant data of a send-message step. | |
58 struct GCM_EXPORT SendingActivity : Activity { | |
59 SendingActivity(); | |
60 virtual ~SendingActivity(); | |
61 | |
62 std::string app_id; | |
63 std::string receiver_id; | |
64 std::string message_id; | |
65 }; | |
66 | |
67 struct GCM_EXPORT RecordedActivities { | |
68 RecordedActivities(); | |
69 virtual ~RecordedActivities(); | |
70 | |
71 std::vector<CheckinActivity> checkin_activities; | |
72 std::vector<ConnectionActivity> connection_activities; | |
73 std::vector<RegistrationActivity> registration_activities; | |
74 std::vector<ReceivingActivity> receiving_activities; | |
75 std::vector<SendingActivity> sending_activities; | |
76 }; | |
77 | |
78 } // namespace gcm | |
79 | |
80 #endif // GOOGLE_APIS_GCM_GCM_ACTIVITY_H_ | |
OLD | NEW |