| 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/ppp_instance_proxy.h" | 5 #include "ppapi/proxy/ppp_instance_proxy.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ppapi/c/pp_var.h" | 9 #include "ppapi/c/pp_var.h" |
| 10 #include "ppapi/c/ppp_instance.h" | 10 #include "ppapi/c/ppp_instance.h" |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 } | 102 } |
| 103 | 103 |
| 104 const void* PPP_Instance_Proxy::GetSourceInterface() const { | 104 const void* PPP_Instance_Proxy::GetSourceInterface() const { |
| 105 return &instance_interface; | 105 return &instance_interface; |
| 106 } | 106 } |
| 107 | 107 |
| 108 InterfaceID PPP_Instance_Proxy::GetInterfaceId() const { | 108 InterfaceID PPP_Instance_Proxy::GetInterfaceId() const { |
| 109 return INTERFACE_ID_PPP_INSTANCE; | 109 return INTERFACE_ID_PPP_INSTANCE; |
| 110 } | 110 } |
| 111 | 111 |
| 112 void PPP_Instance_Proxy::OnMessageReceived(const IPC::Message& msg) { | 112 bool PPP_Instance_Proxy::OnMessageReceived(const IPC::Message& msg) { |
| 113 bool handled = true; |
| 113 IPC_BEGIN_MESSAGE_MAP(PPP_Instance_Proxy, msg) | 114 IPC_BEGIN_MESSAGE_MAP(PPP_Instance_Proxy, msg) |
| 114 IPC_MESSAGE_HANDLER(PpapiMsg_PPPInstance_DidCreate, | 115 IPC_MESSAGE_HANDLER(PpapiMsg_PPPInstance_DidCreate, |
| 115 OnMsgDidCreate) | 116 OnMsgDidCreate) |
| 116 IPC_MESSAGE_HANDLER(PpapiMsg_PPPInstance_DidDestroy, | 117 IPC_MESSAGE_HANDLER(PpapiMsg_PPPInstance_DidDestroy, |
| 117 OnMsgDidDestroy) | 118 OnMsgDidDestroy) |
| 118 IPC_MESSAGE_HANDLER(PpapiMsg_PPPInstance_DidChangeView, | 119 IPC_MESSAGE_HANDLER(PpapiMsg_PPPInstance_DidChangeView, |
| 119 OnMsgDidChangeView) | 120 OnMsgDidChangeView) |
| 120 IPC_MESSAGE_HANDLER(PpapiMsg_PPPInstance_DidChangeFocus, | 121 IPC_MESSAGE_HANDLER(PpapiMsg_PPPInstance_DidChangeFocus, |
| 121 OnMsgDidChangeFocus) | 122 OnMsgDidChangeFocus) |
| 122 IPC_MESSAGE_HANDLER(PpapiMsg_PPPInstance_HandleInputEvent, | 123 IPC_MESSAGE_HANDLER(PpapiMsg_PPPInstance_HandleInputEvent, |
| 123 OnMsgHandleInputEvent) | 124 OnMsgHandleInputEvent) |
| 124 IPC_MESSAGE_HANDLER(PpapiMsg_PPPInstance_HandleDocumentLoad, | 125 IPC_MESSAGE_HANDLER(PpapiMsg_PPPInstance_HandleDocumentLoad, |
| 125 OnMsgHandleDocumentLoad) | 126 OnMsgHandleDocumentLoad) |
| 126 IPC_MESSAGE_HANDLER(PpapiMsg_PPPInstance_GetInstanceObject, | 127 IPC_MESSAGE_HANDLER(PpapiMsg_PPPInstance_GetInstanceObject, |
| 127 OnMsgGetInstanceObject) | 128 OnMsgGetInstanceObject) |
| 129 IPC_MESSAGE_UNHANDLED(handled = false) |
| 128 IPC_END_MESSAGE_MAP() | 130 IPC_END_MESSAGE_MAP() |
| 131 return handled; |
| 129 } | 132 } |
| 130 | 133 |
| 131 void PPP_Instance_Proxy::OnMsgDidCreate( | 134 void PPP_Instance_Proxy::OnMsgDidCreate( |
| 132 PP_Instance instance, | 135 PP_Instance instance, |
| 133 const std::vector<std::string>& argn, | 136 const std::vector<std::string>& argn, |
| 134 const std::vector<std::string>& argv, | 137 const std::vector<std::string>& argv, |
| 135 PP_Bool* result) { | 138 PP_Bool* result) { |
| 136 *result = PP_FALSE; | 139 *result = PP_FALSE; |
| 137 if (argn.size() != argv.size()) | 140 if (argn.size() != argv.size()) |
| 138 return; | 141 return; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 | 189 |
| 187 void PPP_Instance_Proxy::OnMsgGetInstanceObject( | 190 void PPP_Instance_Proxy::OnMsgGetInstanceObject( |
| 188 PP_Instance instance, | 191 PP_Instance instance, |
| 189 SerializedVarReturnValue result) { | 192 SerializedVarReturnValue result) { |
| 190 result.Return(dispatcher(), | 193 result.Return(dispatcher(), |
| 191 ppp_instance_target()->GetInstanceObject(instance)); | 194 ppp_instance_target()->GetInstanceObject(instance)); |
| 192 } | 195 } |
| 193 | 196 |
| 194 } // namespace proxy | 197 } // namespace proxy |
| 195 } // namespace pp | 198 } // namespace pp |
| OLD | NEW |