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

Side by Side Diff: chrome/browser/chromeos/system_logs/single_log_source.h

Issue 2844163005: Add SingleLogSource to system_logs sources (Closed)
Patch Set: Remove TODO, already done Created 3 years, 7 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
(Empty)
1 // Copyright 2017 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 CHROME_BROWSER_CHROMEOS_SYSTEM_LOGS_SINGLE_LOG_SOURCE_H_
6 #define CHROME_BROWSER_CHROMEOS_SYSTEM_LOGS_SINGLE_LOG_SOURCE_H_
7
8 #include <stddef.h>
9
10 #include "base/files/file.h"
11 #include "chrome/browser/feedback/system_logs/system_logs_fetcher_base.h"
12 #include "components/feedback/anonymizer_tool.h"
13
14 namespace system_logs {
15
16 // Gathers log data from a single source, possibly incrementally.
17 class SingleLogSource : public SystemLogsSource {
18 public:
19 SingleLogSource();
20 explicit SingleLogSource(const std::string& source_name);
afakhry 2017/05/06 01:12:13 How would users of this class know what |source_na
Simon Que 2017/05/06 14:19:43 Done.
21 ~SingleLogSource() override;
22
23 // Disable copy/move operations.
24 SingleLogSource(const SingleLogSource&) = delete;
25 SingleLogSource& operator=(const SingleLogSource&) = delete;
afakhry 2017/05/06 01:12:13 Remove these line entirely and replace by DISALL
Simon Que 2017/05/06 14:19:43 Done.
26
27 // Starts reading log source contents. Does not block. Calls |callback| when
28 // the read is complete.
afakhry 2017/05/06 01:12:13 Remove this comment and replace with: // system_l
Simon Que 2017/05/06 14:19:43 Done.
29 void Fetch(const SysLogsSourceCallback& callback) override;
30
31 protected:
32 // For unit testing.
33 base::File* mutable_file() { return &file_; }
34
35 private:
36 // Reads all available content from |file_| that has not already been read.
37 void ReadFile(SystemLogsResponse* result);
38
39 // Keeps track of how much data has been read from |file_|.
40 size_t num_bytes_read_;
41
42 // Handle for reading the log file that is source of logging data.
43 base::File file_;
44
45 // For removing PII from log results.
46 feedback::AnonymizerTool anonymizer_;
afakhry 2017/05/06 01:12:13 I want to understand how this class will be used i
Simon Que 2017/05/06 14:19:43 I have no plans to merge this with the existing Sc
47 };
48
49 } // namespace system_logs
50
51 #endif // CHROME_BROWSER_CHROMEOS_SYSTEM_LOGS_SINGLE_LOG_SOURCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698