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

Unified Diff: chrome/browser/renderer_host/resource_dispatcher_host.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: Fix the way Task Manager accounts for network usage by plug-ins. 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 | chrome/browser/task_manager/task_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_host/resource_dispatcher_host.cc
diff --git a/chrome/browser/renderer_host/resource_dispatcher_host.cc b/chrome/browser/renderer_host/resource_dispatcher_host.cc
index 3d9221a3d9799d6a2df56df0967a4a49c02de0bc..aa00c8d196b0da128eb69385bef6c59c180ed1c6 100644
--- a/chrome/browser/renderer_host/resource_dispatcher_host.cc
+++ b/chrome/browser/renderer_host/resource_dispatcher_host.cc
@@ -196,8 +196,8 @@ std::vector<int> GetAllNetErrorCodes() {
}
#if defined(OS_WIN)
-#pragma warning (disable: 4748)
-#pragma optimize( "", off )
+#pragma warning(disable: 4748)
+#pragma optimize("", off)
#endif
// Temporary experiment to help track down http://crbug.com/68766.
@@ -209,8 +209,8 @@ void CheckContextForBug68766(net::URLRequestContext* context) {
}
#if defined(OS_WIN)
-#pragma optimize( "", on )
-#pragma warning (default: 4748)
+#pragma optimize("", on)
+#pragma warning(default: 4748)
#endif
} // namespace
@@ -528,8 +528,22 @@ void ResourceDispatcherHost::BeginRequest(
ApplyExtensionLocalizationFilter(request_data.url, request_data.resource_type,
extra_info);
SetRequestInfo(request, extra_info); // Request takes ownership.
+
+ // Determine and store the child ID of the request originator
+ // If we can't find an originator then we fall back to the ID of the
+ // render process through which the request was received.
awong 2011/01/27 21:03:07 drive-by style nit. Add a newline before the TODO
+ // TODO(wez): This lookup is too expensive - need a FromPID()...
+ int origin_child_id = child_id;
+ for (BrowserChildProcessHost::Iterator i; !i.Done(); ++i) {
brettw 2011/01/27 21:23:51 I don't think this approach is a good idea. It's b
+ base::ProcessHandle process_handle = (*i)->handle();
+ int pid = base::GetProcId(process_handle);
+ if (pid == request_data.origin_pid) {
+ origin_child_id = (*i)->id();
+ break;
+ }
+ }
chrome_browser_net::SetOriginProcessUniqueIDForRequest(
- request_data.origin_child_id, request);
+ origin_child_id, request);
if (request->url().SchemeIs(chrome::kBlobScheme) && context) {
// Hang on to a reference to ensure the blob is not released prior
« no previous file with comments | « no previous file | chrome/browser/task_manager/task_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698