OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_BROWSER_LOADER_GLOBAL_ROUTING_ID_H_ | 5 #ifndef CONTENT_BROWSER_LOADER_GLOBAL_ROUTING_ID_H_ |
6 #define CONTENT_BROWSER_LOADER_GLOBAL_ROUTING_ID_H_ | 6 #define CONTENT_BROWSER_LOADER_GLOBAL_ROUTING_ID_H_ |
7 | 7 |
8 #include <tuple> | 8 #include <tuple> |
9 | 9 |
10 namespace content { | 10 namespace content { |
(...skipping 20 matching lines...) Expand all Loading... | |
31 } | 31 } |
32 bool operator==(const GlobalRoutingID& other) const { | 32 bool operator==(const GlobalRoutingID& other) const { |
33 return child_id == other.child_id && | 33 return child_id == other.child_id && |
34 route_id == other.route_id; | 34 route_id == other.route_id; |
35 } | 35 } |
36 bool operator!=(const GlobalRoutingID& other) const { | 36 bool operator!=(const GlobalRoutingID& other) const { |
37 return !(*this == other); | 37 return !(*this == other); |
38 } | 38 } |
39 }; | 39 }; |
40 | 40 |
41 // Same as GlobalRoutingID except the route_id must be a render frame routing | |
42 // id. | |
43 struct GlobalFrameRoutingId { | |
44 GlobalFrameRoutingId() : child_id(-1), route_id(-1) { | |
nasko
2016/01/16 00:15:58
route_id should be MSG_ROUTING_NONE
Charlie Harrison
2016/01/21 18:52:55
Done.
| |
45 } | |
46 | |
47 GlobalFrameRoutingId(int child_id, int route_id) | |
48 : child_id(child_id), | |
49 route_id(route_id) { | |
50 } | |
51 | |
52 // The unique ID of the child process (different from OS's PID). | |
53 int child_id; | |
54 | |
55 // The route ID (unique for each URLRequest source). | |
56 int route_id; | |
nasko
2016/01/16 00:15:58
Let's be consistent since this is new code and cal
Charlie Harrison
2016/01/21 18:52:55
Done.
| |
57 | |
58 bool operator<(const GlobalFrameRoutingId& other) const { | |
59 return std::tie(child_id, route_id) < | |
60 std::tie(other.child_id, other.route_id); | |
61 } | |
62 bool operator==(const GlobalFrameRoutingId& other) const { | |
63 return child_id == other.child_id && | |
64 route_id == other.route_id; | |
65 } | |
66 bool operator!=(const GlobalFrameRoutingId& other) const { | |
67 return !(*this == other); | |
68 } | |
69 }; | |
70 | |
41 } // namespace content | 71 } // namespace content |
42 | 72 |
43 #endif // CONTENT_BROWSER_LOADER_GLOBAL_ROUTING_ID_H_ | 73 #endif // CONTENT_BROWSER_LOADER_GLOBAL_ROUTING_ID_H_ |
OLD | NEW |