| 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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 app_catalog = std::move(init_params->app_catalog); | 157 app_catalog = std::move(init_params->app_catalog); |
| 158 shell_.reset(new Shell(std::move(runner_factory), blocking_pool_.get(), | 158 shell_.reset(new Shell(std::move(runner_factory), blocking_pool_.get(), |
| 159 std::move(app_catalog))); | 159 std::move(app_catalog))); |
| 160 | 160 |
| 161 shell::mojom::InterfaceProviderPtr tracing_remote_interfaces; | 161 shell::mojom::InterfaceProviderPtr tracing_remote_interfaces; |
| 162 shell::mojom::InterfaceProviderPtr tracing_local_interfaces; | 162 shell::mojom::InterfaceProviderPtr tracing_local_interfaces; |
| 163 new TracingInterfaceProvider(&tracer_, GetProxy(&tracing_local_interfaces)); | 163 new TracingInterfaceProvider(&tracer_, GetProxy(&tracing_local_interfaces)); |
| 164 | 164 |
| 165 scoped_ptr<ConnectParams> params(new ConnectParams); | 165 scoped_ptr<ConnectParams> params(new ConnectParams); |
| 166 params->set_source(CreateShellIdentity()); | 166 params->set_source(CreateShellIdentity()); |
| 167 params->set_target( | 167 params->set_target(Identity("mojo:tracing", mojom::kInheritUserID)); |
| 168 Identity("mojo:tracing", std::string(), mojom::kInheritUserID)); | |
| 169 params->set_remote_interfaces(GetProxy(&tracing_remote_interfaces)); | 168 params->set_remote_interfaces(GetProxy(&tracing_remote_interfaces)); |
| 170 params->set_local_interfaces(std::move(tracing_local_interfaces)); | 169 params->set_local_interfaces(std::move(tracing_local_interfaces)); |
| 171 shell_->Connect(std::move(params)); | 170 shell_->Connect(std::move(params)); |
| 172 | 171 |
| 173 if (command_line.HasSwitch(tracing::kTraceStartup)) { | 172 if (command_line.HasSwitch(tracing::kTraceStartup)) { |
| 174 tracing::TraceCollectorPtr coordinator; | 173 tracing::TraceCollectorPtr coordinator; |
| 175 auto coordinator_request = GetProxy(&coordinator); | 174 auto coordinator_request = GetProxy(&coordinator); |
| 176 tracing_remote_interfaces->GetInterface( | 175 tracing_remote_interfaces->GetInterface( |
| 177 tracing::TraceCollector::Name_, coordinator_request.PassMessagePipe()); | 176 tracing::TraceCollector::Name_, coordinator_request.PassMessagePipe()); |
| 178 tracer_.StartCollectingFromTracingService(std::move(coordinator)); | 177 tracer_.StartCollectingFromTracingService(std::move(coordinator)); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 } | 230 } |
| 232 | 231 |
| 233 void Context::Run(const std::string& name) { | 232 void Context::Run(const std::string& name) { |
| 234 shell_->SetInstanceQuitCallback(base::Bind(&OnInstanceQuit, name)); | 233 shell_->SetInstanceQuitCallback(base::Bind(&OnInstanceQuit, name)); |
| 235 | 234 |
| 236 shell::mojom::InterfaceProviderPtr remote_interfaces; | 235 shell::mojom::InterfaceProviderPtr remote_interfaces; |
| 237 shell::mojom::InterfaceProviderPtr local_interfaces; | 236 shell::mojom::InterfaceProviderPtr local_interfaces; |
| 238 | 237 |
| 239 scoped_ptr<ConnectParams> params(new ConnectParams); | 238 scoped_ptr<ConnectParams> params(new ConnectParams); |
| 240 params->set_source(CreateShellIdentity()); | 239 params->set_source(CreateShellIdentity()); |
| 241 params->set_target(Identity(name, std::string(), mojom::kRootUserID)); | 240 params->set_target(Identity(name, mojom::kRootUserID)); |
| 242 params->set_remote_interfaces(GetProxy(&remote_interfaces)); | 241 params->set_remote_interfaces(GetProxy(&remote_interfaces)); |
| 243 params->set_local_interfaces(std::move(local_interfaces)); | 242 params->set_local_interfaces(std::move(local_interfaces)); |
| 244 shell_->Connect(std::move(params)); | 243 shell_->Connect(std::move(params)); |
| 245 } | 244 } |
| 246 | 245 |
| 247 } // namespace shell | 246 } // namespace shell |
| 248 } // namespace mojo | 247 } // namespace mojo |
| OLD | NEW |