Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* -*- c++ -*- */ | 1 /* -*- c++ -*- */ |
| 2 /* | 2 /* |
| 3 * Copyright (c) 2012 The Native Client Authors. All rights reserved. | 3 * Copyright (c) 2012 The Native Client Authors. All rights reserved. |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef NATIVE_CLIENT_SRC_TRUSTED_REVERSE_SERVICE_REVERSE_SERVICE_H_ | 8 #ifndef NATIVE_CLIENT_SRC_TRUSTED_REVERSE_SERVICE_REVERSE_SERVICE_H_ |
| 9 #define NATIVE_CLIENT_SRC_TRUSTED_REVERSE_SERVICE_REVERSE_SERVICE_H_ | 9 #define NATIVE_CLIENT_SRC_TRUSTED_REVERSE_SERVICE_REVERSE_SERVICE_H_ |
| 10 | 10 |
| 11 #include <set> | 11 #include <set> |
| 12 | 12 |
| 13 #include "native_client/src/include/nacl_compiler_annotations.h" | 13 #include "native_client/src/include/nacl_compiler_annotations.h" |
| 14 #include "native_client/src/include/nacl_macros.h" | 14 #include "native_client/src/include/nacl_macros.h" |
| 15 #include "native_client/src/include/nacl_scoped_ptr.h" | 15 #include "native_client/src/include/nacl_scoped_ptr.h" |
| 16 #include "native_client/src/include/nacl_string.h" | 16 #include "native_client/src/include/nacl_string.h" |
| 17 | 17 |
| 18 #include "native_client/src/shared/platform/refcount_base.h" | 18 #include "native_client/src/shared/platform/refcount_base.h" |
| 19 #include "native_client/src/shared/platform/nacl_sync.h" | 19 #include "native_client/src/shared/platform/nacl_sync.h" |
| 20 #include "native_client/src/trusted/desc/nacl_desc_wrapper.h" | 20 #include "native_client/src/trusted/desc/nacl_desc_wrapper.h" |
| 21 #include "native_client/src/trusted/reverse_service/reverse_service_c.h" | 21 #include "native_client/src/trusted/reverse_service/reverse_service_c.h" |
| 22 #include "native_client/src/trusted/service_runtime/include/sys/errno.h" | 22 #include "native_client/src/trusted/service_runtime/include/sys/errno.h" |
| 23 #include "native_client/src/trusted/service_runtime/include/sys/nacl_name_servic e.h" | 23 #include "native_client/src/trusted/service_runtime/include/sys/nacl_name_servic e.h" |
| 24 | 24 |
| 25 struct NaClFileInfo; | |
| 26 | |
| 25 namespace nacl { | 27 namespace nacl { |
| 26 | 28 |
| 27 // The CreateProcessFunctorInterface allows delivery of results to an | 29 // The CreateProcessFunctorInterface allows delivery of results to an |
| 28 // RPC handler via the Results arguments. This is so that RPC | 30 // RPC handler via the Results arguments. This is so that RPC |
| 29 // handlers can invoke their done closure to send the output arguments | 31 // handlers can invoke their done closure to send the output arguments |
| 30 // -- when the functor returns, the code that invoked the | 32 // -- when the functor returns, the code that invoked the |
| 31 // CreateProcessFunctorInterface can unlock mutex locks, deallocate | 33 // CreateProcessFunctorInterface can unlock mutex locks, deallocate |
| 32 // memory, or finalize storage as needed. (See the 2-phase comment in | 34 // memory, or finalize storage as needed. (See the 2-phase comment in |
| 33 // src/trusted/sel_universal/reverse_emulate.cc, | 35 // src/trusted/sel_universal/reverse_emulate.cc, |
| 34 // ReverseEmulate::CreateProcessFunctorResult.) | 36 // ReverseEmulate::CreateProcessFunctorResult.) |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 69 | 71 |
| 70 // The bool functions returns false if the service thread unblocked | 72 // The bool functions returns false if the service thread unblocked |
| 71 // because of surf-away, shutdown, or other issues. The plugin, | 73 // because of surf-away, shutdown, or other issues. The plugin, |
| 72 // when it tells sel_ldr to shut down, will also signal all threads | 74 // when it tells sel_ldr to shut down, will also signal all threads |
| 73 // that are waiting for main thread callbacks to wake up and abandon | 75 // that are waiting for main thread callbacks to wake up and abandon |
| 74 // their vigil after the callbacks are all cancelled (by abandoning | 76 // their vigil after the callbacks are all cancelled (by abandoning |
| 75 // the WeakRefAnchor or by bombing their CompletionCallbackFactory). | 77 // the WeakRefAnchor or by bombing their CompletionCallbackFactory). |
| 76 // Since shutdown/surfaway is the only admissible error, we use bool | 78 // Since shutdown/surfaway is the only admissible error, we use bool |
| 77 // as the return type. | 79 // as the return type. |
| 78 virtual bool EnumerateManifestKeys(std::set<nacl::string>* keys) = 0; | 80 virtual bool EnumerateManifestKeys(std::set<nacl::string>* keys) = 0; |
| 79 virtual bool OpenManifestEntry(nacl::string url_key, int32_t* out_desc) = 0; | 81 virtual bool OpenManifestEntry(nacl::string url_key, |
|
bsy
2013/05/10 23:52:56
isn't this going to cause the chrome-side code to
Nick Bray (chromium)
2013/05/13 20:27:44
Done.
| |
| 82 struct NaClFileInfo* info) = 0; | |
| 80 virtual bool CloseManifestEntry(int32_t desc) = 0; | 83 virtual bool CloseManifestEntry(int32_t desc) = 0; |
| 81 virtual void ReportCrash() = 0; | 84 virtual void ReportCrash() = 0; |
| 82 | 85 |
| 83 // The low-order 8 bits of the |exit_status| should be reported to | 86 // The low-order 8 bits of the |exit_status| should be reported to |
| 84 // any interested parties. | 87 // any interested parties. |
| 85 virtual void ReportExitStatus(int exit_status) = 0; | 88 virtual void ReportExitStatus(int exit_status) = 0; |
| 86 | 89 |
| 87 // Standard output and standard error redirection, via setting | 90 // Standard output and standard error redirection, via setting |
| 88 // NACL_EXE_STDOUT to the string "DEBUG_ONLY:dev://postmessage" (see | 91 // NACL_EXE_STDOUT to the string "DEBUG_ONLY:dev://postmessage" (see |
| 89 // native_client/src/trusted/nacl_resource.* and sel_ldr). NB: the | 92 // native_client/src/trusted/nacl_resource.* and sel_ldr). NB: the |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 176 private: | 179 private: |
| 177 NACL_DISALLOW_COPY_AND_ASSIGN(ReverseService); | 180 NACL_DISALLOW_COPY_AND_ASSIGN(ReverseService); |
| 178 | 181 |
| 179 NaClReverseService* service_; | 182 NaClReverseService* service_; |
| 180 ReverseInterface* reverse_interface_; | 183 ReverseInterface* reverse_interface_; |
| 181 }; | 184 }; |
| 182 | 185 |
| 183 } // namespace nacl | 186 } // namespace nacl |
| 184 | 187 |
| 185 #endif | 188 #endif |
| OLD | NEW |