summaryrefslogtreecommitdiffstats
path: root/ppapi
diff options
context:
space:
mode:
authordarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-03 00:11:33 +0000
committerdarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-03 00:11:33 +0000
commitf2621cb2f5a52fde93052efba6880a49f8f291eb (patch)
treedcd88458f385be5534fc987028c3d7533be14dfc /ppapi
parentdc851a4e5e36ccb3fe5445912888c1eb9527be20 (diff)
downloadchromium_src-f2621cb2f5a52fde93052efba6880a49f8f291eb.zip
chromium_src-f2621cb2f5a52fde93052efba6880a49f8f291eb.tar.gz
chromium_src-f2621cb2f5a52fde93052efba6880a49f8f291eb.tar.bz2
Plumb RequestorProcessID field through various layers to enable the Network
column of Task Manager to show network usage by Pepper plugins. R=brettw@chromium.org Review URL: https://chromiumcodereview.appspot.com/11026007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@159805 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r--ppapi/proxy/ppb_url_loader_proxy.cc10
-rw-r--r--ppapi/thunk/ppb_url_loader_api.h5
2 files changed, 12 insertions, 3 deletions
diff --git a/ppapi/proxy/ppb_url_loader_proxy.cc b/ppapi/proxy/ppb_url_loader_proxy.cc
index 0521721..5c2439e 100644
--- a/ppapi/proxy/ppb_url_loader_proxy.cc
+++ b/ppapi/proxy/ppb_url_loader_proxy.cc
@@ -94,6 +94,7 @@ class URLLoader : public Resource, public PPB_URLLoader_API {
virtual int32_t Open(PP_Resource request_id,
scoped_refptr<TrackedCallback> callback) OVERRIDE;
virtual int32_t Open(const URLRequestInfoData& data,
+ int requestor_pid,
scoped_refptr<TrackedCallback> callback) OVERRIDE;
virtual int32_t FollowRedirect(
scoped_refptr<TrackedCallback> callback) OVERRIDE;
@@ -192,11 +193,14 @@ int32_t URLLoader::Open(PP_Resource request_id,
" PP_URLREQUESTPROPERTY_ALLOWCROSSORIGINREQUESTS.");
return PP_ERROR_BADRESOURCE;
}
- return Open(enter.object()->GetData(), callback);
+ return Open(enter.object()->GetData(), 0, callback);
}
int32_t URLLoader::Open(const URLRequestInfoData& data,
+ int requestor_pid,
scoped_refptr<TrackedCallback> callback) {
+ DCHECK_EQ(0, requestor_pid); // Used in-process only.
+
if (TrackedCallback::IsPending(current_callback_))
return PP_ERROR_INPROGRESS;
@@ -459,9 +463,11 @@ void PPB_URLLoader_Proxy::OnMsgCreate(PP_Instance instance,
void PPB_URLLoader_Proxy::OnMsgOpen(const HostResource& loader,
const URLRequestInfoData& data) {
+ int peer_pid = dispatcher()->channel()->peer_pid();
+
EnterHostFromHostResourceForceCallback<PPB_URLLoader_API> enter(
loader, callback_factory_, &PPB_URLLoader_Proxy::OnCallback, loader);
- enter.SetResult(enter.object()->Open(data, enter.callback()));
+ enter.SetResult(enter.object()->Open(data, peer_pid, enter.callback()));
// TODO(brettw) bug 73236 register for the status callbacks.
}
diff --git a/ppapi/thunk/ppb_url_loader_api.h b/ppapi/thunk/ppb_url_loader_api.h
index f9628bb5..ddcd20e 100644
--- a/ppapi/thunk/ppb_url_loader_api.h
+++ b/ppapi/thunk/ppb_url_loader_api.h
@@ -24,8 +24,11 @@ class PPB_URLLoader_API {
virtual int32_t Open(PP_Resource request_id,
scoped_refptr<TrackedCallback> callback) = 0;
- // Internal open given a URLRequestInfoData.
+ // Internal open given a URLRequestInfoData and requestor_pid, which
+ // indicates the process that requested and will consume the data.
+ // Pass 0 for requestor_pid to indicate the current process.
virtual int32_t Open(const URLRequestInfoData& data,
+ int requestor_pid,
scoped_refptr<TrackedCallback> callback) = 0;
virtual int32_t FollowRedirect(scoped_refptr<TrackedCallback> callback) = 0;