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

Side by Side Diff: chrome/browser/extensions/api/log_private/syslog_parser.h

Issue 1825913002: [Extensions] Convert APIs to use movable types [7] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Steven's Created 4 years, 8 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_EXTENSIONS_API_LOG_PRIVATE_SYSLOG_PARSER_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_LOG_PRIVATE_SYSLOG_PARSER_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_LOG_PRIVATE_SYSLOG_PARSER_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_LOG_PRIVATE_SYSLOG_PARSER_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/memory/linked_ptr.h"
13 #include "chrome/browser/extensions/api/log_private/log_parser.h" 12 #include "chrome/browser/extensions/api/log_private/log_parser.h"
14 #include "chrome/common/extensions/api/log_private.h" 13 #include "chrome/common/extensions/api/log_private.h"
15 14
16 namespace extensions { 15 namespace extensions {
17 16
18 // A parser that parses syslog into LogEntry objects. 17 // A parser that parses syslog into LogEntry objects.
19 class SyslogParser : public LogParser { 18 class SyslogParser : public LogParser {
20 public: 19 public:
21 SyslogParser(); 20 SyslogParser();
22 ~SyslogParser() override; 21 ~SyslogParser() override;
23 22
24 protected: 23 protected:
25 // Parses one line log text into a LogEntry object. 24 // Parses one line log text into a LogEntry object.
26 Error ParseEntry(const std::string& input, 25 Error ParseEntry(const std::string& input,
27 std::vector<linked_ptr<api::log_private::LogEntry>>* output, 26 std::vector<api::log_private::LogEntry>* output,
28 FilterHandler* filter_handler) const override; 27 FilterHandler* filter_handler) const override;
29 28
30 private: 29 private:
31 // Parses time token and get time in milliseconds. 30 // Parses time token and get time in milliseconds.
32 Error ParseTime(const std::string& input, double* output) const; 31 Error ParseTime(const std::string& input, double* output) const;
33 // Parses process token and get process name and ID. 32 // Parses process token and get process name and ID.
34 Error ParseProcess(const std::string& input, 33 Error ParseProcess(const std::string& input,
35 api::log_private::LogEntry* entry) const; 34 api::log_private::LogEntry* entry) const;
36 // Parses level token and get log level. 35 // Parses level token and get log level.
37 void ParseLevel(const std::string& input, 36 void ParseLevel(const std::string& input,
38 api::log_private::LogEntry* entry) const; 37 api::log_private::LogEntry* entry) const;
39 38
40 DISALLOW_COPY_AND_ASSIGN(SyslogParser); 39 DISALLOW_COPY_AND_ASSIGN(SyslogParser);
41 }; 40 };
42 41
43 } // namespace extensions 42 } // namespace extensions
44 43
45 #endif // CHROME_BROWSER_EXTENSIONS_API_LOG_PRIVATE_SYSLOG_PARSER_H_ 44 #endif // CHROME_BROWSER_EXTENSIONS_API_LOG_PRIVATE_SYSLOG_PARSER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698