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

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

Issue 2640023007: Adds PreviewsType version mechanism for clearing blacklist entries. (Closed)
Patch Set: Cleaned up commented include 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 LAST = 2, 60 LAST = 2,
57 }; 61 };
58 62
59 // Returns true if any client-side previews experiment is active. 63 // Returns true if any client-side previews experiment is active.
60 bool IsIncludedInClientSidePreviewsExperimentsFieldTrial(); 64 bool IsIncludedInClientSidePreviewsExperimentsFieldTrial();
61 65
62 // Returns true if the field trial that should enable previews for |type| for 66 // Returns true if the field trial that should enable previews for |type| for
63 // prohibitvely slow networks is active. 67 // prohibitvely slow networks is active.
64 bool IsPreviewsTypeEnabled(PreviewsType type); 68 bool IsPreviewsTypeEnabled(PreviewsType type);
65 69
70 // Returns the version of preview treatment |type| to use if it is enabled.
71 // Should only be called if |IsPreviewsTypeEnabled(type)| returns true.
bengr 2017/02/09 17:33:47 Why? Isn't a version independent of whether it is
dougarnett 2017/02/13 17:56:17 Done.
72 int GetPreviewsTypeVersion(PreviewsType type);
73
74 // Returns the enabled PreviewsTypes with their version.
75 std::unique_ptr<std::vector<std::pair<PreviewsType, int>>> GetEnabledPreviews();
bengr 2017/02/09 17:33:47 Might be more readable if you define a PreviewsTyp
dougarnett 2017/02/13 17:56:17 Done.
76
66 // Sets the appropriate state for field trial and variations to imitate the 77 // Sets the appropriate state for field trial and variations to imitate the
67 // offline pages field trial. 78 // offline pages field trial.
68 bool EnableOfflinePreviewsForTesting(); 79 bool EnableOfflinePreviewsForTesting();
69 80
70 } // namespace previews 81 } // namespace previews
71 82
72 #endif // COMPONENTS_PREVIEWS_CORE_PREVIEWS_EXPERIMENTS_H_ 83 #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