OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_VAR_H_ | 5 #ifndef NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_VAR_H_ |
6 #define NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_VAR_H_ | 6 #define NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_VAR_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "native_client/src/include/nacl_macros.h" | 10 #include "native_client/src/include/nacl_macros.h" |
11 #include "native_client/src/include/portability.h" | 11 #include "native_client/src/include/portability.h" |
12 #include "ppapi/c/pp_var.h" | 12 #include "ppapi/c/pp_var.h" |
13 #include "ppapi/c/ppb_var.h" | 13 #include "ppapi/c/ppb_var.h" |
14 | 14 |
15 namespace ppapi_proxy { | 15 namespace ppapi_proxy { |
16 | 16 |
17 // Implements the plugin side of the PPB_Var interface. | 17 // Implements the plugin side of the PPB_Var interface. |
18 // This implementation also determines how PP_Vars are represented internally | 18 // This implementation also determines how PP_Vars are represented internally |
19 // in the proxied implementation. | 19 // in the proxied implementation. |
20 class PluginVar { | 20 class PluginVar { |
21 public: | 21 public: |
22 // Returns an interface pointer suitable to the PPAPI client. | 22 // Returns an interface pointer suitable to the PPAPI client. |
23 static const PPB_Var* GetInterface(); | 23 static const PPB_Var* GetInterface(); |
| 24 // Returns the 1.0 interface to support backwards-compatibility. |
| 25 static const PPB_Var_1_0* GetInterface1_0(); |
24 | 26 |
25 // String helpers. | 27 // String helpers. |
26 static PP_Var StringToPPVar(PP_Module module_id, const std::string& str); | 28 static PP_Var StringToPPVar(const std::string& str); |
27 static std::string PPVarToString(const PP_Var& var); | 29 static std::string PPVarToString(const PP_Var& var); |
28 | 30 |
29 // Printing and debugging. | 31 // Printing and debugging. |
30 static void Print(const PP_Var& var); | 32 static void Print(const PP_Var& var); |
31 static std::string DebugString(const PP_Var& var); | 33 static std::string DebugString(const PP_Var& var); |
32 | 34 |
33 private: | 35 private: |
34 NACL_DISALLOW_COPY_AND_ASSIGN(PluginVar); | 36 NACL_DISALLOW_COPY_AND_ASSIGN(PluginVar); |
35 }; | 37 }; |
36 | 38 |
37 } // namespace ppapi_proxy | 39 } // namespace ppapi_proxy |
38 | 40 |
39 #endif // NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_VAR_H_ | 41 #endif // NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_VAR_H_ |
40 | 42 |
OLD | NEW |