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

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

Issue 1641513004: Update //base to chromium 9659b08ea5a34f889dc4166217f438095ddc10d2 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 10 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 | « no previous file | apps/benchmark/event_unittest.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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 // categories targeted in measurements. 71 // categories targeted in measurements.
72 std::string ComputeCategoriesStr() { 72 std::string ComputeCategoriesStr() {
73 std::set<std::string> category_set; 73 std::set<std::string> category_set;
74 for (const Measurement& measurement : args_.measurements) { 74 for (const Measurement& measurement : args_.measurements) {
75 std::vector<std::string> categories; 75 std::vector<std::string> categories;
76 base::SplitString(measurement.target_event.categories, ',', &categories); 76 base::SplitString(measurement.target_event.categories, ',', &categories);
77 category_set.insert(categories.begin(), categories.end()); 77 category_set.insert(categories.begin(), categories.end());
78 } 78 }
79 std::vector<std::string> unique_categories(category_set.begin(), 79 std::vector<std::string> unique_categories(category_set.begin(),
80 category_set.end()); 80 category_set.end());
81 return JoinString(unique_categories, ','); 81 return base::JoinString(unique_categories, ",");
82 } 82 }
83 83
84 void StartTracedApplication(mojo::ApplicationImpl* app) { 84 void StartTracedApplication(mojo::ApplicationImpl* app) {
85 // Record the time origin for measurements just before connecting to the app 85 // Record the time origin for measurements just before connecting to the app
86 // being benchmarked. 86 // being benchmarked.
87 time_origin_ = base::TimeTicks::FromInternalValue(MojoGetTimeTicksNow()); 87 time_origin_ = base::TimeTicks::FromInternalValue(MojoGetTimeTicksNow());
88 traced_app_connection_ = app->ConnectToApplication(args_.app); 88 traced_app_connection_ = app->ConnectToApplication(args_.app);
89 89
90 // Post task to stop tracing when the time is up. 90 // Post task to stop tracing when the time is up.
91 base::MessageLoop::current()->PostDelayedTask( 91 base::MessageLoop::current()->PostDelayedTask(
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 }; 155 };
156 } // namespace 156 } // namespace
157 } // namespace benchmark 157 } // namespace benchmark
158 158
159 MojoResult MojoMain(MojoHandle application_request) { 159 MojoResult MojoMain(MojoHandle application_request) {
160 mojo::ApplicationRunnerChromium runner(new benchmark::BenchmarkApp); 160 mojo::ApplicationRunnerChromium runner(new benchmark::BenchmarkApp);
161 auto ret = runner.Run(application_request); 161 auto ret = runner.Run(application_request);
162 fflush(nullptr); 162 fflush(nullptr);
163 return ret; 163 return ret;
164 } 164 }
OLDNEW
« no previous file with comments | « no previous file | apps/benchmark/event_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698