| 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> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/bind.h" | 13 #include "base/bind.h" |
| 14 #include "base/command_line.h" | 14 #include "base/command_line.h" |
| 15 #include "base/files/file_path.h" | 15 #include "base/files/file_path.h" |
| 16 #include "base/i18n/icu_util.h" | |
| 17 #include "base/lazy_instance.h" | 16 #include "base/lazy_instance.h" |
| 18 #include "base/macros.h" | 17 #include "base/macros.h" |
| 19 #include "base/memory/scoped_ptr.h" | 18 #include "base/memory/scoped_ptr.h" |
| 20 #include "base/path_service.h" | 19 #include "base/path_service.h" |
| 21 #include "base/process/process_info.h" | 20 #include "base/process/process_info.h" |
| 22 #include "base/run_loop.h" | 21 #include "base/run_loop.h" |
| 23 #include "base/strings/string_number_conversions.h" | 22 #include "base/strings/string_number_conversions.h" |
| 24 #include "base/strings/string_split.h" | 23 #include "base/strings/string_split.h" |
| 25 #include "base/strings/string_util.h" | 24 #include "base/strings/string_util.h" |
| 26 #include "base/trace_event/trace_event.h" | 25 #include "base/trace_event/trace_event.h" |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 *base::CommandLine::ForCurrentProcess(); | 191 *base::CommandLine::ForCurrentProcess(); |
| 193 | 192 |
| 194 bool trace_startup = command_line.HasSwitch(switches::kTraceStartup); | 193 bool trace_startup = command_line.HasSwitch(switches::kTraceStartup); |
| 195 if (trace_startup) { | 194 if (trace_startup) { |
| 196 tracer_.Start( | 195 tracer_.Start( |
| 197 command_line.GetSwitchValueASCII(switches::kTraceStartup), | 196 command_line.GetSwitchValueASCII(switches::kTraceStartup), |
| 198 command_line.GetSwitchValueASCII(switches::kTraceStartupDuration), | 197 command_line.GetSwitchValueASCII(switches::kTraceStartupDuration), |
| 199 "mojo_runner.trace"); | 198 "mojo_runner.trace"); |
| 200 } | 199 } |
| 201 | 200 |
| 202 // ICU data is a thing every part of the system needs. This here warms | |
| 203 // up the copy of ICU in the mojo runner. | |
| 204 CHECK(base::i18n::InitializeICU()); | |
| 205 | |
| 206 EnsureEmbedderIsInitialized(); | 201 EnsureEmbedderIsInitialized(); |
| 207 task_runners_.reset( | 202 task_runners_.reset( |
| 208 new TaskRunners(base::MessageLoop::current()->task_runner())); | 203 new TaskRunners(base::MessageLoop::current()->task_runner())); |
| 209 | 204 |
| 210 // TODO(vtl): This should be MASTER, not NONE. | 205 // TODO(vtl): This should be MASTER, not NONE. |
| 211 embedder::InitIPCSupport(embedder::ProcessType::NONE, this, | 206 embedder::InitIPCSupport(embedder::ProcessType::NONE, this, |
| 212 task_runners_->io_runner(), | 207 task_runners_->io_runner(), |
| 213 embedder::ScopedPlatformHandle()); | 208 embedder::ScopedPlatformHandle()); |
| 214 | 209 |
| 215 package_manager_ = new PackageManagerImpl( | 210 package_manager_ = new PackageManagerImpl( |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 base::MessageLoop::current()->QuitWhenIdle(); | 333 base::MessageLoop::current()->QuitWhenIdle(); |
| 339 } else { | 334 } else { |
| 340 app_complete_callback_.Run(); | 335 app_complete_callback_.Run(); |
| 341 } | 336 } |
| 342 } | 337 } |
| 343 } | 338 } |
| 344 } | 339 } |
| 345 | 340 |
| 346 } // namespace shell | 341 } // namespace shell |
| 347 } // namespace mojo | 342 } // namespace mojo |
| OLD | NEW |