OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 CHROME_BROWSER_CHROMEOS_POLICY_SYSTEM_LOG_UPLOADER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_SYSTEM_LOG_UPLOADER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_POLICY_SYSTEM_LOG_UPLOADER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_POLICY_SYSTEM_LOG_UPLOADER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 // Returns the time of the last upload attempt, or Time(0) if no upload has | 71 // Returns the time of the last upload attempt, or Time(0) if no upload has |
72 // ever happened. | 72 // ever happened. |
73 base::Time last_upload_attempt() const { return last_upload_attempt_; } | 73 base::Time last_upload_attempt() const { return last_upload_attempt_; } |
74 | 74 |
75 // UploadJob::Delegate: | 75 // UploadJob::Delegate: |
76 // Callbacks handle success and failure results of upload, destroy the | 76 // Callbacks handle success and failure results of upload, destroy the |
77 // upload job. | 77 // upload job. |
78 void OnSuccess() override; | 78 void OnSuccess() override; |
79 void OnFailure(UploadJob::ErrorCode error_code) override; | 79 void OnFailure(UploadJob::ErrorCode error_code) override; |
80 | 80 |
81 // Remove lines from |data| that contain common PII (IP addresses, SSIDs, URLs | |
82 // e-mail addresses). | |
83 static std::string RemoveSensitiveData(const std::string& data); | |
84 | |
85 private: | 81 private: |
86 // Updates the system log upload enabled field from settings. | 82 // Updates the system log upload enabled field from settings. |
87 void RefreshUploadSettings(); | 83 void RefreshUploadSettings(); |
88 | 84 |
89 // Starts the system log loading process. | 85 // Starts the system log loading process. |
90 void StartLogUpload(); | 86 void StartLogUpload(); |
91 | 87 |
92 // The callback is invoked by the Delegate if system logs have been loaded | 88 // The callback is invoked by the Delegate if system logs have been loaded |
93 // from disk, uploads system logs. | 89 // from disk, uploads system logs. |
94 void UploadSystemLogs(scoped_ptr<SystemLogs> system_logs); | 90 void UploadSystemLogs(scoped_ptr<SystemLogs> system_logs); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 // Note: This should remain the last member so it'll be destroyed and | 125 // Note: This should remain the last member so it'll be destroyed and |
130 // invalidate the weak pointers before any other members are destroyed. | 126 // invalidate the weak pointers before any other members are destroyed. |
131 base::WeakPtrFactory<SystemLogUploader> weak_factory_; | 127 base::WeakPtrFactory<SystemLogUploader> weak_factory_; |
132 | 128 |
133 DISALLOW_COPY_AND_ASSIGN(SystemLogUploader); | 129 DISALLOW_COPY_AND_ASSIGN(SystemLogUploader); |
134 }; | 130 }; |
135 | 131 |
136 } // namespace policy | 132 } // namespace policy |
137 | 133 |
138 #endif // CHROME_BROWSER_CHROMEOS_POLICY_SYSTEM_LOG_UPLOADER_H_ | 134 #endif // CHROME_BROWSER_CHROMEOS_POLICY_SYSTEM_LOG_UPLOADER_H_ |
OLD | NEW |