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