Chromium Code Reviews| 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 "components/nacl/loader/nacl_listener.h" | 5 #include "components/nacl/loader/nacl_listener.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <fcntl.h> | 8 #include <fcntl.h> |
| 9 #include <stdlib.h> | 9 #include <stdlib.h> |
| 10 #include <string.h> | 10 #include <string.h> |
| 11 | 11 |
| 12 #if defined(OS_POSIX) | 12 #if defined(OS_POSIX) |
| 13 #include <unistd.h> | 13 #include <unistd.h> |
| 14 #endif | 14 #endif |
| 15 | 15 |
| 16 #include "base/command_line.h" | 16 #include "base/command_line.h" |
| 17 #include "base/logging.h" | 17 #include "base/logging.h" |
| 18 #include "base/memory/scoped_ptr.h" | 18 #include "base/memory/scoped_ptr.h" |
| 19 #include "base/message_loop/message_loop.h" | 19 #include "base/message_loop/message_loop.h" |
| 20 #include "base/rand_util.h" | 20 #include "base/rand_util.h" |
| 21 #include "components/nacl/common/nacl_messages.h" | 21 #include "components/nacl/common/nacl_messages.h" |
| 22 #include "components/nacl/common/nacl_renderer_messages.h" | |
| 22 #include "components/nacl/loader/nacl_ipc_adapter.h" | 23 #include "components/nacl/loader/nacl_ipc_adapter.h" |
| 23 #include "components/nacl/loader/nacl_validation_db.h" | 24 #include "components/nacl/loader/nacl_validation_db.h" |
| 24 #include "components/nacl/loader/nacl_validation_query.h" | 25 #include "components/nacl/loader/nacl_validation_query.h" |
| 25 #include "ipc/ipc_channel_handle.h" | 26 #include "ipc/ipc_channel_handle.h" |
| 26 #include "ipc/ipc_switches.h" | 27 #include "ipc/ipc_switches.h" |
| 27 #include "ipc/ipc_sync_channel.h" | 28 #include "ipc/ipc_sync_channel.h" |
| 28 #include "ipc/ipc_sync_message_filter.h" | 29 #include "ipc/ipc_sync_message_filter.h" |
| 29 #include "native_client/src/public/chrome_main.h" | 30 #include "native_client/src/public/chrome_main.h" |
| 30 #include "native_client/src/public/nacl_app.h" | 31 #include "native_client/src/public/nacl_app.h" |
| 31 #include "native_client/src/public/nacl_file_info.h" | 32 #include "native_client/src/public/nacl_file_info.h" |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 411 _O_RDONLY | _O_BINARY); | 412 _O_RDONLY | _O_BINARY); |
| 412 #elif defined(OS_POSIX) | 413 #elif defined(OS_POSIX) |
| 413 nexe_file_info.desc = nexe_file; | 414 nexe_file_info.desc = nexe_file; |
| 414 #else | 415 #else |
| 415 #error Unsupported target platform. | 416 #error Unsupported target platform. |
| 416 #endif | 417 #endif |
| 417 nexe_file_info.file_token.lo = params.nexe_token_lo; | 418 nexe_file_info.file_token.lo = params.nexe_token_lo; |
| 418 nexe_file_info.file_token.hi = params.nexe_token_hi; | 419 nexe_file_info.file_token.hi = params.nexe_token_hi; |
| 419 args->nexe_desc = NaClDescIoFromFileInfo(nexe_file_info, NACL_ABI_O_RDONLY); | 420 args->nexe_desc = NaClDescIoFromFileInfo(nexe_file_info, NACL_ABI_O_RDONLY); |
| 420 | 421 |
| 421 NaClChromeMainStartApp(nap, args); | 422 int exit_status; |
| 423 if (!NaClChromeMainStart(nap, args, &exit_status)) | |
| 424 NaClExit(1); | |
| 425 | |
| 426 // Report the plugin's exit status if the application started successfully. | |
| 427 // TODO(teravest): Use a separate is_helper_process field instead of assuming | |
|
Mark Seaborn
2014/08/21 21:12:32
How about sending it unconditionally but having Tr
teravest
2014/08/22 16:07:11
Done.
| |
| 428 // the translator doesn't use the IRT. | |
| 429 if (params.uses_irt) | |
| 430 trusted_listener_->Send(new NaClRendererMsg_ReportExitStatus(exit_status)); | |
| 431 NaClExit(exit_status); | |
| 422 } | 432 } |
| OLD | NEW |