Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / chrome / browser / extensions / api / log_private / log_parser.cc
blobef6c59e0021445d962c2c27df2cf8103813bdd4a
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 #include "chrome/browser/extensions/api/log_private/log_parser.h"
7 #include <string>
8 #include <vector>
10 #include "base/logging.h"
11 #include "base/memory/linked_ptr.h"
12 #include "base/strings/string_split.h"
13 #include "chrome/browser/extensions/api/log_private/log_private_api.h"
14 #include "chrome/common/extensions/api/log_private.h"
16 using std::string;
17 using std::vector;
19 namespace extensions {
21 LogParser::LogParser() {
24 LogParser::~LogParser() {
27 void LogParser::Parse(
28 const string& input,
29 std::vector<linked_ptr<api::log_private::LogEntry> >* output,
30 FilterHandler* filter_handler) const {
31 // Assume there is no newline in the log entry
32 std::vector<string> entries = base::SplitString(
33 input, "\n", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
35 for (size_t i = 0; i < entries.size(); i++) {
36 ParseEntry(entries[i], output, filter_handler);
40 } // namespace extensions