experiments.h revision 5d1f7b1de12d16ceb2c938c56701a3e8bfa558f7
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.
4
5#ifndef SYNC_UTIL_EXPERIMENTS_
6#define SYNC_UTIL_EXPERIMENTS_
7
8#include <string>
9
10#include "sync/internal_api/public/base/model_type.h"
11
12namespace syncer {
13
14const char kFaviconSyncTag[] = "favicon_sync";
15const char kPreCommitUpdateAvoidanceTag[] = "pre_commit_update_avoidance";
16const char kGCMChannelTag[] = "gcm_channel";
17const char kEnhancedBookmarksTag[] = "enhanced_bookmarks";
18
19// A structure to hold the enable status of experimental sync features.
20struct Experiments {
21  enum GCMChannelState {
22    UNSET,
23    SUPPRESSED,
24    ENABLED,
25  };
26
27  Experiments()
28      : favicon_sync_limit(200),
29        gcm_channel_state(UNSET),
30        enhanced_bookmarks_enabled(false) {}
31
32  bool Matches(const Experiments& rhs) {
33    return (favicon_sync_limit == rhs.favicon_sync_limit &&
34            gcm_channel_state == rhs.gcm_channel_state &&
35            enhanced_bookmarks_enabled == rhs.enhanced_bookmarks_enabled &&
36            enhanced_bookmarks_ext_id == rhs.enhanced_bookmarks_ext_id);
37  }
38
39  // The number of favicons that a client is permitted to sync.
40  int favicon_sync_limit;
41
42  // Enable state of the GCM channel.
43  GCMChannelState gcm_channel_state;
44
45  // Enable the enhanced bookmarks sync datatype.
46  bool enhanced_bookmarks_enabled;
47
48  // Enhanced bookmarks extension id.
49  std::string enhanced_bookmarks_ext_id;
50};
51
52}  // namespace syncer
53
54#endif  // SYNC_UTIL_EXPERIMENTS_
55