| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "ppapi/proxy/ppb_var_deprecated_proxy.h" | 5 #include "ppapi/proxy/ppb_var_deprecated_proxy.h" |
| 6 | 6 |
| 7 #include <stdlib.h> // For malloc | 7 #include <stdlib.h> // For malloc |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "ppapi/c/dev/ppb_var_deprecated.h" | 10 #include "ppapi/c/dev/ppb_var_deprecated.h" |
| 11 #include "ppapi/c/pp_var.h" | 11 #include "ppapi/c/pp_var.h" |
| 12 #include "ppapi/c/ppb_core.h" | 12 #include "ppapi/c/ppb_core.h" |
| 13 #include "ppapi/proxy/plugin_dispatcher.h" | 13 #include "ppapi/proxy/plugin_dispatcher.h" |
| 14 #include "ppapi/proxy/ppapi_messages.h" | 14 #include "ppapi/proxy/ppapi_messages.h" |
| 15 #include "ppapi/proxy/ppp_class_proxy.h" | 15 #include "ppapi/proxy/ppp_class_proxy.h" |
| 16 #include "ppapi/proxy/serialized_var.h" | 16 #include "ppapi/proxy/serialized_var.h" |
| 17 | 17 |
| 18 namespace pp { | 18 namespace pp { |
| 19 namespace proxy { | 19 namespace proxy { |
| 20 | 20 |
| 21 namespace { | 21 namespace { |
| 22 | 22 |
| 23 // PPP_Var_Deprecated plugin --------------------------------------------------- | 23 // PPP_Var_Deprecated plugin --------------------------------------------------- |
| 24 | 24 |
| 25 void AddRefVar(PP_Var var) { | 25 void AddRefVar(PP_Var var) { |
| 26 PluginDispatcher::Get()->plugin_var_tracker()->AddRef(var); | 26 PluginVarTracker::GetInstance()->AddRef(var); |
| 27 } | 27 } |
| 28 | 28 |
| 29 void ReleaseVar(PP_Var var) { | 29 void ReleaseVar(PP_Var var) { |
| 30 PluginDispatcher::Get()->plugin_var_tracker()->Release(var); | 30 PluginVarTracker::GetInstance()->Release(var); |
| 31 } | 31 } |
| 32 | 32 |
| 33 PP_Var VarFromUtf8(PP_Module module, const char* data, uint32_t len) { | 33 PP_Var VarFromUtf8(PP_Module module, const char* data, uint32_t len) { |
| 34 PP_Var ret; | 34 PP_Var ret; |
| 35 ret.type = PP_VARTYPE_STRING; | 35 ret.type = PP_VARTYPE_STRING; |
| 36 ret.value.as_id = PluginDispatcher::Get()->plugin_var_tracker()->MakeString( | 36 ret.value.as_id = PluginVarTracker::GetInstance()->MakeString( |
| 37 data, len); | 37 data, len); |
| 38 return ret; | 38 return ret; |
| 39 } | 39 } |
| 40 | 40 |
| 41 const char* VarToUtf8(PP_Var var, uint32_t* len) { | 41 const char* VarToUtf8(PP_Var var, uint32_t* len) { |
| 42 const std::string* str = | 42 const std::string* str = |
| 43 PluginDispatcher::Get()->plugin_var_tracker()->GetExistingString(var); | 43 PluginVarTracker::GetInstance()->GetExistingString(var); |
| 44 if (str) { | 44 if (str) { |
| 45 *len = static_cast<uint32_t>(str->size()); | 45 *len = static_cast<uint32_t>(str->size()); |
| 46 return str->c_str(); | 46 return str->c_str(); |
| 47 } | 47 } |
| 48 *len = 0; | 48 *len = 0; |
| 49 return NULL; | 49 return NULL; |
| 50 } | 50 } |
| 51 | 51 |
| 52 bool HasProperty(PP_Var var, | 52 bool HasProperty(PP_Var var, |
| 53 PP_Var name, | 53 PP_Var name, |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 PP_Instance instance, | 378 PP_Instance instance, |
| 379 int64 ppp_class, | 379 int64 ppp_class, |
| 380 int64 class_data, | 380 int64 class_data, |
| 381 SerializedVarReturnValue result) { | 381 SerializedVarReturnValue result) { |
| 382 result.Return(dispatcher(), PPP_Class_Proxy::CreateProxiedObject( | 382 result.Return(dispatcher(), PPP_Class_Proxy::CreateProxiedObject( |
| 383 ppb_var_target(), dispatcher(), instance, ppp_class, class_data)); | 383 ppb_var_target(), dispatcher(), instance, ppp_class, class_data)); |
| 384 } | 384 } |
| 385 | 385 |
| 386 } // namespace proxy | 386 } // namespace proxy |
| 387 } // namespace pp | 387 } // namespace pp |
| OLD | NEW |