| 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/plugin_var_tracker.h" | 5 #include "ppapi/proxy/plugin_var_tracker.h" |
| 6 | 6 |
| 7 #include "base/ref_counted.h" | 7 #include "base/ref_counted.h" |
| 8 #include "ppapi/c/ppb_var.h" | 8 #include "ppapi/c/ppb_var.h" |
| 9 #include "ppapi/proxy/plugin_dispatcher.h" | 9 #include "ppapi/proxy/plugin_dispatcher.h" |
| 10 #include "ppapi/proxy/ppapi_messages.h" | 10 #include "ppapi/proxy/ppapi_messages.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 RefCountedString* PluginStringFromID(int64 id) { | 35 RefCountedString* PluginStringFromID(int64 id) { |
| 36 return reinterpret_cast<RefCountedString*>(static_cast<intptr_t>(id)); | 36 return reinterpret_cast<RefCountedString*>(static_cast<intptr_t>(id)); |
| 37 } | 37 } |
| 38 | 38 |
| 39 } // namespace | 39 } // namespace |
| 40 | 40 |
| 41 PluginVarTracker::PluginVarTracker(PluginDispatcher* dispatcher) | 41 PluginVarTracker::PluginVarTracker(PluginDispatcher* dispatcher) |
| 42 : dispatcher_(dispatcher) { | 42 : dispatcher_(dispatcher) { |
| 43 } | 43 } |
| 44 | 44 |
| 45 PluginVarTracker::~PluginVarTracker() {} |
| 46 |
| 45 int64 PluginVarTracker::MakeString(const std::string& str) { | 47 int64 PluginVarTracker::MakeString(const std::string& str) { |
| 46 RefCountedString* out = new RefCountedString(str); | 48 RefCountedString* out = new RefCountedString(str); |
| 47 out->AddRef(); | 49 out->AddRef(); |
| 48 return static_cast<int64>(reinterpret_cast<intptr_t>(out)); | 50 return static_cast<int64>(reinterpret_cast<intptr_t>(out)); |
| 49 } | 51 } |
| 50 | 52 |
| 51 std::string PluginVarTracker::GetString(const PP_Var& var) const { | 53 std::string PluginVarTracker::GetString(const PP_Var& var) const { |
| 52 return PluginStringFromID(var.value.as_id)->value(); | 54 return PluginStringFromID(var.value.as_id)->value(); |
| 53 } | 55 } |
| 54 | 56 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 INTERFACE_ID_PPB_VAR_DEPRECATED, id)); | 121 INTERFACE_ID_PPB_VAR_DEPRECATED, id)); |
| 120 } | 122 } |
| 121 | 123 |
| 122 void PluginVarTracker::SendReleaseObjectMsg(int64_t id) { | 124 void PluginVarTracker::SendReleaseObjectMsg(int64_t id) { |
| 123 dispatcher_->Send(new PpapiHostMsg_PPBVar_ReleaseObject( | 125 dispatcher_->Send(new PpapiHostMsg_PPBVar_ReleaseObject( |
| 124 INTERFACE_ID_PPB_VAR_DEPRECATED, id)); | 126 INTERFACE_ID_PPB_VAR_DEPRECATED, id)); |
| 125 } | 127 } |
| 126 | 128 |
| 127 } // namesace proxy | 129 } // namesace proxy |
| 128 } // namespace pp | 130 } // namespace pp |
| OLD | NEW |