[email protected] | 5da9380 | 2014-05-24 01:35:01 | [diff] [blame] | 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 | |||||
[email protected] | cd57f37 | 2014-06-09 17:13:06 | [diff] [blame] | 5 | #ifndef COMPONENTS_GCM_DRIVER_GCM_ACTIVITY_H_ |
6 | #define COMPONENTS_GCM_DRIVER_GCM_ACTIVITY_H_ | ||||
[email protected] | 5da9380 | 2014-05-24 01:35:01 | [diff] [blame] | 7 | |
8 | #include <string> | ||||
9 | #include <vector> | ||||
10 | |||||
11 | #include "base/time/time.h" | ||||
[email protected] | 5da9380 | 2014-05-24 01:35:01 | [diff] [blame] | 12 | |
13 | namespace gcm { | ||||
14 | |||||
15 | // Contains data that are common to all activity kinds below. | ||||
[email protected] | cd57f37 | 2014-06-09 17:13:06 | [diff] [blame] | 16 | struct Activity { |
[email protected] | 5da9380 | 2014-05-24 01:35:01 | [diff] [blame] | 17 | Activity(); |
18 | virtual ~Activity(); | ||||
19 | |||||
20 | base::Time time; | ||||
21 | std::string event; // A short description of the event. | ||||
22 | std::string details; // Any additional detail about the event. | ||||
23 | }; | ||||
24 | |||||
25 | // Contains relevant data of a connection activity. | ||||
[email protected] | cd57f37 | 2014-06-09 17:13:06 | [diff] [blame] | 26 | struct ConnectionActivity : Activity { |
[email protected] | 5da9380 | 2014-05-24 01:35:01 | [diff] [blame] | 27 | ConnectionActivity(); |
dcheng | 00ea022b | 2014-10-21 11:24:56 | [diff] [blame] | 28 | ~ConnectionActivity() override; |
[email protected] | 5da9380 | 2014-05-24 01:35:01 | [diff] [blame] | 29 | }; |
30 | |||||
31 | // Contains relevant data of a check-in activity. | ||||
[email protected] | cd57f37 | 2014-06-09 17:13:06 | [diff] [blame] | 32 | struct CheckinActivity : Activity { |
[email protected] | 5da9380 | 2014-05-24 01:35:01 | [diff] [blame] | 33 | CheckinActivity(); |
dcheng | 00ea022b | 2014-10-21 11:24:56 | [diff] [blame] | 34 | ~CheckinActivity() override; |
[email protected] | 5da9380 | 2014-05-24 01:35:01 | [diff] [blame] | 35 | }; |
36 | |||||
37 | // Contains relevant data of a registration/unregistration step. | ||||
[email protected] | cd57f37 | 2014-06-09 17:13:06 | [diff] [blame] | 38 | struct RegistrationActivity : Activity { |
[email protected] | 5da9380 | 2014-05-24 01:35:01 | [diff] [blame] | 39 | RegistrationActivity(); |
dcheng | 00ea022b | 2014-10-21 11:24:56 | [diff] [blame] | 40 | ~RegistrationActivity() override; |
[email protected] | 5da9380 | 2014-05-24 01:35:01 | [diff] [blame] | 41 | |
42 | std::string app_id; | ||||
jianli | fc047f3 | 2015-06-26 22:29:01 | [diff] [blame] | 43 | // For GCM, comma separated sender ids. For Instance ID, authorized entity. |
44 | std::string source; | ||||
[email protected] | 5da9380 | 2014-05-24 01:35:01 | [diff] [blame] | 45 | }; |
46 | |||||
47 | // Contains relevant data of a message receiving event. | ||||
[email protected] | cd57f37 | 2014-06-09 17:13:06 | [diff] [blame] | 48 | struct ReceivingActivity : Activity { |
[email protected] | 5da9380 | 2014-05-24 01:35:01 | [diff] [blame] | 49 | ReceivingActivity(); |
dcheng | 00ea022b | 2014-10-21 11:24:56 | [diff] [blame] | 50 | ~ReceivingActivity() override; |
[email protected] | 5da9380 | 2014-05-24 01:35:01 | [diff] [blame] | 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. | ||||
[email protected] | cd57f37 | 2014-06-09 17:13:06 | [diff] [blame] | 58 | struct SendingActivity : Activity { |
[email protected] | 5da9380 | 2014-05-24 01:35:01 | [diff] [blame] | 59 | SendingActivity(); |
dcheng | 00ea022b | 2014-10-21 11:24:56 | [diff] [blame] | 60 | ~SendingActivity() override; |
[email protected] | 5da9380 | 2014-05-24 01:35:01 | [diff] [blame] | 61 | |
62 | std::string app_id; | ||||
63 | std::string receiver_id; | ||||
64 | std::string message_id; | ||||
65 | }; | ||||
66 | |||||
peter | ee284ba5 | 2016-02-01 11:53:28 | [diff] [blame] | 67 | // Contains relevant data of a message decryption failure. |
68 | struct DecryptionFailureActivity : Activity { | ||||
69 | DecryptionFailureActivity(); | ||||
70 | ~DecryptionFailureActivity() override; | ||||
71 | |||||
72 | std::string app_id; | ||||
73 | }; | ||||
74 | |||||
[email protected] | cd57f37 | 2014-06-09 17:13:06 | [diff] [blame] | 75 | struct RecordedActivities { |
[email protected] | 5da9380 | 2014-05-24 01:35:01 | [diff] [blame] | 76 | RecordedActivities(); |
vmpstr | b6449d51 | 2016-02-25 23:55:40 | [diff] [blame] | 77 | RecordedActivities(const RecordedActivities& other); |
[email protected] | 5da9380 | 2014-05-24 01:35:01 | [diff] [blame] | 78 | virtual ~RecordedActivities(); |
79 | |||||
80 | std::vector<CheckinActivity> checkin_activities; | ||||
81 | std::vector<ConnectionActivity> connection_activities; | ||||
82 | std::vector<RegistrationActivity> registration_activities; | ||||
83 | std::vector<ReceivingActivity> receiving_activities; | ||||
84 | std::vector<SendingActivity> sending_activities; | ||||
peter | ee284ba5 | 2016-02-01 11:53:28 | [diff] [blame] | 85 | std::vector<DecryptionFailureActivity> decryption_failure_activities; |
[email protected] | 5da9380 | 2014-05-24 01:35:01 | [diff] [blame] | 86 | }; |
87 | |||||
88 | } // namespace gcm | ||||
89 | |||||
[email protected] | cd57f37 | 2014-06-09 17:13:06 | [diff] [blame] | 90 | #endif // COMPONENTS_GCM_DRIVER_GCM_ACTIVITY_H_ |