| 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_RENDERER_HOST_GLOBAL_REQUEST_ID_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_HOST_GLOBAL_REQUEST_ID_H_ |
| 6 #define CHROME_BROWSER_RENDERER_HOST_GLOBAL_REQUEST_ID_H_ | 6 #define CHROME_BROWSER_RENDERER_HOST_GLOBAL_REQUEST_ID_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 // Uniquely identifies a URLRequest. | 9 // Uniquely identifies a net::URLRequest. |
| 10 struct GlobalRequestID { | 10 struct GlobalRequestID { |
| 11 GlobalRequestID() : child_id(-1), request_id(-1) { | 11 GlobalRequestID() : child_id(-1), request_id(-1) { |
| 12 } | 12 } |
| 13 | 13 |
| 14 GlobalRequestID(int child_id, int request_id) | 14 GlobalRequestID(int child_id, int request_id) |
| 15 : child_id(child_id), | 15 : child_id(child_id), |
| 16 request_id(request_id) { | 16 request_id(request_id) { |
| 17 } | 17 } |
| 18 | 18 |
| 19 // The unique ID of the child process (different from OS's PID). | 19 // The unique ID of the child process (different from OS's PID). |
| 20 int child_id; | 20 int child_id; |
| 21 | 21 |
| 22 // The request ID (unique for the child). | 22 // The request ID (unique for the child). |
| 23 int request_id; | 23 int request_id; |
| 24 | 24 |
| 25 bool operator<(const GlobalRequestID& other) const { | 25 bool operator<(const GlobalRequestID& other) const { |
| 26 if (child_id == other.child_id) | 26 if (child_id == other.child_id) |
| 27 return request_id < other.request_id; | 27 return request_id < other.request_id; |
| 28 return child_id < other.child_id; | 28 return child_id < other.child_id; |
| 29 } | 29 } |
| 30 }; | 30 }; |
| 31 | 31 |
| 32 #endif // CHROME_BROWSER_RENDERER_HOST_GLOBAL_REQUEST_ID_H_ | 32 #endif // CHROME_BROWSER_RENDERER_HOST_GLOBAL_REQUEST_ID_H_ |
| OLD | NEW |