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

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

Issue 9580002: Add ResourceRequestInfo. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 10 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
===================================================================
--- chrome/browser/task_manager/task_manager.cc (revision 124423)
+++ chrome/browser/task_manager/task_manager.cc (working copy)
@@ -29,11 +29,10 @@
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
#include "content/browser/renderer_host/render_view_host.h"
-#include "content/browser/renderer_host/resource_dispatcher_host.h"
-#include "content/browser/renderer_host/resource_dispatcher_host_request_info.h"
#include "content/public/browser/browser_child_process_host.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_view_host_delegate.h"
+#include "content/public/browser/resource_request_info.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/result_codes.h"
#include "grit/chromium_strings.h"
@@ -48,6 +47,7 @@
using content::BrowserThread;
using content::OpenURLParams;
using content::Referrer;
+using content::ResourceRequestInfo;
namespace {
@@ -971,20 +971,20 @@
void TaskManagerModel::NotifyBytesRead(const net::URLRequest& request,
int byte_count) {
// Only net::URLRequestJob instances created by the ResourceDispatcherHost
+ // have an associated ResourceRequestInfo.
+ const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(&request);
+
// 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(&request,
- &render_process_host_child_id,
- &routing_id);
+ if (info)
+ info->GetAssociatedRenderView(&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 = 0;
- const ResourceDispatcherHostRequestInfo* info =
- ResourceDispatcherHost::InfoForRequest(&request);
if (info)
origin_pid = info->origin_pid();

Powered by Google App Engine
This is Rietveld 408576698