Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / sync / internal_api / public / util / experiments.h
blob9063cbb0f66ba6cd6f0d685643be25d2fb0a47ce
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef SYNC_UTIL_EXPERIMENTS_
6 #define SYNC_UTIL_EXPERIMENTS_
8 #include <string>
10 #include "sync/internal_api/public/base/model_type.h"
12 namespace syncer {
14 const char kFaviconSyncTag[] = "favicon_sync";
15 const char kPreCommitUpdateAvoidanceTag[] = "pre_commit_update_avoidance";
16 const char kGCMChannelTag[] = "gcm_channel";
17 const char kEnhancedBookmarksTag[] = "enhanced_bookmarks";
18 const char kGCMInvalidationsTag[] = "gcm_invalidations";
20 // A structure to hold the enable status of experimental sync features.
21 struct Experiments {
22 enum GCMChannelState {
23 UNSET,
24 SUPPRESSED,
25 ENABLED,
28 Experiments()
29 : favicon_sync_limit(200),
30 gcm_channel_state(UNSET),
31 enhanced_bookmarks_enabled(false),
32 gcm_invalidations_enabled(false) {}
34 bool Matches(const Experiments& rhs) {
35 return (favicon_sync_limit == rhs.favicon_sync_limit &&
36 gcm_channel_state == rhs.gcm_channel_state &&
37 enhanced_bookmarks_enabled == rhs.enhanced_bookmarks_enabled &&
38 enhanced_bookmarks_ext_id == rhs.enhanced_bookmarks_ext_id &&
39 gcm_invalidations_enabled == rhs.gcm_invalidations_enabled);
42 // The number of favicons that a client is permitted to sync.
43 int favicon_sync_limit;
45 // Enable state of the GCM channel.
46 GCMChannelState gcm_channel_state;
48 // Enable the enhanced bookmarks sync datatype.
49 bool enhanced_bookmarks_enabled;
51 // Enable invalidations over GCM channel.
52 bool gcm_invalidations_enabled;
54 // Enhanced bookmarks extension id.
55 std::string enhanced_bookmarks_ext_id;
58 } // namespace syncer
60 #endif // SYNC_UTIL_EXPERIMENTS_