Upstream version 11.39.250.0
[platform/framework/web/crosswalk.git] / src / sync / internal_api / public / util / experiments.h
index 144687d..b61742d 100644 (file)
@@ -5,29 +5,55 @@
 #ifndef SYNC_UTIL_EXPERIMENTS_
 #define SYNC_UTIL_EXPERIMENTS_
 
+#include <string>
+
 #include "sync/internal_api/public/base/model_type.h"
 
 namespace syncer {
 
-const char kAutofillCullingTag[] = "autofill_culling";
 const char kFaviconSyncTag[] = "favicon_sync";
 const char kPreCommitUpdateAvoidanceTag[] = "pre_commit_update_avoidance";
+const char kGCMChannelTag[] = "gcm_channel";
+const char kEnhancedBookmarksTag[] = "enhanced_bookmarks";
+const char kGCMInvalidationsTag[] = "gcm_invalidations";
 
 // A structure to hold the enable status of experimental sync features.
 struct Experiments {
-  Experiments() : autofill_culling(false),
-                  favicon_sync_limit(200) {}
+  enum GCMChannelState {
+    UNSET,
+    SUPPRESSED,
+    ENABLED,
+  };
+
+  Experiments()
+      : favicon_sync_limit(200),
+        gcm_channel_state(UNSET),
+        enhanced_bookmarks_enabled(false),
+        gcm_invalidations_enabled(true)  // By default GCM channel is enabled.
+  {}
 
   bool Matches(const Experiments& rhs) {
-    return (autofill_culling == rhs.autofill_culling &&
-            favicon_sync_limit == rhs.favicon_sync_limit);
+    return (favicon_sync_limit == rhs.favicon_sync_limit &&
+            gcm_channel_state == rhs.gcm_channel_state &&
+            enhanced_bookmarks_enabled == rhs.enhanced_bookmarks_enabled &&
+            enhanced_bookmarks_ext_id == rhs.enhanced_bookmarks_ext_id &&
+            gcm_invalidations_enabled == rhs.gcm_invalidations_enabled);
   }
 
-  // Enable deletion of expired autofill entries (if autofill sync is enabled).
-  bool autofill_culling;
-
   // The number of favicons that a client is permitted to sync.
   int favicon_sync_limit;
+
+  // Enable state of the GCM channel.
+  GCMChannelState gcm_channel_state;
+
+  // Enable the enhanced bookmarks sync datatype.
+  bool enhanced_bookmarks_enabled;
+
+  // Enable invalidations over GCM channel.
+  bool gcm_invalidations_enabled;
+
+  // Enhanced bookmarks extension id.
+  std::string enhanced_bookmarks_ext_id;
 };
 
 }  // namespace syncer