| 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 *base::CommandLine::ForCurrentProcess(); | 122 *base::CommandLine::ForCurrentProcess(); |
| 123 | 123 |
| 124 bool trace_startup = command_line.HasSwitch(::switches::kTraceStartup); | 124 bool trace_startup = command_line.HasSwitch(::switches::kTraceStartup); |
| 125 if (trace_startup) { | 125 if (trace_startup) { |
| 126 tracer_.Start( | 126 tracer_.Start( |
| 127 command_line.GetSwitchValueASCII(::switches::kTraceStartup), | 127 command_line.GetSwitchValueASCII(::switches::kTraceStartup), |
| 128 command_line.GetSwitchValueASCII(::switches::kTraceStartupDuration), | 128 command_line.GetSwitchValueASCII(::switches::kTraceStartupDuration), |
| 129 "mojo_runner.trace"); | 129 "mojo_runner.trace"); |
| 130 } | 130 } |
| 131 | 131 |
| 132 EnsureEmbedderIsInitialized(); | 132 if (!init_params || init_params->init_edk) |
| 133 EnsureEmbedderIsInitialized(); |
| 133 | 134 |
| 134 shell_runner_ = base::MessageLoop::current()->task_runner(); | 135 shell_runner_ = base::MessageLoop::current()->task_runner(); |
| 135 blocking_pool_ = | 136 blocking_pool_ = |
| 136 new base::SequencedWorkerPool(kMaxBlockingPoolThreads, "blocking_pool"); | 137 new base::SequencedWorkerPool(kMaxBlockingPoolThreads, "blocking_pool"); |
| 137 | 138 |
| 138 edk::InitIPCSupport(this, io_thread_->task_runner().get()); | 139 if (!init_params || init_params->init_edk) |
| 140 edk::InitIPCSupport(this, io_thread_->task_runner().get()); |
| 139 | 141 |
| 140 scoped_ptr<NativeRunnerFactory> runner_factory; | 142 scoped_ptr<NativeRunnerFactory> runner_factory; |
| 141 if (command_line.HasSwitch(switches::kSingleProcess)) { | 143 if (command_line.HasSwitch(switches::kSingleProcess)) { |
| 142 #if defined(COMPONENT_BUILD) | 144 #if defined(COMPONENT_BUILD) |
| 143 LOG(ERROR) << "Running Mojo in single process component build, which isn't " | 145 LOG(ERROR) << "Running Mojo in single process component build, which isn't " |
| 144 << "supported because statics in apps interact. Use static build" | 146 << "supported because statics in apps interact. Use static build" |
| 145 << " or don't pass --single-process."; | 147 << " or don't pass --single-process."; |
| 146 #endif | 148 #endif |
| 147 runner_factory.reset( | 149 runner_factory.reset( |
| 148 new InProcessNativeRunnerFactory(blocking_pool_.get())); | 150 new InProcessNativeRunnerFactory(blocking_pool_.get())); |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 scoped_ptr<ConnectParams> params(new ConnectParams); | 241 scoped_ptr<ConnectParams> params(new ConnectParams); |
| 240 params->set_source(CreateShellIdentity()); | 242 params->set_source(CreateShellIdentity()); |
| 241 params->set_target(Identity(name, mojom::kRootUserID)); | 243 params->set_target(Identity(name, mojom::kRootUserID)); |
| 242 params->set_remote_interfaces(GetProxy(&remote_interfaces)); | 244 params->set_remote_interfaces(GetProxy(&remote_interfaces)); |
| 243 params->set_local_interfaces(std::move(local_interfaces)); | 245 params->set_local_interfaces(std::move(local_interfaces)); |
| 244 shell_->Connect(std::move(params)); | 246 shell_->Connect(std::move(params)); |
| 245 } | 247 } |
| 246 | 248 |
| 247 } // namespace shell | 249 } // namespace shell |
| 248 } // namespace mojo | 250 } // namespace mojo |
| OLD | NEW |