| Index: chrome/browser/task_manager/task_manager.cc
|
| diff --git a/chrome/browser/task_manager/task_manager.cc b/chrome/browser/task_manager/task_manager.cc
|
| index 4c3634fd48808518d9c50014d50901167bb69d9a..1f113b7537e3125697cf8d6b0c1fe3cc391e002a 100644
|
| --- a/chrome/browser/task_manager/task_manager.cc
|
| +++ b/chrome/browser/task_manager/task_manager.cc
|
| @@ -839,7 +839,7 @@ void TaskManagerModel::BytesRead(BytesReadParam param) {
|
| TaskManager::Resource* resource = NULL;
|
| for (ResourceProviderList::iterator iter = providers_.begin();
|
| iter != providers_.end(); ++iter) {
|
| - resource = (*iter)->GetResource(param.origin_child_id,
|
| + resource = (*iter)->GetResource(param.origin_pid,
|
| param.render_process_host_child_id,
|
| param.routing_id);
|
| if (resource)
|
| @@ -851,9 +851,8 @@ void TaskManagerModel::BytesRead(BytesReadParam param) {
|
| // tab that started a download was closed, or the request may have had
|
| // no originating resource associated with it in the first place.
|
| // We attribute orphaned/unaccounted activity to the Browser process.
|
| - int browser_pid = base::GetCurrentProcId();
|
| - CHECK(param.origin_child_id != browser_pid);
|
| - param.origin_child_id = browser_pid;
|
| + CHECK(param.origin_pid || (param.render_process_host_child_id != -1));
|
| + param.origin_pid = 0;
|
| param.render_process_host_child_id = param.routing_id = -1;
|
| BytesRead(param);
|
| return;
|
| @@ -904,15 +903,18 @@ void TaskManagerModel::OnBytesRead(net::URLRequestJob* job, const char* buf,
|
| &render_process_host_child_id,
|
| &routing_id);
|
|
|
| + // Get the origin PID of the request's originator. This will only be set for
|
| + // plugins - for renderer or browser initiated requests it will be zero.
|
| + int origin_pid =
|
| + chrome_browser_net::GetOriginPIDForRequest(job->request());
|
| +
|
| // This happens in the IO thread, post it to the UI thread.
|
| - int origin_child_id =
|
| - chrome_browser_net::GetOriginProcessUniqueIDForRequest(job->request());
|
| BrowserThread::PostTask(
|
| BrowserThread::UI, FROM_HERE,
|
| NewRunnableMethod(
|
| this,
|
| &TaskManagerModel::BytesRead,
|
| - BytesReadParam(origin_child_id,
|
| + BytesReadParam(origin_pid,
|
| render_process_host_child_id,
|
| routing_id, byte_count)));
|
| }
|
|
|