Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2187)

Unified Diff: ppapi/proxy/ppb_url_response_info_proxy.cc

Issue 6334016: Refactor PPAPI proxy resource handling to maintain which host they came from,... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/proxy/ppb_url_response_info_proxy.h ('k') | ppapi/proxy/ppp_instance_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppb_url_response_info_proxy.cc
===================================================================
--- ppapi/proxy/ppb_url_response_info_proxy.cc (revision 72840)
+++ ppapi/proxy/ppb_url_response_info_proxy.cc (working copy)
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -15,7 +15,9 @@
class URLResponseInfo : public PluginResource {
public:
- URLResponseInfo(PP_Instance instance) : PluginResource(instance) {}
+ URLResponseInfo(const HostResource& resource)
+ : PluginResource(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,10 @@
}
// static
-void PPB_URLResponseInfo_Proxy::TrackPluginResource(
- PP_Instance instance,
- PP_Resource response_resource) {
- linked_ptr<URLResponseInfo> object(new URLResponseInfo(instance));
- PluginResourceTracker::GetInstance()->AddResource(
- response_resource, object);
+PP_Resource PPB_URLResponseInfo_Proxy::CreateResponseForResource(
+ const HostResource& resource) {
+ linked_ptr<URLResponseInfo> object(new URLResponseInfo(resource));
+ return PluginResourceTracker::GetInstance()->AddResource(object);
}
const void* PPB_URLResponseInfo_Proxy::GetSourceInterface() const {
@@ -106,17 +106,20 @@
}
void PPB_URLResponseInfo_Proxy::OnMsgGetProperty(
- PP_Resource response,
+ HostResource 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);
+ HostResource response,
+ HostResource* file_ref_result) {
+ file_ref_result->SetHostResource(
+ response.instance(),
+ ppb_url_response_info_target()->GetBodyAsFileRef(
+ response.host_resource()));
}
} // namespace proxy
« no previous file with comments | « ppapi/proxy/ppb_url_response_info_proxy.h ('k') | ppapi/proxy/ppp_instance_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698