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

Issue 6328010: Fix Task Manager to correctly display network usage of plug-in processes. (Closed)

Created:
9 years, 11 months ago by Wez
Modified:
9 years, 7 months ago
Reviewers:
wez1, brettw, jam, awong
CC:
chromium-reviews, darin-cc_chromium.org, brettw-cc_chromium.org, Paweł Hajdan Jr., stuartmorgan+watch_chromium.org, cbentzel+watch_chromium.org, piman+watch_chromium.org
Visibility:
Public.

Description

Fix Task Manager to correctly display network usage of plug-in processes. BUG=chromium-os:2954 TEST=Run Chrome and open Task Manager, then play a video in YouTube and check whether the Network usage is correctly reported against the plug-in. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=73884 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=73915

Patch Set 1 #

Patch Set 2 : Fix the way Task Manager accounts for network usage by plug-ins. #

Total comments: 2

Patch Set 3 : Pass child ID to plugin processes for use when making requests. #

Patch Set 4 : Return plugin child-ID to renderer along with channel info. #

Patch Set 5 : Set origin PID consistently, and only set it for plugin requests. #

Total comments: 6

Patch Set 6 : Fix PID-getter naming and comment text as per review comments. #

Patch Set 7 : Redo patch set for changes to trunk. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+73 lines, -94 lines) Patch
M chrome/browser/net/url_request_tracking.h View 1 2 3 4 5 1 chunk +11 lines, -12 lines 0 comments Download
M chrome/browser/net/url_request_tracking.cc View 1 2 3 4 5 1 chunk +15 lines, -15 lines 0 comments Download
M chrome/browser/renderer_host/resource_dispatcher_host.cc View 1 2 3 4 5 6 4 chunks +6 lines, -8 lines 0 comments Download
M chrome/browser/renderer_host/resource_dispatcher_host_unittest.cc View 1 2 4 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/task_manager/task_manager.h View 1 2 3 4 5 6 1 chunk +6 lines, -7 lines 0 comments Download
M chrome/browser/task_manager/task_manager.cc View 1 2 3 4 5 6 3 chunks +9 lines, -7 lines 0 comments Download
M chrome/browser/task_manager/task_manager_resource_providers.h View 1 2 3 4 5 6 1 chunk +0 lines, -4 lines 0 comments Download
M chrome/browser/task_manager/task_manager_resource_providers.cc View 1 2 3 4 5 6 5 chunks +10 lines, -24 lines 0 comments Download
M chrome/common/child_process_info.h View 1 2 3 4 5 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/common/render_messages_params.h View 1 2 3 4 5 6 1 chunk +3 lines, -4 lines 0 comments Download
M chrome/common/render_messages_params.cc View 1 2 3 4 4 chunks +4 lines, -4 lines 0 comments Download
M chrome/common/resource_dispatcher.cc View 1 3 4 1 chunk +1 line, -1 line 0 comments Download
M webkit/glue/weburlloader_impl.cc View 1 2 3 4 2 chunks +4 lines, -7 lines 0 comments Download

Messages

Total messages: 16 (0 generated)
Wez
One-line fix to let Task Manager correctly display network activity reported by plug-ins.
9 years, 11 months ago (2011-01-26 02:35:16 UTC) #1
awong
http://codereview.chromium.org/6328010/diff/3001/chrome/browser/renderer_host/resource_dispatcher_host.cc File chrome/browser/renderer_host/resource_dispatcher_host.cc (right): http://codereview.chromium.org/6328010/diff/3001/chrome/browser/renderer_host/resource_dispatcher_host.cc#newcode534 chrome/browser/renderer_host/resource_dispatcher_host.cc:534: // render process through which the request was received. ...
9 years, 11 months ago (2011-01-27 21:03:07 UTC) #2
Wez
The second patch-list attempts to fix Task Manager's reporting of network resource (see chromium-os:2954) usage ...
9 years, 11 months ago (2011-01-27 21:06:45 UTC) #3
brettw
Sorry I don't have time to think about this patch more at the moment. Please ...
9 years, 11 months ago (2011-01-27 21:23:51 UTC) #4
Wez
Patch set #4 provides the child-ID of the NPAPI plugin process to the host renderer ...
9 years, 10 months ago (2011-02-01 16:23:09 UTC) #5
jam
hi, sorry I just saw this. I agree the latest patchset is too complicated. Why ...
9 years, 10 months ago (2011-02-01 18:20:30 UTC) #6
wez1
Patch Set 1 just fixes up Task Manager to assume that the supplied origin_child_id is ...
9 years, 10 months ago (2011-02-01 19:27:15 UTC) #7
jam
On 2011/02/01 19:27:15, wez_google.com wrote: > Patch Set 1 just fixes up Task Manager to ...
9 years, 10 months ago (2011-02-01 19:59:10 UTC) #8
Wez
On 1 February 2011 19:59, <jam@chromium.org> wrote: > On 2011/02/01 19:27:15, wez_google.com wrote: > >> ...
9 years, 10 months ago (2011-02-01 20:37:01 UTC) #9
jam
On Tue, Feb 1, 2011 at 12:36 PM, Wez <wez@chromium.org> wrote: > On 1 February ...
9 years, 10 months ago (2011-02-01 23:14:30 UTC) #10
brettw
On Tue, Feb 1, 2011 at 3:14 PM, John Abd-El-Malek <jam@chromium.org> wrote: > > > ...
9 years, 10 months ago (2011-02-01 23:24:13 UTC) #11
Wez
Patch Set 5 implements the following approach: 1. Only set explicit (non-zero) originator ID for ...
9 years, 10 months ago (2011-02-03 17:40:48 UTC) #12
jam
On Thu, Feb 3, 2011 at 9:40 AM, <wez@chromium.org> wrote: > Patch Set 5 implements ...
9 years, 10 months ago (2011-02-03 17:50:38 UTC) #13
jam
http://codereview.chromium.org/6328010/diff/18001/chrome/browser/net/url_request_tracking.h File chrome/browser/net/url_request_tracking.h (right): http://codereview.chromium.org/6328010/diff/18001/chrome/browser/net/url_request_tracking.h#newcode24 chrome/browser/net/url_request_tracking.h:24: // interpreted as originating from the Browser process. I ...
9 years, 10 months ago (2011-02-03 22:58:07 UTC) #14
Wez
On 3 February 2011 22:58, <jam@chromium.org> wrote: > > http://codereview.chromium.org/6328010/diff/18001/chrome/browser/net/url_request_tracking.h#newcode24 > chrome/browser/net/url_request_tracking.h:24: // interpreted as ...
9 years, 10 months ago (2011-02-03 23:58:20 UTC) #15
awong
9 years, 10 months ago (2011-02-05 05:18:54 UTC) #16
Landed with minor fix in r73915

