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

Unified Diff: chrome/browser/task_manager/task_manager.cc

Issue 6328010: Fix Task Manager to correctly display network usage of plug-in processes. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Redo patch set for changes to trunk. 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
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)));
}
« no previous file with comments | « chrome/browser/task_manager/task_manager.h ('k') | chrome/browser/task_manager/task_manager_resource_providers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698