| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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); |
| 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 app->ConnectToService("mojo:dart_echo_server", &echo); | 60 app->ConnectToServiceDeprecated("mojo:dart_echo_server", &echo); |
| 61 } else { | 61 } else { |
| 62 app->ConnectToService("mojo:echo_server", &echo); | 62 app->ConnectToServiceDeprecated("mojo:echo_server", &echo); |
| 63 } | 63 } |
| 64 echoClients_.push_back(echo.Pass()); | 64 echoClients_.push_back(echo.Pass()); |
| 65 } | 65 } |
| 66 BeginEcho(0); | 66 BeginEcho(0); |
| 67 base::MessageLoop::current()->PostDelayedTask( | 67 base::MessageLoop::current()->PostDelayedTask( |
| 68 FROM_HERE, | 68 FROM_HERE, |
| 69 base::Bind(&EchoClientDelegate::EndWarmup, base::Unretained(this)), | 69 base::Bind(&EchoClientDelegate::EndWarmup, base::Unretained(this)), |
| 70 kWarmupTime); | 70 kWarmupTime); |
| 71 } | 71 } |
| 72 | 72 |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 } | 171 } |
| 172 | 172 |
| 173 } // namespace examples | 173 } // namespace examples |
| 174 } // namespace mojo | 174 } // namespace mojo |
| 175 | 175 |
| 176 MojoResult MojoMain(MojoHandle application_request) { | 176 MojoResult MojoMain(MojoHandle application_request) { |
| 177 mojo::ApplicationRunnerChromium runner( | 177 mojo::ApplicationRunnerChromium runner( |
| 178 new mojo::examples::EchoClientDelegate); | 178 new mojo::examples::EchoClientDelegate); |
| 179 return runner.Run(application_request); | 179 return runner.Run(application_request); |
| 180 } | 180 } |
| OLD | NEW |