| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |