| OLD | NEW |
| 1 // Copyright (c) 2012 The Native Client Authors. All rights reserved. | 1 // Copyright (c) 2012 The Native Client 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 | 5 |
| 6 #include "native_client/src/trusted/sel_universal/reverse_emulate.h" | 6 #include "native_client/src/trusted/sel_universal/reverse_emulate.h" |
| 7 #include <stdio.h> | 7 #include <stdio.h> |
| 8 #include <cstring> | 8 #include <cstring> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <utility> | 12 #include <utility> |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "native_client/src/include/portability_io.h" | 15 #include "native_client/src/include/portability_io.h" |
| 16 #include "native_client/src/public/nacl_file_info.h" |
| 16 #include "native_client/src/public/secure_service.h" | 17 #include "native_client/src/public/secure_service.h" |
| 17 #include "native_client/src/shared/platform/nacl_check.h" | 18 #include "native_client/src/shared/platform/nacl_check.h" |
| 18 #include "native_client/src/shared/platform/nacl_log.h" | 19 #include "native_client/src/shared/platform/nacl_log.h" |
| 19 #include "native_client/src/shared/platform/nacl_sync.h" | 20 #include "native_client/src/shared/platform/nacl_sync.h" |
| 20 #include "native_client/src/shared/platform/nacl_sync_checked.h" | 21 #include "native_client/src/shared/platform/nacl_sync_checked.h" |
| 21 #include "native_client/src/shared/platform/nacl_sync_raii.h" | 22 #include "native_client/src/shared/platform/nacl_sync_raii.h" |
| 22 #include "native_client/src/shared/platform/nacl_threads.h" | 23 #include "native_client/src/shared/platform/nacl_threads.h" |
| 23 #include "native_client/src/shared/platform/scoped_ptr_refcount.h" | 24 #include "native_client/src/shared/platform/scoped_ptr_refcount.h" |
| 24 #include "native_client/src/shared/srpc/nacl_srpc.h" | 25 #include "native_client/src/shared/srpc/nacl_srpc.h" |
| 25 #include "native_client/src/trusted/desc/nacl_desc_wrapper.h" | 26 #include "native_client/src/trusted/desc/nacl_desc_wrapper.h" |
| 26 #include "native_client/src/trusted/nonnacl_util/launcher_factory.h" | 27 #include "native_client/src/trusted/nonnacl_util/launcher_factory.h" |
| 27 #include "native_client/src/trusted/nonnacl_util/sel_ldr_launcher.h" | 28 #include "native_client/src/trusted/nonnacl_util/sel_ldr_launcher.h" |
| 28 #include "native_client/src/trusted/reverse_service/reverse_service.h" | 29 #include "native_client/src/trusted/reverse_service/reverse_service.h" |
| 29 #include "native_client/src/trusted/sel_universal/rpc_universal.h" | 30 #include "native_client/src/trusted/sel_universal/rpc_universal.h" |
| 30 #include "native_client/src/trusted/sel_universal/srpc_helper.h" | 31 #include "native_client/src/trusted/sel_universal/srpc_helper.h" |
| 31 #include "native_client/src/trusted/validator/nacl_file_info.h" | |
| 32 | 32 |
| 33 | 33 |
| 34 // Mock of ReverseInterface for use by nexes. | 34 // Mock of ReverseInterface for use by nexes. |
| 35 class ReverseEmulate : public nacl::ReverseInterface { | 35 class ReverseEmulate : public nacl::ReverseInterface { |
| 36 public: | 36 public: |
| 37 ReverseEmulate( | 37 ReverseEmulate( |
| 38 nacl::SelLdrLauncherStandaloneFactory* factory, | 38 nacl::SelLdrLauncherStandaloneFactory* factory, |
| 39 const vector<nacl::string>& prefix, | 39 const vector<nacl::string>& prefix, |
| 40 const vector<nacl::string>& sel_ldr_argv); | 40 const vector<nacl::string>& sel_ldr_argv); |
| 41 virtual ~ReverseEmulate(); | 41 virtual ~ReverseEmulate(); |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 436 return false; | 436 return false; |
| 437 } | 437 } |
| 438 if (!subprocesses_[pid].first || subprocesses_[pid].second == NULL) { | 438 if (!subprocesses_[pid].first || subprocesses_[pid].second == NULL) { |
| 439 return false; | 439 return false; |
| 440 } | 440 } |
| 441 subprocesses_[pid].first = false; | 441 subprocesses_[pid].first = false; |
| 442 delete subprocesses_[pid].second; | 442 delete subprocesses_[pid].second; |
| 443 subprocesses_[pid].second = NULL; | 443 subprocesses_[pid].second = NULL; |
| 444 return true; | 444 return true; |
| 445 } | 445 } |
| OLD | NEW |