Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Side by Side Diff: src/trusted/plugin/srpc/srpc_client.h

Issue 2981011: Move plugin/srpc contents to the more appropriately named plugin/common.... (Closed) Base URL: http://nativeclient.googlecode.com/svn/trunk/src/native_client/
Patch Set: '' Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/trusted/plugin/srpc/socket_address.cc ('k') | src/trusted/plugin/srpc/srpc_client.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 an SRPC connection. These can be either to the
8 // service runtime or to untrusted NaCl threads.
9
10 #ifndef NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_SRPC_SRPC_CLIENT_H_
11 #define NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_SRPC_SRPC_CLIENT_H_
12
13 #include <map>
14 #include "native_client/src/include/nacl_macros.h"
15 #include "native_client/src/trusted/plugin/srpc/utility.h"
16
17 namespace plugin {
18
19 class ConnectedSocket;
20 class MethodInfo;
21
22 // SrpcClient represents an SRPC connection to a client.
23 class SrpcClient {
24 public:
25 // Init is passed a ConnectedSocket. It performs service
26 // discovery and provides the interface for future rpcs.
27 bool Init(BrowserInterface* browser_interface, ConnectedSocket* socket);
28
29 explicit SrpcClient();
30 // The destructor closes the connection to sel_ldr.
31 ~SrpcClient();
32
33 void StartJSObjectProxy(Plugin* plugin);
34 // Test whether the SRPC service has a given method.
35 bool HasMethod(uintptr_t method_id);
36 // Invoke an SRPC method.
37 bool Invoke(uintptr_t method_id, SrpcParams* params);
38 bool InitParams(uintptr_t method_id, SrpcParams* params);
39
40 private:
41 NACL_DISALLOW_COPY_AND_ASSIGN(SrpcClient);
42 void GetMethods();
43 typedef std::map<uintptr_t, MethodInfo*> Methods;
44 Methods methods_;
45 NaClSrpcChannel srpc_channel_;
46 BrowserInterface* browser_interface_;
47 };
48
49 } // namespace plugin
50
51 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_SRPC_SRPC_CLIENT_H_
OLDNEW
« no previous file with comments | « src/trusted/plugin/srpc/socket_address.cc ('k') | src/trusted/plugin/srpc/srpc_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698