| 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/ppp_messaging_proxy.h" | 5 #include "ppapi/proxy/ppp_messaging_proxy.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ppapi/c/ppp_messaging.h" | 9 #include "ppapi/c/ppp_messaging.h" |
| 10 #include "ppapi/proxy/host_dispatcher.h" | 10 #include "ppapi/proxy/host_dispatcher.h" |
| 11 #include "ppapi/proxy/plugin_resource_tracker.h" |
| 11 #include "ppapi/proxy/plugin_var_tracker.h" | 12 #include "ppapi/proxy/plugin_var_tracker.h" |
| 12 #include "ppapi/proxy/ppapi_messages.h" | 13 #include "ppapi/proxy/ppapi_messages.h" |
| 13 #include "ppapi/proxy/serialized_var.h" | 14 #include "ppapi/proxy/serialized_var.h" |
| 14 | 15 |
| 15 namespace pp { | 16 namespace pp { |
| 16 namespace proxy { | 17 namespace proxy { |
| 17 | 18 |
| 18 namespace { | 19 namespace { |
| 19 | 20 |
| 20 void HandleMessage(PP_Instance instance, PP_Var message_data) { | 21 void HandleMessage(PP_Instance instance, PP_Var message_data) { |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 IPC_MESSAGE_UNHANDLED(handled = false) | 72 IPC_MESSAGE_UNHANDLED(handled = false) |
| 72 IPC_END_MESSAGE_MAP() | 73 IPC_END_MESSAGE_MAP() |
| 73 return handled; | 74 return handled; |
| 74 } | 75 } |
| 75 | 76 |
| 76 void PPP_Messaging_Proxy::OnMsgHandleMessage( | 77 void PPP_Messaging_Proxy::OnMsgHandleMessage( |
| 77 PP_Instance instance, SerializedVarReceiveInput message_data) { | 78 PP_Instance instance, SerializedVarReceiveInput message_data) { |
| 78 PP_Var received_var(message_data.Get(dispatcher())); | 79 PP_Var received_var(message_data.Get(dispatcher())); |
| 79 // SerializedVarReceiveInput will decrement the reference count, but we want | 80 // SerializedVarReceiveInput will decrement the reference count, but we want |
| 80 // to give the recipient a reference. | 81 // to give the recipient a reference. |
| 81 PluginVarTracker::GetInstance()->AddRef(received_var); | 82 PluginResourceTracker::GetInstance()->var_tracker().AddRefVar(received_var); |
| 82 ppp_messaging_target()->HandleMessage(instance, received_var); | 83 ppp_messaging_target()->HandleMessage(instance, received_var); |
| 83 } | 84 } |
| 84 | 85 |
| 85 } // namespace proxy | 86 } // namespace proxy |
| 86 } // namespace pp | 87 } // namespace pp |
| OLD | NEW |