summaryrefslogtreecommitdiffstats
path: root/content/public/browser/global_request_id.h
diff options
context:
space:
mode:
Diffstat (limited to 'content/public/browser/global_request_id.h')
-rw-r--r--content/public/browser/global_request_id.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/content/public/browser/global_request_id.h b/content/public/browser/global_request_id.h
new file mode 100644
index 0000000..e3a541c
--- /dev/null
+++ b/content/public/browser/global_request_id.h
@@ -0,0 +1,44 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_PUBLIC_BROWSER_GLOBAL_REQUEST_ID_H_
+#define CONTENT_PUBLIC_BROWSER_GLOBAL_REQUEST_ID_H_
+#pragma once
+
+namespace content {
+
+// Uniquely identifies a net::URLRequest.
+struct GlobalRequestID {
+ GlobalRequestID() : child_id(-1), request_id(-1) {
+ }
+
+ GlobalRequestID(int child_id, int request_id)
+ : child_id(child_id),
+ request_id(request_id) {
+ }
+
+ // The unique ID of the child process (different from OS's PID).
+ int child_id;
+
+ // The request ID (unique for the child).
+ int request_id;
+
+ bool operator<(const GlobalRequestID& other) const {
+ if (child_id == other.child_id)
+ return request_id < other.request_id;
+ return child_id < other.child_id;
+ }
+ bool operator==(const GlobalRequestID& other) const {
+ return child_id == other.child_id &&
+ request_id == other.request_id;
+ }
+ bool operator!=(const GlobalRequestID& other) const {
+ return child_id != other.child_id ||
+ request_id != other.request_id;
+ }
+};
+
+} // namespace content
+
+#endif // CONTENT_PUBLIC_BROWSER_GLOBAL_REQUEST_ID_H_