| 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 // Portable representation of a scriptable connected socket. | |
| 8 | |
| 9 #ifndef NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_SRPC_CONNECTED_SOCKET_H_ | |
| 10 #define NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_SRPC_CONNECTED_SOCKET_H_ | |
| 11 | |
| 12 #include <setjmp.h> | |
| 13 #include "native_client/src/include/nacl_macros.h" | |
| 14 #include "native_client/src/trusted/desc/nacl_desc_wrapper.h" | |
| 15 #include "native_client/src/trusted/plugin/srpc/desc_based_handle.h" | |
| 16 #include "native_client/src/trusted/plugin/srpc/utility.h" | |
| 17 | |
| 18 namespace plugin { | |
| 19 | |
| 20 class Plugin; | |
| 21 class ServiceRuntime; | |
| 22 class SrpcClient; | |
| 23 | |
| 24 // ConnectedSocket represents a connected socket that results from loading | |
| 25 // a NativeClient module or doing a connect on a received descriptor | |
| 26 // (SocketAddress). | |
| 27 class ConnectedSocket : public DescBasedHandle { | |
| 28 public: | |
| 29 static ConnectedSocket* New(Plugin* plugin, nacl::DescWrapper* desc); | |
| 30 | |
| 31 virtual bool InvokeEx(uintptr_t method_id, | |
| 32 CallType call_type, | |
| 33 SrpcParams* params); | |
| 34 virtual bool HasMethodEx(uintptr_t method_id, CallType call_type); | |
| 35 virtual bool InitParamsEx(uintptr_t method_id, | |
| 36 CallType call_type, | |
| 37 SrpcParams* params); | |
| 38 void StartJSObjectProxy(Plugin* plugin); | |
| 39 | |
| 40 private: | |
| 41 NACL_DISALLOW_COPY_AND_ASSIGN(ConnectedSocket); | |
| 42 ConnectedSocket(); | |
| 43 virtual ~ConnectedSocket(); | |
| 44 bool Init(Plugin* plugin, nacl::DescWrapper* desc); | |
| 45 SrpcClient* srpc_client_; | |
| 46 }; | |
| 47 | |
| 48 } // namespace plugin | |
| 49 | |
| 50 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_SRPC_CONNECTED_SOCKET_H_ | |
| OLD | NEW |