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

Side by Side Diff: ppapi/native_client/src/trusted/plugin/srpc_params.h

Issue 9390028: Remove browser support for non-PPAPI nexes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 10 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
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // Parameter types for SRPC Invocation.
6
7 #ifndef NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_SRPC_PARAMS_H
8 #define NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_SRPC_PARAMS_H
9
10 #include "native_client/src/include/nacl_macros.h"
11 #include "native_client/src/include/portability_string.h"
12 #include "native_client/src/shared/srpc/nacl_srpc.h"
13
14 namespace plugin {
15
16 // A utility class that builds and deletes parameter vectors used in rpcs.
17 class SrpcParams {
18 public:
19 SrpcParams() : exception_string_(NULL) {
20 memset(ins_, 0, sizeof(ins_));
21 memset(outs_, 0, sizeof(outs_));
22 }
23
24 SrpcParams(const char* in_types, const char* out_types)
25 : exception_string_(NULL) {
26 if (!Init(in_types, out_types)) {
27 FreeAll();
28 }
29 }
30
31 ~SrpcParams() {
32 FreeAll();
33 free(exception_string_);
34 }
35
36 bool Init(const char* in_types, const char* out_types);
37
38 NaClSrpcArg** ins() const { return const_cast<NaClSrpcArg**>(ins_); }
39 NaClSrpcArg** outs() const { return const_cast<NaClSrpcArg**>(outs_); }
40
41 char* exception_string() const { return exception_string_; }
42 void set_exception_string(const char* msg) {
43 exception_string_ = STRDUP(msg);
jvoung - send to chromium... 2012/02/15 08:28:17 Should this check if a previous exception_string w
sehr (please use chromium) 2012/02/15 17:58:10 Good catch. Removed.
44 }
45
46 private:
47 NACL_DISALLOW_COPY_AND_ASSIGN(SrpcParams);
48 void FreeAll();
49 // The ins_ and outs_ arrays contain one more element, to hold a NULL pointer
50 // to indicate the end of the list.
51 NaClSrpcArg* ins_[NACL_SRPC_MAX_ARGS + 1];
52 NaClSrpcArg* outs_[NACL_SRPC_MAX_ARGS + 1];
53 char* exception_string_;
54 };
55
56 } // namespace plugin
57
58 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_SRPC_PARAMS_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698