OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "mojo/shell/standalone/context.h" | 5 #include "mojo/shell/standalone/context.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <utility> | 10 #include <utility> |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "base/strings/string_number_conversions.h" | 22 #include "base/strings/string_number_conversions.h" |
23 #include "base/strings/string_split.h" | 23 #include "base/strings/string_split.h" |
24 #include "base/strings/string_util.h" | 24 #include "base/strings/string_util.h" |
25 #include "base/strings/utf_string_conversions.h" | 25 #include "base/strings/utf_string_conversions.h" |
26 #include "base/threading/sequenced_worker_pool.h" | 26 #include "base/threading/sequenced_worker_pool.h" |
27 #include "base/trace_event/trace_event.h" | 27 #include "base/trace_event/trace_event.h" |
28 #include "build/build_config.h" | 28 #include "build/build_config.h" |
29 #include "components/tracing/tracing_switches.h" | 29 #include "components/tracing/tracing_switches.h" |
30 #include "mojo/edk/embedder/embedder.h" | 30 #include "mojo/edk/embedder/embedder.h" |
31 #include "mojo/public/cpp/bindings/strong_binding.h" | 31 #include "mojo/public/cpp/bindings/strong_binding.h" |
32 #include "mojo/services/catalog/owner.h" | 32 #include "mojo/services/catalog/factory.h" |
33 #include "mojo/services/catalog/store.h" | 33 #include "mojo/services/catalog/store.h" |
34 #include "mojo/services/tracing/public/cpp/switches.h" | 34 #include "mojo/services/tracing/public/cpp/switches.h" |
35 #include "mojo/services/tracing/public/cpp/trace_provider_impl.h" | 35 #include "mojo/services/tracing/public/cpp/trace_provider_impl.h" |
36 #include "mojo/services/tracing/public/cpp/tracing_impl.h" | 36 #include "mojo/services/tracing/public/cpp/tracing_impl.h" |
37 #include "mojo/services/tracing/public/interfaces/tracing.mojom.h" | 37 #include "mojo/services/tracing/public/interfaces/tracing.mojom.h" |
38 #include "mojo/shell/connect_params.h" | 38 #include "mojo/shell/connect_params.h" |
39 #include "mojo/shell/public/cpp/names.h" | 39 #include "mojo/shell/public/cpp/names.h" |
40 #include "mojo/shell/runner/host/in_process_native_runner.h" | 40 #include "mojo/shell/runner/host/in_process_native_runner.h" |
41 #include "mojo/shell/runner/host/out_of_process_native_runner.h" | 41 #include "mojo/shell/runner/host/out_of_process_native_runner.h" |
42 #include "mojo/shell/standalone/tracer.h" | 42 #include "mojo/shell/standalone/tracer.h" |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 new InProcessNativeRunnerFactory(blocking_pool_.get())); | 148 new InProcessNativeRunnerFactory(blocking_pool_.get())); |
149 } else { | 149 } else { |
150 NativeRunnerDelegate* native_runner_delegate = init_params ? | 150 NativeRunnerDelegate* native_runner_delegate = init_params ? |
151 init_params->native_runner_delegate : nullptr; | 151 init_params->native_runner_delegate : nullptr; |
152 runner_factory.reset(new OutOfProcessNativeRunnerFactory( | 152 runner_factory.reset(new OutOfProcessNativeRunnerFactory( |
153 blocking_pool_.get(), native_runner_delegate)); | 153 blocking_pool_.get(), native_runner_delegate)); |
154 } | 154 } |
155 scoped_ptr<catalog::Store> store; | 155 scoped_ptr<catalog::Store> store; |
156 if (init_params) | 156 if (init_params) |
157 store = std::move(init_params->catalog_store); | 157 store = std::move(init_params->catalog_store); |
158 catalog_.reset(new catalog::Owner(blocking_pool_.get(), std::move(store))); | 158 catalog_.reset(new catalog::Factory(blocking_pool_.get(), std::move(store))); |
159 shell_.reset(new Shell(std::move(runner_factory), | 159 shell_.reset(new Shell(std::move(runner_factory), |
160 catalog_->TakeShellClient())); | 160 catalog_->TakeShellClient())); |
161 | 161 |
162 shell::mojom::InterfaceProviderPtr tracing_remote_interfaces; | 162 shell::mojom::InterfaceProviderPtr tracing_remote_interfaces; |
163 shell::mojom::InterfaceProviderPtr tracing_local_interfaces; | 163 shell::mojom::InterfaceProviderPtr tracing_local_interfaces; |
164 new TracingInterfaceProvider(&tracer_, GetProxy(&tracing_local_interfaces)); | 164 new TracingInterfaceProvider(&tracer_, GetProxy(&tracing_local_interfaces)); |
165 | 165 |
166 scoped_ptr<ConnectParams> params(new ConnectParams); | 166 scoped_ptr<ConnectParams> params(new ConnectParams); |
167 params->set_source(CreateShellIdentity()); | 167 params->set_source(CreateShellIdentity()); |
168 params->set_target(Identity("mojo:tracing", mojom::kRootUserID)); | 168 params->set_target(Identity("mojo:tracing", mojom::kRootUserID)); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 scoped_ptr<ConnectParams> params(new ConnectParams); | 239 scoped_ptr<ConnectParams> params(new ConnectParams); |
240 params->set_source(CreateShellIdentity()); | 240 params->set_source(CreateShellIdentity()); |
241 params->set_target(Identity(name, mojom::kRootUserID)); | 241 params->set_target(Identity(name, mojom::kRootUserID)); |
242 params->set_remote_interfaces(GetProxy(&remote_interfaces)); | 242 params->set_remote_interfaces(GetProxy(&remote_interfaces)); |
243 params->set_local_interfaces(std::move(local_interfaces)); | 243 params->set_local_interfaces(std::move(local_interfaces)); |
244 shell_->Connect(std::move(params)); | 244 shell_->Connect(std::move(params)); |
245 } | 245 } |
246 | 246 |
247 } // namespace shell | 247 } // namespace shell |
248 } // namespace mojo | 248 } // namespace mojo |
OLD | NEW |