Chromium Code Reviews| OLD | NEW |
|---|---|
| 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_ |
| OLD | NEW |