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

Side by Side Diff: chrome/browser/net/url_request_tracking.h

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: Set origin PID consistently, and only set it for plugin requests. Created 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_NET_URL_REQUEST_TRACKING_H_ 5 #ifndef CHROME_BROWSER_NET_URL_REQUEST_TRACKING_H_
6 #define CHROME_BROWSER_NET_URL_REQUEST_TRACKING_H_ 6 #define CHROME_BROWSER_NET_URL_REQUEST_TRACKING_H_
7 #pragma once 7 #pragma once
8 8
9 namespace net { 9 namespace net {
10 class URLRequest; 10 class URLRequest;
11 } // namespace net 11 } // namespace net
12 12
13 namespace chrome_browser_net { 13 namespace chrome_browser_net {
14 14
15 // Sets the given ID on the given request for later retrieval. This information 15 // Sets the given ID on the given request for later retrieval. This information
16 // duplicates a field in the ResourceDispatcherHost's user data, but is also 16 // duplicates a field in the ResourceDispatcherHost's user data, but is also
17 // set for non-ResourceDispatcher-related requests. Having this one global 17 // set for non-ResourceDispatcher-related requests. Having this one global
18 // place allows us to do more general things, such as assigning traffic for the 18 // place allows us to do more general things, such as assigning traffic for the
19 // network view in the task manager. 19 // network view in the task manager.
20 // 20 //
21 // If you make a request on behalf of a child process, please call this 21 // If you make a request on behalf of a child process, please call this
22 // function. The default value will be -1 which will be interprepreted as 22 // function to store its process ID (NOT its browser-assigned unique ID!).
23 // originating from the browser itself. 23 // The default value will be 0 which should be
24 // 24 // interpreted as originating from the Browser process.
jam 2011/02/03 22:58:07 I thought it's not also set for renderer processes
25 // The ID is the child process' unique ID (not a PID) of the process originating 25 void SetOriginProcessIDForRequest(int id, net::URLRequest* request);
jam 2011/02/03 22:58:07 nit: can we use PID instead of ProcessID to furthe
26 // the request. This is normally the renderer corresponding to the load. If a
27 // plugin process does a request through a renderer process this will be the
28 // plugin (the originator of the request).
29 void SetOriginProcessUniqueIDForRequest(int id, net::URLRequest* request);
30 26
31 // Returns the child process' unique ID that has been previously set by 27 // Returns the process ID of the request's originator, previously stored with
32 // SetOriginProcessUniqueIDForRequest. If no ID has been set, the return 28 // SetOriginProcessIDForRequest, or 0 if no process ID
33 // value is -1. We use this to identify requests made by the browser process. 29 // has been set.
34 int GetOriginProcessUniqueIDForRequest(const net::URLRequest* request); 30 int GetOriginProcessIDForRequest(const net::URLRequest* request);
35 31
36 } // namespace chrome_browser_net 32 } // namespace chrome_browser_net
37 33
38 #endif // CHROME_BROWSER_NET_URL_REQUEST_TRACKING_H_ 34 #endif // CHROME_BROWSER_NET_URL_REQUEST_TRACKING_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/net/url_request_tracking.cc » ('j') | chrome/browser/renderer_host/resource_dispatcher_host.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698