OLD | NEW |
1 // Copyright (c) 2009 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 class URLRequest; | 10 class URLRequest; |
| 11 } // namespace net |
10 | 12 |
11 namespace chrome_browser_net { | 13 namespace chrome_browser_net { |
12 | 14 |
13 // 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 |
14 // 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 |
15 // set for non-ResourceDispatcher-related requests. Having this one global | 17 // set for non-ResourceDispatcher-related requests. Having this one global |
16 // 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 |
17 // network view in the task manager. | 19 // network view in the task manager. |
18 // | 20 // |
19 // 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 |
20 // function. The default value will be -1 which will be interprepreted as | 22 // function. The default value will be -1 which will be interprepreted as |
21 // originating from the browser itself. | 23 // originating from the browser itself. |
22 // | 24 // |
23 // The ID is the child process' unique ID (not a PID) of the process originating | 25 // The ID is the child process' unique ID (not a PID) of the process originating |
24 // the request. This is normally the renderer corresponding to the load. If a | 26 // the request. This is normally the renderer corresponding to the load. If a |
25 // plugin process does a request through a renderer process this will be the | 27 // plugin process does a request through a renderer process this will be the |
26 // plugin (the originator of the request). | 28 // plugin (the originator of the request). |
27 void SetOriginProcessUniqueIDForRequest(int id, URLRequest* request); | 29 void SetOriginProcessUniqueIDForRequest(int id, net::URLRequest* request); |
28 | 30 |
29 // Returns the child process' unique ID that has been previously set by | 31 // Returns the child process' unique ID that has been previously set by |
30 // SetOriginProcessUniqueIDForRequest. If no ID has been set, the return | 32 // SetOriginProcessUniqueIDForRequest. If no ID has been set, the return |
31 // value is -1. We use this to identify requests made by the browser process. | 33 // value is -1. We use this to identify requests made by the browser process. |
32 int GetOriginProcessUniqueIDForRequest(const URLRequest* request); | 34 int GetOriginProcessUniqueIDForRequest(const net::URLRequest* request); |
33 | 35 |
34 } // namespace chrome_browser_net | 36 } // namespace chrome_browser_net |
35 | 37 |
36 #endif // CHROME_BROWSER_NET_URL_REQUEST_TRACKING_H_ | 38 #endif // CHROME_BROWSER_NET_URL_REQUEST_TRACKING_H_ |
OLD | NEW |