| OLD | NEW |
| 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 #include "chrome/browser/extensions/api/log_private/log_parser.h" | 5 #include "chrome/browser/extensions/api/log_private/log_parser.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 LogParser::LogParser() { | 21 LogParser::LogParser() { |
| 22 } | 22 } |
| 23 | 23 |
| 24 LogParser::~LogParser() { | 24 LogParser::~LogParser() { |
| 25 } | 25 } |
| 26 | 26 |
| 27 void LogParser::Parse( | 27 void LogParser::Parse( |
| 28 const string& input, | 28 const string& input, |
| 29 std::vector<linked_ptr<api::log_private::LogEntry> >* output, | 29 std::vector<linked_ptr<api::log_private::LogEntry> >* output, |
| 30 FilterHandler* filter_handler) const { | 30 FilterHandler* filter_handler) const { |
| 31 std::vector<string> entries; | |
| 32 // Assume there is no newline in the log entry | 31 // Assume there is no newline in the log entry |
| 33 base::SplitString(input, '\n', &entries); | 32 std::vector<string> entries = base::SplitString( |
| 33 input, "\n", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
| 34 | 34 |
| 35 for (size_t i = 0; i < entries.size(); i++) { | 35 for (size_t i = 0; i < entries.size(); i++) { |
| 36 ParseEntry(entries[i], output, filter_handler); | 36 ParseEntry(entries[i], output, filter_handler); |
| 37 } | 37 } |
| 38 } | 38 } |
| 39 | 39 |
| 40 } // namespace extensions | 40 } // namespace extensions |
| OLD | NEW |