| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/runner/host/child_process.h" | 5 #include "mojo/runner/host/child_process.h" |
| 6 | 6 |
| 7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 | 354 |
| 355 #if defined(OS_LINUX) && !defined(OS_ANDROID) | 355 #if defined(OS_LINUX) && !defined(OS_ANDROID) |
| 356 scoped_ptr<mojo::runner::LinuxSandbox> sandbox; | 356 scoped_ptr<mojo::runner::LinuxSandbox> sandbox; |
| 357 #endif | 357 #endif |
| 358 base::NativeLibrary app_library = 0; | 358 base::NativeLibrary app_library = 0; |
| 359 // Load the application library before we engage the sandbox. | 359 // Load the application library before we engage the sandbox. |
| 360 app_library = mojo::runner::LoadNativeApplication( | 360 app_library = mojo::runner::LoadNativeApplication( |
| 361 command_line.GetSwitchValuePath(switches::kChildProcess)); | 361 command_line.GetSwitchValuePath(switches::kChildProcess)); |
| 362 | 362 |
| 363 base::i18n::InitializeICU(); | 363 base::i18n::InitializeICU(); |
| 364 CallLibraryEarlyInitialization(app_library); | 364 if (app_library) |
| 365 CallLibraryEarlyInitialization(app_library); |
| 365 #if defined(OS_LINUX) && !defined(OS_ANDROID) | 366 #if defined(OS_LINUX) && !defined(OS_ANDROID) |
| 366 if (command_line.HasSwitch(switches::kEnableSandbox)) | 367 if (command_line.HasSwitch(switches::kEnableSandbox)) |
| 367 sandbox = InitializeSandbox(); | 368 sandbox = InitializeSandbox(); |
| 368 #endif | 369 #endif |
| 369 | 370 |
| 370 embedder::ScopedPlatformHandle platform_channel = | 371 embedder::ScopedPlatformHandle platform_channel = |
| 371 embedder::PlatformChannelPair::PassClientHandleFromParentProcess( | 372 embedder::PlatformChannelPair::PassClientHandleFromParentProcess( |
| 372 command_line); | 373 command_line); |
| 373 CHECK(platform_channel.is_valid()); | 374 CHECK(platform_channel.is_valid()); |
| 374 | 375 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 387 // This will block, then run whatever the controller wants. | 388 // This will block, then run whatever the controller wants. |
| 388 blocker.Block(); | 389 blocker.Block(); |
| 389 | 390 |
| 390 app_context.Shutdown(); | 391 app_context.Shutdown(); |
| 391 | 392 |
| 392 return 0; | 393 return 0; |
| 393 } | 394 } |
| 394 | 395 |
| 395 } // namespace runner | 396 } // namespace runner |
| 396 } // namespace mojo | 397 } // namespace mojo |
| OLD | NEW |