| 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" | |
| 10 #include "ppapi/proxy/plugin_resource_tracker.h" | 9 #include "ppapi/proxy/plugin_resource_tracker.h" |
| 11 #include "ppapi/proxy/plugin_var_tracker.h" | 10 #include "ppapi/proxy/plugin_var_tracker.h" |
| 12 #include "ppapi/shared_impl/ppapi_globals.h" | |
| 13 #include "ppapi/shared_impl/var.h" | 11 #include "ppapi/shared_impl/var.h" |
| 14 | 12 |
| 15 namespace ppapi { | 13 namespace ppapi { |
| 16 namespace proxy { | 14 namespace proxy { |
| 17 | 15 |
| 18 PluginVarSerializationRules::PluginVarSerializationRules() | 16 PluginVarSerializationRules::PluginVarSerializationRules() |
| 19 : var_tracker_(PluginGlobals::Get()->plugin_var_tracker()) { | 17 : var_tracker_(&PluginResourceTracker::GetInstance()->var_tracker()) { |
| 20 } | 18 } |
| 21 | 19 |
| 22 PluginVarSerializationRules::~PluginVarSerializationRules() { | 20 PluginVarSerializationRules::~PluginVarSerializationRules() { |
| 23 } | 21 } |
| 24 | 22 |
| 25 PP_Var PluginVarSerializationRules::SendCallerOwned(const PP_Var& var, | 23 PP_Var PluginVarSerializationRules::SendCallerOwned(const PP_Var& var, |
| 26 std::string* str_val) { | 24 std::string* str_val) { |
| 27 // Objects need special translations to get the IDs valid in the host. | 25 // Objects need special translations to get the IDs valid in the host. |
| 28 if (var.type == PP_VARTYPE_OBJECT) | 26 if (var.type == PP_VARTYPE_OBJECT) |
| 29 return var_tracker_->GetHostObject(var); | 27 return var_tracker_->GetHostObject(var); |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 static_cast<PluginDispatcher*>(dispatcher), var); | 136 static_cast<PluginDispatcher*>(dispatcher), var); |
| 139 } | 137 } |
| 140 } | 138 } |
| 141 | 139 |
| 142 void PluginVarSerializationRules::ReleaseObjectRef(const PP_Var& var) { | 140 void PluginVarSerializationRules::ReleaseObjectRef(const PP_Var& var) { |
| 143 var_tracker_->ReleaseVar(var); | 141 var_tracker_->ReleaseVar(var); |
| 144 } | 142 } |
| 145 | 143 |
| 146 } // namespace proxy | 144 } // namespace proxy |
| 147 } // namespace ppapi | 145 } // namespace ppapi |
| OLD | NEW |