| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2011 The Native Client Authors. All rights reserved. | 2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. |
| 3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
| 4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
| 5 */ | 5 */ |
| 6 | 6 |
| 7 #ifndef NATIVE_CLIENT_SRC_TRUSTED_SEL_UNIVERSAL_REVERSE_EMULATE_H_ | 7 #ifndef NATIVE_CLIENT_SRC_TRUSTED_SEL_UNIVERSAL_REVERSE_EMULATE_H_ |
| 8 #define NATIVE_CLIENT_SRC_TRUSTED_SEL_UNIVERSAL_REVERSE_EMULATE_H_ | 8 #define NATIVE_CLIENT_SRC_TRUSTED_SEL_UNIVERSAL_REVERSE_EMULATE_H_ |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "native_client/src/trusted/nonnacl_util/sel_ldr_launcher.h" |
| 14 |
| 13 class NaClCommandLoop; | 15 class NaClCommandLoop; |
| 14 struct NaClSrpcChannel; | 16 struct NaClSrpcChannel; |
| 15 | 17 |
| 16 namespace nacl { | 18 namespace nacl { |
| 17 class ReverseService; | 19 class ReverseService; |
| 18 struct SelLdrLauncher; | |
| 19 } // namespace nacl | 20 } // namespace nacl |
| 20 | 21 |
| 21 // The browser exports a reverse service that client nexes can use for a | 22 // The browser exports a reverse service that client nexes can use for a |
| 22 // variety of services. Among the most important of those are: | 23 // variety of services. Among the most important of those are: |
| 23 // 1) Logging to the browser console. | 24 // 1) Logging to the browser console. |
| 24 // 2) Getting the list of keys in the manifest file. | 25 // 2) Getting the list of keys in the manifest file. |
| 25 // 3) Opening URLs for a specific key in the manifest file. | 26 // 3) Opening URLs for a specific key in the manifest file. |
| 26 // Our emulation provides (2) and (3). | 27 // Our emulation provides (2) and (3). |
| 27 | 28 |
| 28 // Starts an emulator for reverse service and handles the start up expected | 29 // Starts an emulator for reverse service and handles the start up expected |
| 29 // by nexes. Returns true on success, false on failure. | 30 // by nexes. Returns true on success, false on failure. |
| 30 bool ReverseEmulateInit(NaClSrpcChannel* command_channel, | 31 bool ReverseEmulateInit(NaClSrpcChannel* command_channel, |
| 31 nacl::SelLdrLauncher* launcher); | 32 nacl::SelLdrLauncherStandalone* launcher); |
| 32 | 33 |
| 33 // Shuts down reverse service emulation. | 34 // Shuts down reverse service emulation. |
| 34 void ReverseEmulateFini(); | 35 void ReverseEmulateFini(); |
| 35 | 36 |
| 36 // Add a manifest file mapping from key to a descriptor from a pathname. | 37 // Add a manifest file mapping from key to a descriptor from a pathname. |
| 37 bool HandlerReverseEmuAddManifestMapping(NaClCommandLoop* ncl, | 38 bool HandlerReverseEmuAddManifestMapping(NaClCommandLoop* ncl, |
| 38 const std::vector<std::string>& args); | 39 const std::vector<std::string>& args); |
| 39 | 40 |
| 40 // Dump the manifest key --> pathname pairs. | 41 // Dump the manifest key --> pathname pairs. |
| 41 bool HandlerReverseEmuDumpManifestMappings( | 42 bool HandlerReverseEmuDumpManifestMappings( |
| 42 NaClCommandLoop* ncl, | 43 NaClCommandLoop* ncl, |
| 43 const std::vector<std::string>& args); | 44 const std::vector<std::string>& args); |
| 44 | 45 |
| 45 #endif /* NATIVE_CLIENT_SRC_TRUSTED_SEL_UNIVERSAL_REVERSE_EMULATE_H_ */ | 46 #endif /* NATIVE_CLIENT_SRC_TRUSTED_SEL_UNIVERSAL_REVERSE_EMULATE_H_ */ |
| OLD | NEW |