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

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

Issue 2640023007: Adds PreviewsType version mechanism for clearing blacklist entries. (Closed)
Patch Set: Missed a change in last upload 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 13
10 namespace previews { 14 namespace previews {
11 15
12 namespace params { 16 namespace params {
13 17
14 // The maximum number of recent previews navigations the black list looks at to 18 // The maximum number of recent previews navigations the black list looks at to
15 // determine if a host is blacklisted. 19 // determine if a host is blacklisted.
16 size_t MaxStoredHistoryLengthForPerHostBlackList(); 20 size_t MaxStoredHistoryLengthForPerHostBlackList();
17 21
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 LAST = 2, 55 LAST = 2,
52 }; 56 };
53 57
54 // Returns true if any client-side previews experiment is active. 58 // Returns true if any client-side previews experiment is active.
55 bool IsIncludedInClientSidePreviewsExperimentsFieldTrial(); 59 bool IsIncludedInClientSidePreviewsExperimentsFieldTrial();
56 60
57 // Returns true if the field trial that should enable previews for |type| for 61 // Returns true if the field trial that should enable previews for |type| for
58 // prohibitvely slow networks is active. 62 // prohibitvely slow networks is active.
59 bool IsPreviewsTypeEnabled(PreviewsType type); 63 bool IsPreviewsTypeEnabled(PreviewsType type);
60 64
65 // Returns the version of preview treatment |type| to use if it is enabled.
66 // Should only be called if |IsPreviewsTypeEnabled(type)| returns true.
67 bool IsPreviewsTypeEnabled(PreviewsType type);
68
69 // Returns the enabled PreviewsTypes with their version.
70 std::unique_ptr<std::vector<std::pair<PreviewsType, int>>> GetEnabledPreviews();
71
61 // Sets the appropriate state for field trial and variations to imitate the 72 // Sets the appropriate state for field trial and variations to imitate the
62 // offline pages field trial. 73 // offline pages field trial.
63 bool EnableOfflinePreviewsForTesting(); 74 bool EnableOfflinePreviewsForTesting();
64 75
65 } // namespace previews 76 } // namespace previews
66 77
67 #endif // COMPONENTS_PREVIEWS_CORE_PREVIEWS_EXPERIMENTS_H_ 78 #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