summaryrefslogtreecommitdiffstats
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
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
-rw-r--r--ppapi/proxy/ppb_url_loader_proxy.cc10
-rw-r--r--ppapi/thunk/ppb_url_loader_api.h5
-rw-r--r--webkit/plugins/ppapi/ppb_url_loader_impl.cc4
-rw-r--r--webkit/plugins/ppapi/ppb_url_loader_impl.h6
4 files changed, 19 insertions, 6 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;
diff --git a/webkit/plugins/ppapi/ppb_url_loader_impl.cc b/webkit/plugins/ppapi/ppb_url_loader_impl.cc
index a1d4b37..2884e8f 100644
--- a/webkit/plugins/ppapi/ppb_url_loader_impl.cc
+++ b/webkit/plugins/ppapi/ppb_url_loader_impl.cc
@@ -106,11 +106,12 @@ int32_t PPB_URLLoader_Impl::Open(PP_Resource request_id,
" else the request will be null.)");
return PP_ERROR_BADARGUMENT;
}
- return Open(enter_request.object()->GetData(), callback);
+ return Open(enter_request.object()->GetData(), 0, callback);
}
int32_t PPB_URLLoader_Impl::Open(
const ::ppapi::URLRequestInfoData& request_data,
+ int requestor_pid,
scoped_refptr<TrackedCallback> callback) {
// Main document loads are already open, so don't allow people to open them
// again.
@@ -143,6 +144,7 @@ int32_t PPB_URLLoader_Impl::Open(
WebURLRequest web_request;
if (!CreateWebURLRequest(&filled_in_request_data, frame, &web_request))
return PP_ERROR_FAILED;
+ web_request.setRequestorProcessID(requestor_pid);
// Save a copy of the request info so the plugin can continue to use and
// change it while we're doing the request without affecting us. We must do
diff --git a/webkit/plugins/ppapi/ppb_url_loader_impl.h b/webkit/plugins/ppapi/ppb_url_loader_impl.h
index 7dbaa34..20f4f19 100644
--- a/webkit/plugins/ppapi/ppb_url_loader_impl.h
+++ b/webkit/plugins/ppapi/ppb_url_loader_impl.h
@@ -42,8 +42,10 @@ class PPB_URLLoader_Impl : public ::ppapi::Resource,
virtual int32_t Open(
PP_Resource request_id,
scoped_refptr< ::ppapi::TrackedCallback> callback) OVERRIDE;
- int32_t Open(const ::ppapi::URLRequestInfoData& data,
- scoped_refptr< ::ppapi::TrackedCallback> callback) OVERRIDE;
+ virtual int32_t Open(
+ const ::ppapi::URLRequestInfoData& data,
+ int requestor_pid,
+ scoped_refptr< ::ppapi::TrackedCallback> callback) OVERRIDE;
virtual int32_t FollowRedirect(
scoped_refptr< ::ppapi::TrackedCallback> callback) OVERRIDE;
virtual PP_Bool GetUploadProgress(int64_t* bytes_sent,