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

Side by Side Diff: apps/benchmark/benchmark_app.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 | « DEPS ('k') | apps/benchmark/run_args.cc » ('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 <memory> 5 #include <memory>
6 #include <set> 6 #include <set>
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "apps/benchmark/event.h" 10 #include "apps/benchmark/event.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 FROM_HERE, base::Bind(&BenchmarkApp::StartTracedApplication, 68 FROM_HERE, base::Bind(&BenchmarkApp::StartTracedApplication,
69 base::Unretained(this), app), 69 base::Unretained(this), app),
70 base::TimeDelta::FromSeconds(1)); 70 base::TimeDelta::FromSeconds(1));
71 } 71 }
72 72
73 // Computes the string of trace categories we want to collect: a union of all 73 // Computes the string of trace categories we want to collect: a union of all
74 // categories targeted in measurements. 74 // categories targeted in measurements.
75 std::string ComputeCategoriesStr() { 75 std::string ComputeCategoriesStr() {
76 std::set<std::string> category_set; 76 std::set<std::string> category_set;
77 for (const Measurement& measurement : args_.measurements) { 77 for (const Measurement& measurement : args_.measurements) {
78 std::vector<std::string> categories; 78 std::vector<std::string> categories =
79 base::SplitString(measurement.target_event.categories, ',', &categories); 79 base::SplitString(measurement.target_event.categories, ",",
80 base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
80 category_set.insert(categories.begin(), categories.end()); 81 category_set.insert(categories.begin(), categories.end());
81 } 82 }
82 std::vector<std::string> unique_categories(category_set.begin(), 83 std::vector<std::string> unique_categories(category_set.begin(),
83 category_set.end()); 84 category_set.end());
84 return base::JoinString(unique_categories, ","); 85 return base::JoinString(unique_categories, ",");
85 } 86 }
86 87
87 void StartTracedApplication(mojo::ApplicationImpl* app) { 88 void StartTracedApplication(mojo::ApplicationImpl* app) {
88 // Record the time origin for measurements just before connecting to the app 89 // Record the time origin for measurements just before connecting to the app
89 // being benchmarked. 90 // being benchmarked.
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 }; 160 };
160 } // namespace 161 } // namespace
161 } // namespace benchmark 162 } // namespace benchmark
162 163
163 MojoResult MojoMain(MojoHandle application_request) { 164 MojoResult MojoMain(MojoHandle application_request) {
164 mojo::ApplicationRunnerChromium runner(new benchmark::BenchmarkApp); 165 mojo::ApplicationRunnerChromium runner(new benchmark::BenchmarkApp);
165 auto ret = runner.Run(application_request); 166 auto ret = runner.Run(application_request);
166 fflush(nullptr); 167 fflush(nullptr);
167 return ret; 168 return ret;
168 } 169 }
OLDNEW
« no previous file with comments | « DEPS ('k') | apps/benchmark/run_args.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698