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

Side by Side Diff: components/previews/core/previews_experiments.h

Issue 2640023007: Adds PreviewsType version mechanism for clearing blacklist entries. (Closed)
Patch Set: Few nits Created 3 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_PREVIEWS_CORE_PREVIEWS_EXPERIMENTS_H_ 5 #ifndef COMPONENTS_PREVIEWS_CORE_PREVIEWS_EXPERIMENTS_H_
6 #define COMPONENTS_PREVIEWS_CORE_PREVIEWS_EXPERIMENTS_H_ 6 #define COMPONENTS_PREVIEWS_CORE_PREVIEWS_EXPERIMENTS_H_
7 7
8 #include <memory>
9 #include <utility>
10 #include <vector>
11
8 #include "base/time/time.h" 12 #include "base/time/time.h"
9 #include "net/nqe/effective_connection_type.h" 13 #include "net/nqe/effective_connection_type.h"
10 14
11 namespace previews { 15 namespace previews {
12 16
13 namespace params { 17 namespace params {
14 18
15 // The maximum number of recent previews navigations the black list looks at to 19 // The maximum number of recent previews navigations the black list looks at to
16 // determine if a host is blacklisted. 20 // determine if a host is blacklisted.
17 size_t MaxStoredHistoryLengthForPerHostBlackList(); 21 size_t MaxStoredHistoryLengthForPerHostBlackList();
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 net::EffectiveConnectionType EffectiveConnectionTypeThreshold(); 53 net::EffectiveConnectionType EffectiveConnectionTypeThreshold();
50 54
51 } // namespace params 55 } // namespace params
52 56
53 enum class PreviewsType { 57 enum class PreviewsType {
54 NONE = 0, 58 NONE = 0,
55 OFFLINE = 1, 59 OFFLINE = 1,
56 LAST = 2, 60 LAST = 2,
57 }; 61 };
58 62
63 typedef std::vector<std::pair<PreviewsType, int>> PreviewsTypeList;
64
59 // Returns true if any client-side previews experiment is active. 65 // Returns true if any client-side previews experiment is active.
60 bool IsIncludedInClientSidePreviewsExperimentsFieldTrial(); 66 bool IsIncludedInClientSidePreviewsExperimentsFieldTrial();
61 67
62 // Returns true if the field trial that should enable previews for |type| for 68 // Returns true if the field trial that should enable previews for |type| for
63 // prohibitvely slow networks is active. 69 // prohibitvely slow networks is active.
64 bool IsPreviewsTypeEnabled(PreviewsType type); 70 bool IsPreviewsTypeEnabled(PreviewsType type);
65 71
72 // Returns the version of preview treatment |type|. Defaults to 0 if not
73 // specified in field trial config.
74 int GetPreviewsTypeVersion(PreviewsType type);
75
76 // Returns the enabled PreviewsTypes with their version.
77 std::unique_ptr<PreviewsTypeList> GetEnabledPreviews();
78
66 // Sets the appropriate state for field trial and variations to imitate the 79 // Sets the appropriate state for field trial and variations to imitate the
67 // offline pages field trial. 80 // offline pages field trial.
68 bool EnableOfflinePreviewsForTesting(); 81 bool EnableOfflinePreviewsForTesting();
69 82
70 } // namespace previews 83 } // namespace previews
71 84
72 #endif // COMPONENTS_PREVIEWS_CORE_PREVIEWS_EXPERIMENTS_H_ 85 #endif // COMPONENTS_PREVIEWS_CORE_PREVIEWS_EXPERIMENTS_H_
OLDNEW
« no previous file with comments | « no previous file | components/previews/core/previews_experiments.cc » ('j') | components/previews/core/previews_experiments.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698