| 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 blocking_pool_.get(), command_line_switches_)); | 148 blocking_pool_.get(), command_line_switches_)); |
| 149 } | 149 } |
| 150 application_manager_.reset(new ApplicationManager( | 150 application_manager_.reset(new ApplicationManager( |
| 151 std::move(runner_factory), blocking_pool_.get(), true)); | 151 std::move(runner_factory), blocking_pool_.get(), true)); |
| 152 | 152 |
| 153 shell::mojom::InterfaceProviderPtr tracing_remote_interfaces; | 153 shell::mojom::InterfaceProviderPtr tracing_remote_interfaces; |
| 154 shell::mojom::InterfaceProviderPtr tracing_local_interfaces; | 154 shell::mojom::InterfaceProviderPtr tracing_local_interfaces; |
| 155 new TracingInterfaceProvider(&tracer_, GetProxy(&tracing_local_interfaces)); | 155 new TracingInterfaceProvider(&tracer_, GetProxy(&tracing_local_interfaces)); |
| 156 | 156 |
| 157 scoped_ptr<ConnectParams> params(new ConnectParams); | 157 scoped_ptr<ConnectParams> params(new ConnectParams); |
| 158 params->set_source(Identity(GURL("mojo:shell"), std::string(), | 158 params->set_source(CreateShellIdentity()); |
| 159 GetPermissiveCapabilityFilter())); | |
| 160 params->set_target(Identity(GURL("mojo:tracing"), std::string(), | 159 params->set_target(Identity(GURL("mojo:tracing"), std::string(), |
| 160 mojom::Shell::kUserInherit, |
| 161 GetPermissiveCapabilityFilter())); | 161 GetPermissiveCapabilityFilter())); |
| 162 params->set_remote_interfaces(GetProxy(&tracing_remote_interfaces)); | 162 params->set_remote_interfaces(GetProxy(&tracing_remote_interfaces)); |
| 163 params->set_local_interfaces(std::move(tracing_local_interfaces)); | 163 params->set_local_interfaces(std::move(tracing_local_interfaces)); |
| 164 application_manager_->Connect(std::move(params)); | 164 application_manager_->Connect(std::move(params)); |
| 165 | 165 |
| 166 if (command_line.HasSwitch(tracing::kTraceStartup)) { | 166 if (command_line.HasSwitch(tracing::kTraceStartup)) { |
| 167 tracing::TraceCollectorPtr coordinator; | 167 tracing::TraceCollectorPtr coordinator; |
| 168 auto coordinator_request = GetProxy(&coordinator); | 168 auto coordinator_request = GetProxy(&coordinator); |
| 169 tracing_remote_interfaces->GetInterface( | 169 tracing_remote_interfaces->GetInterface( |
| 170 tracing::TraceCollector::Name_, coordinator_request.PassMessagePipe()); | 170 tracing::TraceCollector::Name_, coordinator_request.PassMessagePipe()); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 } | 220 } |
| 221 | 221 |
| 222 void Context::Run(const GURL& url) { | 222 void Context::Run(const GURL& url) { |
| 223 application_manager_->SetInstanceQuitCallback( | 223 application_manager_->SetInstanceQuitCallback( |
| 224 base::Bind(&OnInstanceQuit, url)); | 224 base::Bind(&OnInstanceQuit, url)); |
| 225 | 225 |
| 226 shell::mojom::InterfaceProviderPtr remote_interfaces; | 226 shell::mojom::InterfaceProviderPtr remote_interfaces; |
| 227 shell::mojom::InterfaceProviderPtr local_interfaces; | 227 shell::mojom::InterfaceProviderPtr local_interfaces; |
| 228 | 228 |
| 229 scoped_ptr<ConnectParams> params(new ConnectParams); | 229 scoped_ptr<ConnectParams> params(new ConnectParams); |
| 230 params->set_source(CreateShellIdentity()); |
| 230 params->set_target( | 231 params->set_target( |
| 231 Identity(url, std::string(), GetPermissiveCapabilityFilter())); | 232 Identity(url, std::string(), mojom::Shell::kUserRoot, |
| 233 GetPermissiveCapabilityFilter())); |
| 232 params->set_remote_interfaces(GetProxy(&remote_interfaces)); | 234 params->set_remote_interfaces(GetProxy(&remote_interfaces)); |
| 233 params->set_local_interfaces(std::move(local_interfaces)); | 235 params->set_local_interfaces(std::move(local_interfaces)); |
| 234 application_manager_->Connect(std::move(params)); | 236 application_manager_->Connect(std::move(params)); |
| 235 } | 237 } |
| 236 | 238 |
| 237 } // namespace shell | 239 } // namespace shell |
| 238 } // namespace mojo | 240 } // namespace mojo |
| OLD | NEW |