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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_EXTENSIONS_API_LOG_PRIVATE_LOG_PARSER_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_LOG_PRIVATE_LOG_PARSER_H_
11 #include "base/memory/linked_ptr.h"
12 #include "chrome/browser/extensions/api/log_private/filter_handler.h"
13 #include "chrome/common/extensions/api/log_private.h"
15 namespace extensions {
17 // This is a abstract class of parsers for different logs.
18 // All the specific parsers inherit from this class.
29 // Parses log text into multiple LogEntry objects.
31 const std::string& input,
32 std::vector<linked_ptr<api::log_private::LogEntry> >* output,
33 FilterHandler* filter_handler) const;
37 // Parses a single line of log text into one LogEntry object.
38 virtual Error ParseEntry(
39 const std::string& input,
40 std::vector<linked_ptr<api::log_private::LogEntry> >* output,
41 FilterHandler* filter_handler) const = 0;
44 DISALLOW_COPY_AND_ASSIGN(LogParser);
47 } // namespace extensions
49 #endif // CHROME_BROWSER_EXTENSIONS_API_LOG_PRIVATE_LOG_PARSER_H_