Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(278)

Side by Side Diff: components/gcm_driver/gcm_stats_recorder_android.h

Issue 1627723002: Revert of List message decryption failures on chrome://gcm-internals (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 COMPONENTS_GCM_DRIVER_GCM_STATS_RECORDER_ANDROID_H_ 5 #ifndef COMPONENTS_GCM_DRIVER_GCM_STATS_RECORDER_ANDROID_H_
6 #define COMPONENTS_GCM_DRIVER_GCM_STATS_RECORDER_ANDROID_H_ 6 #define COMPONENTS_GCM_DRIVER_GCM_STATS_RECORDER_ANDROID_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <string> 9 #include <string>
10 10
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "components/gcm_driver/crypto/gcm_encryption_provider.h"
13 #include "components/gcm_driver/gcm_activity.h" 12 #include "components/gcm_driver/gcm_activity.h"
14 13
15 namespace gcm { 14 namespace gcm {
16 15
16 struct RecordedActivities;
17
17 // Stats recorder for Android, used for recording stats and activities on the 18 // Stats recorder for Android, used for recording stats and activities on the
18 // GCM Driver level for debugging purposes. Based on the GCMStatsRecorder, as 19 // GCM Driver level for debugging purposes. Based on the GCMStatsRecorder, as
19 // defined in the GCM Engine, which does not exist on Android. 20 // defined in the GCM Engine, which does not exist on Android.
20 //
21 // Note that this class, different from the GCMStatsRecorder(Impl), is expected
22 // to be used on the UI thread.
23 class GCMStatsRecorderAndroid { 21 class GCMStatsRecorderAndroid {
24 public: 22 public:
25 // A delegate interface that allows the GCMStatsRecorderAndroid instance to 23 // A delegate interface that allows the GCMStatsRecorderAndroid instance to
26 // interact with its container. 24 // interact with its container.
27 class Delegate { 25 class Delegate {
28 public: 26 public:
29 // Called when the GCMStatsRecorderAndroid is recording activities and a new 27 // Called when the GCMStatsRecorderAndroid is recording activities and a new
30 // activity has just been recorded. 28 // activity has just been recorded.
31 virtual void OnActivityRecorded() = 0; 29 virtual void OnActivityRecorded() = 0;
32 }; 30 };
(...skipping 19 matching lines...) Expand all
52 void RecordUnregistrationSent(const std::string& app_id); 50 void RecordUnregistrationSent(const std::string& app_id);
53 51
54 // Records that the unregistration sent for |app_id| has received a response. 52 // Records that the unregistration sent for |app_id| has received a response.
55 // |success| indicates whether the unregistration was successful. 53 // |success| indicates whether the unregistration was successful.
56 void RecordUnregistrationResponse(const std::string& app_id, bool success); 54 void RecordUnregistrationResponse(const std::string& app_id, bool success);
57 55
58 // Records that a data message has been received for |app_id|. 56 // Records that a data message has been received for |app_id|.
59 void RecordDataMessageReceived(const std::string& app_id, 57 void RecordDataMessageReceived(const std::string& app_id,
60 int message_byte_size); 58 int message_byte_size);
61 59
62 // Records a message decryption failure caused by |reason| for |app_id|.
63 void RecordDecryptionFailure(const std::string& app_id,
64 GCMEncryptionProvider::DecryptionFailure reason);
65
66 bool is_recording() const { return is_recording_; } 60 bool is_recording() const { return is_recording_; }
67 void set_is_recording(bool recording) { is_recording_ = recording; } 61 void set_is_recording(bool recording) { is_recording_ = recording; }
68 62
69 private: 63 private:
70 void RecordRegistration(const std::string& app_id, 64 void RecordRegistration(const std::string& app_id,
71 const std::string& event, 65 const std::string& event,
72 const std::string& details); 66 const std::string& details);
73 67
74 // Delegate made available by the container. May be a nullptr. 68 // Delegate made available by the container. May be a nullptr.
75 Delegate* delegate_; 69 Delegate* delegate_;
76 70
77 // Toggle determining whether the recorder is recording. 71 // Toggle determining whether the recorder is recording.
78 bool is_recording_ = false; 72 bool is_recording_ = false;
79 73
80 // Recorded registration activities (which includes unregistrations). 74 // Recorded registration activities (which includes unregistrations).
81 std::deque<RegistrationActivity> registration_activities_; 75 std::deque<RegistrationActivity> registration_activities_;
82 76
83 // Recorded received message activities. 77 // Recorded received message activities.
84 std::deque<ReceivingActivity> receiving_activities_; 78 std::deque<ReceivingActivity> receiving_activities_;
85 79
86 // Recorded message decryption failure activities.
87 std::deque<DecryptionFailureActivity> decryption_failure_activities_;
88
89 DISALLOW_COPY_AND_ASSIGN(GCMStatsRecorderAndroid); 80 DISALLOW_COPY_AND_ASSIGN(GCMStatsRecorderAndroid);
90 }; 81 };
91 82
92 } // namespace gcm 83 } // namespace gcm
93 84
94 #endif // COMPONENTS_GCM_DRIVER_GCM_STATS_RECORDER_ANDROID_H_ 85 #endif // COMPONENTS_GCM_DRIVER_GCM_STATS_RECORDER_ANDROID_H_
OLDNEW
« no previous file with comments | « components/gcm_driver/gcm_internals_helper.cc ('k') | components/gcm_driver/gcm_stats_recorder_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698