Add support for operator <= to IdType.

This is a followup to r622715 to simplify some of the comparisons done
in ChildProcessSecurityPolicyImpl on BrowsingInstanceId, which is an
IdType.

Bug: 905513
Change-Id: I7c0fc4c3f649d6cf851188b0a6560489067806b9
Reviewed-on: https://chromium-review.googlesource.com/c/1413811
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Ɓukasz Anforowicz <lukasza@chromium.org>
Commit-Queue: Alex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#623782}
diff --git a/content/browser/child_process_security_policy_impl.cc b/content/browser/child_process_security_policy_impl.cc
index 2b832c8..25a0ecd 100644
--- a/content/browser/child_process_security_policy_impl.cc
+++ b/content/browser/child_process_security_policy_impl.cc
@@ -1385,9 +1385,7 @@
                                return entry.origin == origin;
                              });
       if (it != matching_origins.end()) {
-        // TODO(alexmos): Simplify this by defining operator <= for IdType.
-        DCHECK(it->min_browsing_instance_id < min_browsing_instance_id ||
-               it->min_browsing_instance_id == min_browsing_instance_id);
+        DCHECK_LE(it->min_browsing_instance_id, min_browsing_instance_id);
         continue;
       }
     }
@@ -1462,12 +1460,9 @@
   bool found = false;
   if (it != isolated_origins_.end()) {
     for (const auto& isolated_origin_entry : it->second) {
-      // TODO(alexmos): Simplify this by defining operator <= for IdType.
       bool matches_browsing_instance_id =
-          isolated_origin_entry.min_browsing_instance_id <
-              browsing_instance_id ||
-          isolated_origin_entry.min_browsing_instance_id ==
-              browsing_instance_id;
+          isolated_origin_entry.min_browsing_instance_id <=
+          browsing_instance_id;
       if (matches_browsing_instance_id &&
           IsolatedOriginUtil::DoesOriginMatchIsolatedOrigin(
               origin, isolated_origin_entry.origin)) {
diff --git a/gpu/command_buffer/common/id_type.h b/gpu/command_buffer/common/id_type.h
index 0d009c6..e3efbfa 100644
--- a/gpu/command_buffer/common/id_type.h
+++ b/gpu/command_buffer/common/id_type.h
@@ -60,6 +60,7 @@
   bool operator==(const IdType& other) const { return value_ == other.value_; }
   bool operator!=(const IdType& other) const { return value_ != other.value_; }
   bool operator<(const IdType& other) const { return value_ < other.value_; }
+  bool operator<=(const IdType& other) const { return value_ <= other.value_; }
 
   // Hasher to use in std::unordered_map, std::unordered_set, etc.
   struct Hasher {