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

Side by Side Diff: chrome/browser/chromeos/policy/system_log_uploader.h

Issue 1610123003: Added anonymizer to SystemLogUploader. (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 (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"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "base/memory/ref_counted_memory.h" 12 #include "base/memory/ref_counted_memory.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/memory/weak_ptr.h" 14 #include "base/memory/weak_ptr.h"
15 #include "base/threading/thread_checker.h" 15 #include "base/threading/thread_checker.h"
16 #include "base/time/time.h" 16 #include "base/time/time.h"
17 #include "chrome/browser/chromeos/policy/upload_job.h" 17 #include "chrome/browser/chromeos/policy/upload_job.h"
18 #include "chrome/browser/chromeos/settings/cros_settings.h" 18 #include "chrome/browser/chromeos/settings/cros_settings.h"
19 #include "components/feedback/anonymizer_tool.h"
Thiemo Nagel 2016/01/21 19:11:49 Please use forward declaration of AnonymizerTool i
Polina Bondarenko 2016/01/22 11:48:53 Done.
19 20
20 namespace base { 21 namespace base {
21 class SequencedTaskRunner; 22 class SequencedTaskRunner;
22 } 23 }
23 24
24 namespace policy { 25 namespace policy {
25 26
26 // Class responsible for periodically uploading system logs, it handles the 27 // Class responsible for periodically uploading system logs, it handles the
27 // server responses by UploadJob:Delegate callbacks. 28 // server responses by UploadJob:Delegate callbacks.
28 class SystemLogUploader : public UploadJob::Delegate { 29 class SystemLogUploader : public UploadJob::Delegate {
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 // Returns the time of the last upload attempt, or Time(0) if no upload has 72 // Returns the time of the last upload attempt, or Time(0) if no upload has
72 // ever happened. 73 // ever happened.
73 base::Time last_upload_attempt() const { return last_upload_attempt_; } 74 base::Time last_upload_attempt() const { return last_upload_attempt_; }
74 75
75 // UploadJob::Delegate: 76 // UploadJob::Delegate:
76 // Callbacks handle success and failure results of upload, destroy the 77 // Callbacks handle success and failure results of upload, destroy the
77 // upload job. 78 // upload job.
78 void OnSuccess() override; 79 void OnSuccess() override;
79 void OnFailure(UploadJob::ErrorCode error_code) override; 80 void OnFailure(UploadJob::ErrorCode error_code) override;
80 81
81 // Remove lines from |data| that contain common PII (IP addresses, SSIDs, URLs 82 // Remove lines from |data| that contain common PII (IP addresses, BSSIDs,
82 // e-mail addresses). 83 // SSIDs, URLs, e-mail addresses).
83 static std::string RemoveSensitiveData(const std::string& data); 84 static std::string RemoveSensitiveData(feedback::AnonymizerTool& anonymizer,
85 const std::string& data);
84 86
85 private: 87 private:
86 // Updates the system log upload enabled field from settings. 88 // Updates the system log upload enabled field from settings.
87 void RefreshUploadSettings(); 89 void RefreshUploadSettings();
88 90
89 // Starts the system log loading process. 91 // Starts the system log loading process.
90 void StartLogUpload(); 92 void StartLogUpload();
91 93
92 // The callback is invoked by the Delegate if system logs have been loaded 94 // The callback is invoked by the Delegate if system logs have been loaded
93 // from disk, uploads system logs. 95 // from disk, uploads system logs.
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 // Note: This should remain the last member so it'll be destroyed and 131 // Note: This should remain the last member so it'll be destroyed and
130 // invalidate the weak pointers before any other members are destroyed. 132 // invalidate the weak pointers before any other members are destroyed.
131 base::WeakPtrFactory<SystemLogUploader> weak_factory_; 133 base::WeakPtrFactory<SystemLogUploader> weak_factory_;
132 134
133 DISALLOW_COPY_AND_ASSIGN(SystemLogUploader); 135 DISALLOW_COPY_AND_ASSIGN(SystemLogUploader);
134 }; 136 };
135 137
136 } // namespace policy 138 } // namespace policy
137 139
138 #endif // CHROME_BROWSER_CHROMEOS_POLICY_SYSTEM_LOG_UPLOADER_H_ 140 #endif // CHROME_BROWSER_CHROMEOS_POLICY_SYSTEM_LOG_UPLOADER_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/policy/DEPS ('k') | chrome/browser/chromeos/policy/system_log_uploader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698