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

Unified Diff: sync/android/java/src/org/chromium/sync/internal_api/pub/base/ModelType.java

Issue 22642004: Ensure we never try to register for the object id "NULL" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 4 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: sync/android/java/src/org/chromium/sync/internal_api/pub/base/ModelType.java
diff --git a/sync/android/java/src/org/chromium/sync/internal_api/pub/base/ModelType.java b/sync/android/java/src/org/chromium/sync/internal_api/pub/base/ModelType.java
index a7d4797680fbdc301524d57ac38caa9a86aef026..028f53fc318f0885cfa3e0fa2f3b6e4a509ac30d 100644
--- a/sync/android/java/src/org/chromium/sync/internal_api/pub/base/ModelType.java
+++ b/sync/android/java/src/org/chromium/sync/internal_api/pub/base/ModelType.java
@@ -63,7 +63,7 @@ public enum ModelType {
/**
* A proxy tabs object (placeholder for sessions).
*/
- PROXY_TABS("NULL"),
+ PROXY_TABS("NULL", true),
/**
* A favicon image object.
*/
@@ -80,8 +80,15 @@ public enum ModelType {
private final String mModelType;
- ModelType(String modelType) {
+ private final boolean mNonInvalidationType;
+
+ ModelType(String modelType, boolean nonInvalidationType) {
mModelType = modelType;
+ mNonInvalidationType = nonInvalidationType;
+ }
+
+ ModelType(String modelType) {
+ this(modelType, false);
}
public ObjectId toObjectId() {
@@ -141,4 +148,14 @@ public enum ModelType {
}
return objectIds;
}
+
+ public static Set<ModelType> stripNonInvalidationTypes(Set<ModelType> modelTypes) {
Yaron 2013/08/08 01:52:16 Pleaes add Javadoc.
nyquist 2013/08/08 17:59:28 Removed.
+ Set<ModelType> result = new HashSet<ModelType>(modelTypes);
Yaron 2013/08/08 01:52:16 Which a name of "strip..." it's not clear why you'
nyquist 2013/08/08 17:59:28 Removed.
+ for (ModelType modelType : values()) {
+ if (modelType.mNonInvalidationType) {
+ result.remove(modelType);
+ }
+ }
+ return result;
+ }
}

Powered by Google App Engine
This is Rietveld 408576698