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

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

Issue 6341006: Revert 72095 - Attribute orphaned or anonymous network usage to the Browser r... (Closed) Base URL: svn://svn.chromium.org/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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/task_manager/task_manager.cc
===================================================================
--- chrome/browser/task_manager/task_manager.cc (revision 72095)
+++ chrome/browser/task_manager/task_manager.cc (working copy)
@@ -845,16 +845,10 @@
if (resource)
break;
}
-
if (resource == NULL) {
- // We can't match a resource to the notification. That might mean the
- // 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.
- CHECK(param.origin_child_id != base::GetCurrentProcId());
- param.origin_child_id = base::GetCurrentProcId();
- param.render_process_host_child_id = param.routing_id = -1;
- BytesRead(param);
+ // We may not have that resource anymore (example: close a tab while a
+ // a network resource is being retrieved), in which case we just ignore the
+ // notification.
return;
}
@@ -893,15 +887,18 @@
void TaskManagerModel::OnBytesRead(net::URLRequestJob* job, const char* buf,
int byte_count) {
- // Only net::URLRequestJob instances created by the ResourceDispatcherHost
- // have a render view associated. All other jobs will have -1 returned for
- // the render process child and routing ids - the jobs may still match a
- // resource based on their origin id, otherwise BytesRead() will attribute
- // the activity to the Browser resource.
int render_process_host_child_id = -1, routing_id = -1;
- ResourceDispatcherHost::RenderViewForRequest(job->request(),
+ if (!ResourceDispatcherHost::RenderViewForRequest(job->request(),
&render_process_host_child_id,
- &routing_id);
+ &routing_id)) {
+ // Only net::URLRequestJob instances created by the ResourceDispatcherHost
+ // have a render view associated. Jobs from components such as the
+ // SearchProvider for autocomplete, have no associated view, so we can't
+ // correctly attribute the bandwidth they consume.
+ // TODO(wez): All jobs' resources should ideally be accountable, even if
+ // only by contributing to the Browser process' stats.
+ return;
+ }
// This happens in the IO thread, post it to the UI thread.
int origin_child_id =
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698