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

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

Issue 2034383003: Removed exposed_services from mojom definitions. (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 | « no previous file | examples/content_handler_demo/content_handler_demo.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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 } 81 }
82 std::vector<std::string> unique_categories(category_set.begin(), 82 std::vector<std::string> unique_categories(category_set.begin(),
83 category_set.end()); 83 category_set.end());
84 return base::JoinString(unique_categories, ","); 84 return base::JoinString(unique_categories, ",");
85 } 85 }
86 86
87 void StartTracedApplication() { 87 void StartTracedApplication() {
88 // Record the time origin for measurements just before connecting to the app 88 // Record the time origin for measurements just before connecting to the app
89 // being benchmarked. 89 // being benchmarked.
90 time_origin_ = base::TimeTicks::FromInternalValue(MojoGetTimeTicksNow()); 90 time_origin_ = base::TimeTicks::FromInternalValue(MojoGetTimeTicksNow());
91 shell()->ConnectToApplication(args_.app, GetProxy(&traced_app_connection_), 91 shell()->ConnectToApplication(args_.app, GetProxy(&traced_app_connection_));
92 nullptr);
93 92
94 // Post task to stop tracing when the time is up. 93 // Post task to stop tracing when the time is up.
95 base::MessageLoop::current()->PostDelayedTask( 94 base::MessageLoop::current()->PostDelayedTask(
96 FROM_HERE, 95 FROM_HERE,
97 base::Bind(&BenchmarkApp::StopTracing, base::Unretained(this)), 96 base::Bind(&BenchmarkApp::StopTracing, base::Unretained(this)),
98 args_.duration); 97 args_.duration);
99 } 98 }
100 99
101 void StopTracing() { 100 void StopTracing() {
102 // Request the trace collector to send back the data. When the data is ready 101 // Request the trace collector to send back the data. When the data is ready
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 } // namespace 159 } // namespace
161 } // namespace benchmark 160 } // namespace benchmark
162 161
163 MojoResult MojoMain(MojoHandle application_request) { 162 MojoResult MojoMain(MojoHandle application_request) {
164 mojo::ScopedChromiumInit init; 163 mojo::ScopedChromiumInit init;
165 benchmark::BenchmarkApp benchmark_app; 164 benchmark::BenchmarkApp benchmark_app;
166 auto ret = mojo::RunApplication(application_request, &benchmark_app); 165 auto ret = mojo::RunApplication(application_request, &benchmark_app);
167 fflush(nullptr); 166 fflush(nullptr);
168 return ret; 167 return ret;
169 } 168 }
OLDNEW
« no previous file with comments | « no previous file | examples/content_handler_demo/content_handler_demo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698