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

Unified Diff: components/offline_items_collection/core/android/java/src/org/chromium/components/offline_items_collection/ContentId.java

Issue 2754363004: OfflineContentProvider changes to start service (Closed)
Patch Set: Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: components/offline_items_collection/core/android/java/src/org/chromium/components/offline_items_collection/ContentId.java
diff --git a/components/offline_items_collection/core/android/java/src/org/chromium/components/offline_items_collection/ContentId.java b/components/offline_items_collection/core/android/java/src/org/chromium/components/offline_items_collection/ContentId.java
index 045618ba9dc19998a017dc4f6c20f7b0b2f581be..4474dfd5ce72caf8391d1c47716d62d8c6f5fcf1 100644
--- a/components/offline_items_collection/core/android/java/src/org/chromium/components/offline_items_collection/ContentId.java
+++ b/components/offline_items_collection/core/android/java/src/org/chromium/components/offline_items_collection/ContentId.java
@@ -20,4 +20,29 @@ public class ContentId {
this.namespace = namespace;
this.id = id;
}
+
gone 2017/03/20 19:03:36 Also randomly added?
David Trainor- moved to gerrit 2017/03/25 03:31:13 See comment in OfflineItem.java.
+ @Override
+ public String toString() {
+ return getClass().getSimpleName() + "@" + Integer.toHexString(hashCode()) + " [" + namespace
+ + ", " + id + "]";
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (!(o instanceof ContentId)) return false;
+
+ ContentId lhs = (ContentId) o;
fgorski 2017/03/20 20:19:20 rhs? Both because this is right of equals and you
David Trainor- moved to gerrit 2017/03/25 03:31:13 Done.
+ return namespace == lhs.namespace && id == lhs.id;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = 61;
+
+ result = 31 * result + (namespace == null ? 0 : namespace.hashCode());
+ result = 31 * result + (id == null ? 0 : id.hashCode());
+
+ return result;
+ }
}

Powered by Google App Engine
This is Rietveld 408576698