OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 The Native Client 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 #ifndef NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_VAR_H_ |
| 6 #define NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_VAR_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "native_client/src/include/nacl_macros.h" |
| 11 #include "native_client/src/include/portability.h" |
| 12 #include "ppapi/c/pp_var.h" |
| 13 #include "ppapi/c/ppb_var.h" |
| 14 |
| 15 namespace ppapi_proxy { |
| 16 |
| 17 // Implements the plugin side of the PPB_Var interface. |
| 18 // This implementation also determines how PP_Vars are represented internally |
| 19 // in the proxied implementation. |
| 20 class PluginVar { |
| 21 public: |
| 22 // Returns an interface pointer suitable to the PPAPI client. |
| 23 static const PPB_Var* GetInterface(); |
| 24 |
| 25 // String helpers. |
| 26 static PP_Var StringToPPVar(PP_Module module_id, const std::string& str); |
| 27 static std::string PPVarToString(const PP_Var& var); |
| 28 |
| 29 // Printing and debugging. |
| 30 static void Print(const PP_Var& var); |
| 31 static std::string DebugString(const PP_Var& var); |
| 32 |
| 33 private: |
| 34 NACL_DISALLOW_COPY_AND_ASSIGN(PluginVar); |
| 35 }; |
| 36 |
| 37 } // namespace ppapi_proxy |
| 38 |
| 39 #endif // NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_VAR_H_ |
| 40 |
OLD | NEW |