OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 PPAPI_PROXY_PLUGIN_VAR_SERIALIZATION_RULES_H_ | 5 #ifndef PPAPI_PROXY_PLUGIN_VAR_SERIALIZATION_RULES_H_ |
6 #define PPAPI_PROXY_PLUGIN_VAR_SERIALIZATION_RULES_H_ | 6 #define PPAPI_PROXY_PLUGIN_VAR_SERIALIZATION_RULES_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "ppapi/proxy/var_serialization_rules.h" | 9 #include "ppapi/proxy/var_serialization_rules.h" |
10 | 10 |
11 namespace ppapi { | 11 namespace ppapi { |
12 namespace proxy { | 12 namespace proxy { |
13 | 13 |
14 class PluginVarTracker; | 14 class PluginVarTracker; |
15 | 15 |
16 // Implementation of the VarSerialization interface for the plugin. | 16 // Implementation of the VarSerialization interface for the plugin. |
17 class PluginVarSerializationRules : public VarSerializationRules { | 17 class PluginVarSerializationRules : public VarSerializationRules { |
18 public: | 18 public: |
19 // This class will use the given non-owning pointer to the var tracker to | 19 // This class will use the given non-owning pointer to the var tracker to |
20 // handle object refcounting and string conversion. | 20 // handle object refcounting and string conversion. |
21 PluginVarSerializationRules(); | 21 PluginVarSerializationRules(); |
22 ~PluginVarSerializationRules(); | 22 ~PluginVarSerializationRules(); |
23 | 23 |
24 // VarSerialization implementation. | 24 // VarSerialization implementation. |
25 virtual PP_Var SendCallerOwned(const PP_Var& var, | 25 virtual PP_Var SendCallerOwned(const PP_Var& var); |
26 const std::string** str_ptr_out); | |
27 virtual PP_Var BeginReceiveCallerOwned(const PP_Var& var, | 26 virtual PP_Var BeginReceiveCallerOwned(const PP_Var& var, |
28 scoped_ptr<std::string> str, | |
29 Dispatcher* dispatcher); | 27 Dispatcher* dispatcher); |
30 virtual void EndReceiveCallerOwned(const PP_Var& var); | 28 virtual void EndReceiveCallerOwned(const PP_Var& var); |
31 virtual PP_Var ReceivePassRef(const PP_Var& var, | 29 virtual PP_Var ReceivePassRef(const PP_Var& var, Dispatcher* dispatcher); |
32 scoped_ptr<std::string> str, | 30 virtual PP_Var BeginSendPassRef(const PP_Var& var); |
33 Dispatcher* dispatcher); | |
34 virtual PP_Var BeginSendPassRef(const PP_Var& var, | |
35 const std::string** str_ptr_out); | |
36 virtual void EndSendPassRef(const PP_Var& var, Dispatcher* dispatcher); | 31 virtual void EndSendPassRef(const PP_Var& var, Dispatcher* dispatcher); |
37 virtual void ReleaseObjectRef(const PP_Var& var); | 32 virtual void ReleaseObjectRef(const PP_Var& var); |
38 | 33 |
39 private: | 34 private: |
40 PluginVarTracker* var_tracker_; | 35 PluginVarTracker* var_tracker_; |
41 | 36 |
42 DISALLOW_COPY_AND_ASSIGN(PluginVarSerializationRules); | 37 DISALLOW_COPY_AND_ASSIGN(PluginVarSerializationRules); |
43 }; | 38 }; |
44 | 39 |
45 } // namespace proxy | 40 } // namespace proxy |
46 } // namespace ppapi | 41 } // namespace ppapi |
47 | 42 |
48 #endif // PPAPI_PROXY_PLUGIN_VAR_SERIALIZATION_RULES_H_ | 43 #endif // PPAPI_PROXY_PLUGIN_VAR_SERIALIZATION_RULES_H_ |
OLD | NEW |