Index: ppapi/proxy/ppb_url_response_info_proxy.cc |
=================================================================== |
--- ppapi/proxy/ppb_url_response_info_proxy.cc (revision 72517) |
+++ ppapi/proxy/ppb_url_response_info_proxy.cc (working copy) |
@@ -15,7 +15,9 @@ |
class URLResponseInfo : public PluginResource { |
public: |
- URLResponseInfo(PP_Instance instance) : PluginResource(instance) {} |
+ URLResponseInfo(PP_Instance instance, SerializedResource resource) |
+ : PluginResource(instance, resource) { |
+ } |
virtual ~URLResponseInfo() {} |
// Resource overrides. |
@@ -43,19 +45,19 @@ |
ReceiveSerializedVarReturnValue result; |
dispatcher->Send(new PpapiHostMsg_PPBURLResponseInfo_GetProperty( |
- INTERFACE_ID_PPB_URL_RESPONSE_INFO, response, property, &result)); |
+ INTERFACE_ID_PPB_URL_RESPONSE_INFO, object->host_resource(), property, |
+ &result)); |
return result.Return(dispatcher); |
} |
PP_Resource GetBodyAsFileRef(PP_Resource response) { |
- PP_Resource result = 0; |
/* |
dispatcher->Send(new PpapiHostMsg_PPBURLResponseInfo_GetBodyAsFileRef( |
INTERFACE_ID_PPB_URL_RESPONSE_INFO, response, &result)); |
// TODO(brettw) when we have FileRef proxied, make an object from that |
// ref so we can track it properly and then uncomment this. |
*/ |
- return result; |
+ return 0; |
} |
const PPB_URLResponseInfo ppb_urlresponseinfo = { |
@@ -76,12 +78,11 @@ |
} |
// static |
-void PPB_URLResponseInfo_Proxy::TrackPluginResource( |
+PP_Resource PPB_URLResponseInfo_Proxy::CreateResponseForResource( |
PP_Instance instance, |
- PP_Resource response_resource) { |
- linked_ptr<URLResponseInfo> object(new URLResponseInfo(instance)); |
- PluginResourceTracker::GetInstance()->AddResource( |
- response_resource, object); |
+ SerializedResource resource) { |
+ linked_ptr<URLResponseInfo> object(new URLResponseInfo(instance, resource)); |
+ return PluginResourceTracker::GetInstance()->AddResource(object); |
} |
const void* PPB_URLResponseInfo_Proxy::GetSourceInterface() const { |
@@ -106,17 +107,19 @@ |
} |
void PPB_URLResponseInfo_Proxy::OnMsgGetProperty( |
- PP_Resource response, |
+ SerializedResource response, |
int32_t property, |
SerializedVarReturnValue result) { |
result.Return(dispatcher(), ppb_url_response_info_target()->GetProperty( |
- response, static_cast<PP_URLResponseProperty>(property))); |
+ response.host_resource(), static_cast<PP_URLResponseProperty>(property))); |
} |
void PPB_URLResponseInfo_Proxy::OnMsgGetBodyAsFileRef( |
- PP_Resource response, |
- PP_Resource* file_ref_result) { |
- *file_ref_result = ppb_url_response_info_target()->GetBodyAsFileRef(response); |
+ SerializedResource response, |
+ SerializedResource* file_ref_result) { |
+ file_ref_result->set_host_resource( |
+ ppb_url_response_info_target()->GetBodyAsFileRef( |
+ response.host_resource())); |
} |
} // namespace proxy |