| 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 #include "ppapi/proxy/plugin_var_serialization_rules.h" | 5 #include "ppapi/proxy/plugin_var_serialization_rules.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "ppapi/proxy/plugin_dispatcher.h" | 8 #include "ppapi/proxy/plugin_dispatcher.h" |
| 9 #include "ppapi/proxy/plugin_globals.h" | 9 #include "ppapi/proxy/plugin_globals.h" |
| 10 #include "ppapi/proxy/plugin_resource_tracker.h" | 10 #include "ppapi/proxy/plugin_resource_tracker.h" |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 | 129 |
| 130 void PluginVarSerializationRules::EndSendPassRef(const PP_Var& var, | 130 void PluginVarSerializationRules::EndSendPassRef(const PP_Var& var, |
| 131 Dispatcher* dispatcher) { | 131 Dispatcher* dispatcher) { |
| 132 // See BeginSendPassRef for an example of why we release our ref here. | 132 // See BeginSendPassRef for an example of why we release our ref here. |
| 133 // The var we have in our inner class has been converted to a host object | 133 // The var we have in our inner class has been converted to a host object |
| 134 // by BeginSendPassRef. This means it's not a normal var valid in the plugin, | 134 // by BeginSendPassRef. This means it's not a normal var valid in the plugin, |
| 135 // so we need to use the special ReleaseHostObject. | 135 // so we need to use the special ReleaseHostObject. |
| 136 if (var.type == PP_VARTYPE_OBJECT) { | 136 if (var.type == PP_VARTYPE_OBJECT) { |
| 137 var_tracker_->ReleaseHostObject( | 137 var_tracker_->ReleaseHostObject( |
| 138 static_cast<PluginDispatcher*>(dispatcher), var); | 138 static_cast<PluginDispatcher*>(dispatcher), var); |
| 139 } else if (var.type == PP_VARTYPE_STRING) { |
| 140 var_tracker_->ReleaseVar(var); |
| 139 } | 141 } |
| 140 } | 142 } |
| 141 | 143 |
| 142 void PluginVarSerializationRules::ReleaseObjectRef(const PP_Var& var) { | 144 void PluginVarSerializationRules::ReleaseObjectRef(const PP_Var& var) { |
| 143 var_tracker_->ReleaseVar(var); | 145 var_tracker_->ReleaseVar(var); |
| 144 } | 146 } |
| 145 | 147 |
| 146 } // namespace proxy | 148 } // namespace proxy |
| 147 } // namespace ppapi | 149 } // namespace ppapi |
| OLD | NEW |