Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(352)

Side by Side Diff: content/browser/loader/global_routing_id.h

Issue 12886022: Implement offline mode behind a flag (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Incorporated comments. Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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.
4
5 #ifndef CONTENT_PUBLIC_BROWSER_GLOBAL_ROUTING_ID_H_
6 #define CONTENT_PUBLIC_BROWSER_GLOBAL_ROUTING_ID_H_
7
8 namespace content {
9
10 // Uniquely identifies the route from which a net::URLRequest comes.
11 struct GlobalRoutingID {
12 GlobalRoutingID() : child_id(-1), route_id(-1) {
13 }
14
15 GlobalRoutingID(int child_id, int route_id)
16 : child_id(child_id),
17 route_id(route_id) {
18 }
19
20 // The unique ID of the child process (different from OS's PID).
21 int child_id;
22
23 // The route ID (unique for each URLRequest source).
24 int route_id;
25
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;
30 }
31 bool operator==(const GlobalRoutingID& other) const {
32 return child_id == other.child_id &&
33 route_id == other.route_id;
34 }
35 bool operator!=(const GlobalRoutingID& other) const {
36 return child_id != other.child_id ||
darin (slow to review) 2013/04/18 05:03:02 nit: usually best implemented as the generic !(*th
Randy Smith (Not in Mondays) 2013/04/18 20:04:57 Done, but note that this was based on copying cont
37 route_id != other.route_id;
38 }
39 };
40
41 } // namespace content
42
43 #endif // CONTENT_PUBLIC_BROWSER_GLOBAL_ROUTING_ID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698