On 2011/02/03 23:58:20, Wez wrote:
> On 3 February 2011 22:58, <mailto:jam@chromium.org> wrote:
> 
> >
> >
>
http://codereview.chromium.org/6328010/diff/18001/chrome/browser/net/url_requ...
> > chrome/browser/net/url_request_tracking.h:24: // interpreted as
> > originating from the Browser process.
> > I thought it's not also set for renderer processes?
> >
> 
> You're quite right, that comment refers to the variant where the PID is set
> even for renderer processes.  My mistake.
> 
> 
> >
> >
>
http://codereview.chromium.org/6328010/diff/18001/chrome/browser/net/url_requ...
> > chrome/browser/net/url_request_tracking.h:25: void
> > SetOriginProcessIDForRequest(int id, net::URLRequest* request);
> > nit: can we use PID instead of ProcessID to further hint that it's not
> > the process child id?  i know the naming is confusing unfortunately
> >
> 
> Good idea.  Agreeing a similar abbreviation for child-ID (CID?) would also
> help make comments more readable where code needs to work with both.
> 
> 
> >
> >
> >
>
http://codereview.chromium.org/6328010/diff/18001/chrome/browser/renderer_hos...
> > File chrome/browser/renderer_host/resource_dispatcher_host.cc (left):
> >
> >
> >
>
http://codereview.chromium.org/6328010/diff/18001/chrome/browser/renderer_hos...
> > chrome/browser/renderer_host/resource_dispatcher_host.cc:736:
> > chrome_browser_net::SetOriginProcessUniqueIDForRequest(child_id,
> > request);
> > why take this out?
> >
> 
> The child_id values that BeginDownload() and BeginSaveFile() are supplied
> are actual render process child IDs, not PIDs. We could look them up to
> determine the PID to set, of course, but in this version of the patch PID==0
> already means that where the request came from is identified by the renderer
> and view IDs.
> 
> 
> >
> >
>
http://codereview.chromium.org/6328010/diff/18001/chrome/browser/renderer_hos...
> > chrome/browser/renderer_host/resource_dispatcher_host.cc:784:
> > chrome_browser_net::SetOriginProcessUniqueIDForRequest(child_id,
> > request);
> > ditto
> >
> 
> "
> 
> 
> >
> >
> >
>
http://codereview.chromium.org/6328010/diff/18001/chrome/browser/task_manager...
> > File chrome/browser/task_manager/task_manager_resource_providers.cc
> > (right):
> >
> >
> >
>
http://codereview.chromium.org/6328010/diff/18001/chrome/browser/task_manager...
> > chrome/browser/task_manager/task_manager_resource_providers.cc:243: //
> > working on the TabContent's behalf, so ignore it
> > I don't understand this line and below on 453.  what does returning NULL
> > do?  it's always preferable to treat all child processes the same way
> >
> 
> The original code determined the TabContents or BackgroundContents for the
> specified renderer & routing IDs, then checked whether the renderer process
> ID for the returned resource matched the origin PID.  If not then (as I
> understand it) that means that the notification comes from a request made by
> the TabContents or BackgroundContents on behalf of a plugin.  With the
> change to have origin ID zero unless the request was made on behalf of a
> process other than the renderer or browser, it's sufficient just to check
> whether origin_id is non-zero.
> 
> The resource matching does look more involved than it needs to be, though.
> 
> 
> >
> > nit: style guide is to have proper punctuation etc, so period at end.
> >
> 
> Will do - thanks.
> 
> 
> >
> >
> >
>
http://codereview.chromium.org/6328010/diff/18001/chrome/common/child_process...
> > File chrome/common/child_process_info.h (right):
> >
> >
> >
>
http://codereview.chromium.org/6328010/diff/18001/chrome/common/child_process...
> > chrome/common/child_process_info.h:72: int process_id() const { return
> > process_.pid(); }
> > nit: should be pid
> 
> 
> OK. :)
> 
> Wez

Powered by Google App Engine
This is Rietveld 408576698