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

Side by Side Diff: examples/echo/echo_benchmark.cc

Issue 2014043002: Make TracingImpl take a Shell* and args, instead of an ApplicationImpl*. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 7 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/trace_me/trace_me_app.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 <stdio.h> 5 #include <stdio.h>
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "base/trace_event/trace_event.h" 9 #include "base/trace_event/trace_event.h"
10 #include "examples/echo/echo.mojom.h" 10 #include "examples/echo/echo.mojom.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 public: 43 public:
44 EchoClientDelegate() 44 EchoClientDelegate()
45 : warmup_(true), 45 : warmup_(true),
46 num_clients_(1), 46 num_clients_(1),
47 num_active_clients_(1), 47 num_active_clients_(1),
48 use_dart_server_(false), 48 use_dart_server_(false),
49 ending_(false), 49 ending_(false),
50 benchmark_duration_(base::TimeDelta::FromSeconds(10)) {} 50 benchmark_duration_(base::TimeDelta::FromSeconds(10)) {}
51 51
52 void Initialize(ApplicationImpl* app) override { 52 void Initialize(ApplicationImpl* app) override {
53 tracing_.Initialize(app); 53 tracing_.Initialize(app->shell(), &app->args());
54 54
55 ParseArguments(app); 55 ParseArguments(app);
56 56
57 for (int i = 0; i < num_clients_; i++) { 57 for (int i = 0; i < num_clients_; i++) {
58 EchoPtr echo; 58 EchoPtr echo;
59 if (use_dart_server_) { 59 if (use_dart_server_) {
60 ConnectToService(app->shell(), "mojo:dart_echo_server", 60 ConnectToService(app->shell(), "mojo:dart_echo_server",
61 GetProxy(&echo)); 61 GetProxy(&echo));
62 } else { 62 } else {
63 ConnectToService(app->shell(), "mojo:echo_server", GetProxy(&echo)); 63 ConnectToService(app->shell(), "mojo:echo_server", GetProxy(&echo));
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 } 172 }
173 173
174 } // namespace examples 174 } // namespace examples
175 } // namespace mojo 175 } // namespace mojo
176 176
177 MojoResult MojoMain(MojoHandle application_request) { 177 MojoResult MojoMain(MojoHandle application_request) {
178 mojo::ApplicationRunnerChromium runner( 178 mojo::ApplicationRunnerChromium runner(
179 new mojo::examples::EchoClientDelegate); 179 new mojo::examples::EchoClientDelegate);
180 return runner.Run(application_request); 180 return runner.Run(application_request);
181 } 181 }
OLDNEW
« no previous file with comments | « no previous file | examples/trace_me/trace_me_app.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698