| 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 <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 typedef std::map<nacl::string, string> KeyToFileMap; | 65 typedef std::map<nacl::string, string> KeyToFileMap; |
| 66 | 66 |
| 67 KeyToFileMap g_key_to_file; | 67 KeyToFileMap g_key_to_file; |
| 68 | 68 |
| 69 nacl::scoped_ptr_refcount<nacl::ReverseService> g_reverse_service; | 69 nacl::scoped_ptr_refcount<nacl::ReverseService> g_reverse_service; |
| 70 | 70 |
| 71 } // end namespace | 71 } // end namespace |
| 72 | 72 |
| 73 | 73 |
| 74 bool ReverseEmulateInit(NaClSrpcChannel* command_channel, | 74 bool ReverseEmulateInit(NaClSrpcChannel* command_channel, |
| 75 nacl::SelLdrLauncher* launcher) { | 75 nacl::SelLdrLauncherStandalone* launcher) { |
| 76 // Do the SRPC to the command channel to set up the reverse channel. | 76 // Do the SRPC to the command channel to set up the reverse channel. |
| 77 // This returns a NaClDesc* containing a socket address. | 77 // This returns a NaClDesc* containing a socket address. |
| 78 NaClLog(1, "ReverseEmulateInit: launching reverse RPC service\n"); | 78 NaClLog(1, "ReverseEmulateInit: launching reverse RPC service\n"); |
| 79 NaClDesc* h; | 79 NaClDesc* h; |
| 80 NaClSrpcResultCodes rpc_result = | 80 NaClSrpcResultCodes rpc_result = |
| 81 NaClSrpcInvokeBySignature(command_channel, "reverse_setup::h", &h); | 81 NaClSrpcInvokeBySignature(command_channel, "reverse_setup::h", &h); |
| 82 if (NACL_SRPC_RESULT_OK != rpc_result) { | 82 if (NACL_SRPC_RESULT_OK != rpc_result) { |
| 83 NaClLog(LOG_ERROR, "ReverseEmulateInit: reverse setup failed\n"); | 83 NaClLog(LOG_ERROR, "ReverseEmulateInit: reverse setup failed\n"); |
| 84 return false; | 84 return false; |
| 85 } | 85 } |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 } | 212 } |
| 213 | 213 |
| 214 int64_t ReverseEmulate::RequestQuotaForWrite(nacl::string file_id, | 214 int64_t ReverseEmulate::RequestQuotaForWrite(nacl::string file_id, |
| 215 int64_t offset, | 215 int64_t offset, |
| 216 int64_t length) { | 216 int64_t length) { |
| 217 NaClLog(1, "ReverseEmulate::RequestQuotaForWrite (file_id=%s, offset=%" | 217 NaClLog(1, "ReverseEmulate::RequestQuotaForWrite (file_id=%s, offset=%" |
| 218 NACL_PRId64", length=%"NACL_PRId64")\n", file_id.c_str(), offset, | 218 NACL_PRId64", length=%"NACL_PRId64")\n", file_id.c_str(), offset, |
| 219 length); | 219 length); |
| 220 return length; | 220 return length; |
| 221 } | 221 } |
| OLD | NEW |