OLD | NEW |
| (Empty) |
1 /* | |
2 * Copyright 2008 The Native Client Authors. All rights reserved. | |
3 * Use of this source code is governed by a BSD-style license that can | |
4 * be found in the LICENSE file. | |
5 */ | |
6 | |
7 // A representation of a connected socket connection to the service runtime. | |
8 | |
9 #ifndef NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_SRPC_SRT_SOCKET_H_ | |
10 #define NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_SRPC_SRT_SOCKET_H_ | |
11 | |
12 #include "native_client/src/include/nacl_macros.h" | |
13 #include "native_client/src/include/nacl_string.h" | |
14 #include "native_client/src/shared/imc/nacl_imc.h" | |
15 #include "native_client/src/trusted/plugin/srpc/connected_socket.h" | |
16 #include "native_client/src/trusted/plugin/srpc/scriptable_handle.h" | |
17 | |
18 struct NaClDesc; | |
19 | |
20 namespace plugin { | |
21 | |
22 class SrtSocket { | |
23 public: | |
24 SrtSocket(ScriptableHandle* s, BrowserInterface* browser_interface); | |
25 ~SrtSocket(); | |
26 | |
27 bool SetOrigin(nacl::string origin); | |
28 bool StartModule(int* load_status); | |
29 bool LoadModule(NaClDesc* desc); | |
30 #if NACL_WINDOWS && !defined(NACL_STANDALONE) | |
31 bool InitHandlePassing(NaClDesc* desc, nacl::Handle sel_ldr_handle); | |
32 #endif | |
33 bool Log(int severity, nacl::string msg); | |
34 | |
35 PortableHandle* connected_socket() const { | |
36 return connected_socket_->handle(); | |
37 } | |
38 | |
39 private: | |
40 NACL_DISALLOW_COPY_AND_ASSIGN(SrtSocket); | |
41 ScriptableHandle* connected_socket_; | |
42 BrowserInterface* browser_interface_; | |
43 }; // class SrtSocket | |
44 | |
45 } // namespace plugin | |
46 | |
47 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_SRPC_SRT_SOCKET_H_ | |
OLD | NEW |