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

Side by Side Diff: apps/benchmark/run_args.cc

Issue 2022983003: Roll base to 5e00da80f6adb7082d1c0e88d3274cf87cc43bc5 and tonic to f7acabb8fa6c91124486a41194eac3cd… (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « apps/benchmark/benchmark_app.cc ('k') | build/config/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "apps/benchmark/run_args.h" 5 #include "apps/benchmark/run_args.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 12 matching lines...) Expand all
23 << ", expected " << required_args << " while " << provided_args 23 << ", expected " << required_args << " while " << provided_args
24 << " were provided"; 24 << " were provided";
25 return false; 25 return false;
26 } 26 }
27 return true; 27 return true;
28 } 28 }
29 29
30 bool GetMeasurement(const std::string& measurement_spec, Measurement* result) { 30 bool GetMeasurement(const std::string& measurement_spec, Measurement* result) {
31 // Measurements are described in the format: 31 // Measurements are described in the format:
32 // <measurement type>/<event category>/<event name>. 32 // <measurement type>/<event category>/<event name>.
33 std::vector<std::string> parts; 33 std::vector<std::string> parts = base::SplitString(
34 base::SplitString(measurement_spec, '/', &parts); 34 measurement_spec, "/", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
35 if (parts.size() < 1) { 35 if (parts.size() < 1) {
36 LOG(ERROR) << "Could not parse the measurement description: " 36 LOG(ERROR) << "Could not parse the measurement description: "
37 << measurement_spec; 37 << measurement_spec;
38 return false; 38 return false;
39 } 39 }
40 40
41 if (parts[0] == "time_until") { 41 if (parts[0] == "time_until") {
42 if (!CheckMeasurementFormat(parts[0], 3, parts.size())) 42 if (!CheckMeasurementFormat(parts[0], 3, parts.size()))
43 return false; 43 return false;
44 *result = 44 *result =
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 if (!GetMeasurement(unquoted_measurement_spec, &measurement)) { 121 if (!GetMeasurement(unquoted_measurement_spec, &measurement)) {
122 return false; 122 return false;
123 } 123 }
124 result->measurements.push_back(measurement); 124 result->measurements.push_back(measurement);
125 } 125 }
126 126
127 return true; 127 return true;
128 } 128 }
129 129
130 } // namespace benchmark 130 } // namespace benchmark
OLDNEW
« no previous file with comments | « apps/benchmark/benchmark_app.cc ('k') | build/config/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698