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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 PP_Bool result = PP_FALSE; | 59 PP_Bool result = PP_FALSE; |
60 HostDispatcher::GetForInstance(instance)->Send( | 60 HostDispatcher::GetForInstance(instance)->Send( |
61 new PpapiMsg_PPPInstance_HandleInputEvent(INTERFACE_ID_PPP_INSTANCE, | 61 new PpapiMsg_PPPInstance_HandleInputEvent(INTERFACE_ID_PPP_INSTANCE, |
62 instance, *event, &result)); | 62 instance, *event, &result)); |
63 return result; | 63 return result; |
64 } | 64 } |
65 | 65 |
66 PP_Bool HandleDocumentLoad(PP_Instance instance, | 66 PP_Bool HandleDocumentLoad(PP_Instance instance, |
67 PP_Resource url_loader) { | 67 PP_Resource url_loader) { |
68 PP_Bool result = PP_FALSE; | 68 PP_Bool result = PP_FALSE; |
| 69 SerializedResource serialized_loader; |
| 70 serialized_loader.set_host_resource(url_loader); |
69 HostDispatcher::GetForInstance(instance)->Send( | 71 HostDispatcher::GetForInstance(instance)->Send( |
70 new PpapiMsg_PPPInstance_HandleDocumentLoad(INTERFACE_ID_PPP_INSTANCE, | 72 new PpapiMsg_PPPInstance_HandleDocumentLoad(INTERFACE_ID_PPP_INSTANCE, |
71 instance, url_loader, | 73 instance, serialized_loader, |
72 &result)); | 74 &result)); |
73 return result; | 75 return result; |
74 } | 76 } |
75 | 77 |
76 PP_Var GetInstanceObject(PP_Instance instance) { | 78 PP_Var GetInstanceObject(PP_Instance instance) { |
77 Dispatcher* dispatcher = HostDispatcher::GetForInstance(instance); | 79 Dispatcher* dispatcher = HostDispatcher::GetForInstance(instance); |
78 ReceiveSerializedVarReturnValue result; | 80 ReceiveSerializedVarReturnValue result; |
79 dispatcher->Send(new PpapiMsg_PPPInstance_GetInstanceObject( | 81 dispatcher->Send(new PpapiMsg_PPPInstance_GetInstanceObject( |
80 INTERFACE_ID_PPP_INSTANCE, instance, &result)); | 82 INTERFACE_ID_PPP_INSTANCE, instance, &result)); |
81 return result.Return(dispatcher); | 83 return result.Return(dispatcher); |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 ppp_instance_target()->DidChangeFocus(instance, has_focus); | 175 ppp_instance_target()->DidChangeFocus(instance, has_focus); |
174 } | 176 } |
175 | 177 |
176 void PPP_Instance_Proxy::OnMsgHandleInputEvent(PP_Instance instance, | 178 void PPP_Instance_Proxy::OnMsgHandleInputEvent(PP_Instance instance, |
177 const PP_InputEvent& event, | 179 const PP_InputEvent& event, |
178 PP_Bool* result) { | 180 PP_Bool* result) { |
179 *result = ppp_instance_target()->HandleInputEvent(instance, &event); | 181 *result = ppp_instance_target()->HandleInputEvent(instance, &event); |
180 } | 182 } |
181 | 183 |
182 void PPP_Instance_Proxy::OnMsgHandleDocumentLoad(PP_Instance instance, | 184 void PPP_Instance_Proxy::OnMsgHandleDocumentLoad(PP_Instance instance, |
183 PP_Resource url_loader, | 185 SerializedResource url_loader, |
184 PP_Bool* result) { | 186 PP_Bool* result) { |
185 PPB_URLLoader_Proxy::TrackPluginResource(instance, url_loader); | 187 PP_Resource plugin_loader = |
| 188 PPB_URLLoader_Proxy::TrackPluginResource(instance, url_loader); |
186 *result = ppp_instance_target()->HandleDocumentLoad( | 189 *result = ppp_instance_target()->HandleDocumentLoad( |
187 instance, url_loader); | 190 instance, plugin_loader); |
188 } | 191 } |
189 | 192 |
190 void PPP_Instance_Proxy::OnMsgGetInstanceObject( | 193 void PPP_Instance_Proxy::OnMsgGetInstanceObject( |
191 PP_Instance instance, | 194 PP_Instance instance, |
192 SerializedVarReturnValue result) { | 195 SerializedVarReturnValue result) { |
193 result.Return(dispatcher(), | 196 result.Return(dispatcher(), |
194 ppp_instance_target()->GetInstanceObject(instance)); | 197 ppp_instance_target()->GetInstanceObject(instance)); |
195 } | 198 } |
196 | 199 |
197 } // namespace proxy | 200 } // namespace proxy |
198 } // namespace pp | 201 } // namespace pp |
OLD | NEW |