Blink roll 25b6bd3a7a131ffe68d809546ad1a20707915cdc:3a503f41ae42e5b79cfcd2ff10e65afde...
[chromium-blink-merge.git] / content / browser / loader / global_routing_id.h
blob4715c5a9ee8776ae35c1c5bf2b8308eaf78623ee
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
3 // found in the LICENSE file.
5 #ifndef CONTENT_PUBLIC_BROWSER_GLOBAL_ROUTING_ID_H_
6 #define CONTENT_PUBLIC_BROWSER_GLOBAL_ROUTING_ID_H_
8 namespace content {
10 // Uniquely identifies the route from which a net::URLRequest comes.
11 struct GlobalRoutingID {
12 GlobalRoutingID() : child_id(-1), route_id(-1) {
15 GlobalRoutingID(int child_id, int route_id)
16 : child_id(child_id),
17 route_id(route_id) {
20 // The unique ID of the child process (different from OS's PID).
21 int child_id;
23 // The route ID (unique for each URLRequest source).
24 int route_id;
26 bool operator<(const GlobalRoutingID& other) const {
27 if (child_id == other.child_id)
28 return route_id < other.route_id;
29 return child_id < other.child_id;
31 bool operator==(const GlobalRoutingID& other) const {
32 return child_id == other.child_id &&
33 route_id == other.route_id;
35 bool operator!=(const GlobalRoutingID& other) const {
36 return !(*this == other);
40 } // namespace content
42 #endif // CONTENT_PUBLIC_BROWSER_GLOBAL_ROUTING_ID_H_