OLD | NEW |
1 /* -*- c++ -*- */ | 1 /* -*- c++ -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2011 The Native Client Authors. All rights reserved. | 3 * Copyright (c) 2011 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 |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "native_client/src/shared/platform/nacl_sync.h" | 22 #include "native_client/src/shared/platform/nacl_sync.h" |
23 | 23 |
24 namespace nacl { | 24 namespace nacl { |
25 | 25 |
26 class DescWrapper; | 26 class DescWrapper; |
27 | 27 |
28 class ReverseInterface : public RefCountBase { | 28 class ReverseInterface : public RefCountBase { |
29 public: | 29 public: |
30 virtual ~ReverseInterface() {} | 30 virtual ~ReverseInterface() {} |
31 | 31 |
32 // debugging, messaging | 32 // For debugging, messaging. |message| goes to JavaScript console. |
33 virtual void Log(nacl::string message) = 0; | 33 virtual void Log(nacl::string message) = 0; |
34 | 34 |
35 // Startup handshake | 35 // Startup handshake |
36 virtual void StartupInitializationComplete() = 0; | 36 virtual void StartupInitializationComplete() = 0; |
37 | 37 |
38 // Name service use. | 38 // Name service use. |
39 // | 39 // |
40 // Some of these functions require that the actual operation be done | 40 // Some of these functions require that the actual operation be done |
41 // in a different thread, so that the implementation of the | 41 // in a different thread, so that the implementation of the |
42 // interface will have to block the requesting thread. However, on | 42 // interface will have to block the requesting thread. However, on |
(...skipping 10 matching lines...) Expand all Loading... |
53 // as the return type. | 53 // as the return type. |
54 virtual bool EnumerateManifestKeys(std::set<nacl::string>* keys) = 0; | 54 virtual bool EnumerateManifestKeys(std::set<nacl::string>* keys) = 0; |
55 virtual bool OpenManifestEntry(nacl::string url_key, int32_t* out_desc) = 0; | 55 virtual bool OpenManifestEntry(nacl::string url_key, int32_t* out_desc) = 0; |
56 virtual bool CloseManifestEntry(int32_t desc) = 0; | 56 virtual bool CloseManifestEntry(int32_t desc) = 0; |
57 virtual void ReportCrash() = 0; | 57 virtual void ReportCrash() = 0; |
58 | 58 |
59 // The low-order 8 bits of the |exit_status| should be reported to | 59 // The low-order 8 bits of the |exit_status| should be reported to |
60 // any interested parties. | 60 // any interested parties. |
61 virtual void ReportExitStatus(int exit_status) = 0; | 61 virtual void ReportExitStatus(int exit_status) = 0; |
62 | 62 |
| 63 // Standard output and standard error redirection, via setting |
| 64 // NACL_EXE_STDOUT to the string "DEBUG_ONLY:dev://postmessage" (see |
| 65 // native_client/src/trusted/nacl_resource.* and sel_ldr). NB: the |
| 66 // contents of |message| is arbitrary bytes and not an Unicode |
| 67 // string, so the implementation should take care to handle this |
| 68 // appropriately. |
| 69 virtual void PostMessage(nacl::string message); // eventually = 0; |
| 70 |
63 // covariant impl of Ref() | 71 // covariant impl of Ref() |
64 ReverseInterface* Ref() { // down_cast | 72 ReverseInterface* Ref() { // down_cast |
65 return reinterpret_cast<ReverseInterface*>(RefCountBase::Ref()); | 73 return reinterpret_cast<ReverseInterface*>(RefCountBase::Ref()); |
66 } | 74 } |
67 }; | 75 }; |
68 | 76 |
69 class ReverseService : public RefCountBase { | 77 class ReverseService : public RefCountBase { |
70 public: | 78 public: |
71 ReverseService(nacl::DescWrapper* conn_cap, ReverseInterface* rif); | 79 ReverseService(nacl::DescWrapper* conn_cap, ReverseInterface* rif); |
72 | 80 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 static NaClSrpcHandlerDesc const handlers[]; | 122 static NaClSrpcHandlerDesc const handlers[]; |
115 | 123 |
116 NaClMutex mu_; | 124 NaClMutex mu_; |
117 NaClCondVar cv_; | 125 NaClCondVar cv_; |
118 uint32_t thread_count_; | 126 uint32_t thread_count_; |
119 }; | 127 }; |
120 | 128 |
121 } // namespace nacl | 129 } // namespace nacl |
122 | 130 |
123 #endif | 131 #endif |
OLD | NEW |