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

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

Issue 2335023002: Adding a previews IO-thread blacklist (Closed)
Patch Set: updated comments Created 4 years, 3 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_PREVIEWS_EXPERIMENTS_H_ 5 #ifndef COMPONENTS_PREVIEWS_PREVIEWS_EXPERIMENTS_H_
6 #define COMPONENTS_PREVIEWS_PREVIEWS_EXPERIMENTS_H_ 6 #define COMPONENTS_PREVIEWS_PREVIEWS_EXPERIMENTS_H_
7 7
8 #include "base/time/time.h"
9
8 namespace previews { 10 namespace previews {
9 11
12 namespace params {
13
14 // The number of most recent previews navigations the black list looks at to
15 // determine if a domain is blacklisted.
16 int StoredHistoryLengthForBlackList();
17
18 // The number of recent navigations that were opted out of that would trigger
19 // the domain to be blacklisted.
20 int BlackListOptOutThreshold();
21
22 // The amount of time a domain remains blacklisted due to opt outs.
23 base::TimeDelta BlackListDuration();
24
25 // Whether the black list params are non-zero.
26 bool BlackListParamsAreValid();
27 }
28
10 // Returns true if any client-side previews experiment is active. 29 // Returns true if any client-side previews experiment is active.
11 bool IsIncludedInClientSidePreviewsExperimentsFieldTrial(); 30 bool IsIncludedInClientSidePreviewsExperimentsFieldTrial();
12 31
13 // Returns true if the field trial that should enable offline pages for 32 // Returns true if the field trial that should enable offline pages for
14 // prohibitvely slow networks is active. 33 // prohibitvely slow networks is active.
15 bool IsOfflinePreviewsEnabled(); 34 bool IsOfflinePreviewsEnabled();
16 35
17 // Sets the appropriate state for field trial and variations to imitate the 36 // Sets the appropriate state for field trial and variations to imitate the
18 // offline pages field trial. 37 // offline pages field trial.
19 bool EnableOfflinePreviewsForTesting(); 38 bool EnableOfflinePreviewsForTesting();
20 39
40 // Sets the appropriate state for field trial and variations to force the passed
41 // in black list params.
42 bool EnableBlackListParamsForTesting(const int history_length,
43 const int opt_out_threshold,
44 const int duration_time_in_seconds);
45
21 } // namespace previews 46 } // namespace previews
22 47
23 #endif // COMPONENTS_PREVIEWS_PREVIEWS_EXPERIMENTS_H_ 48 #endif // COMPONENTS_PREVIEWS_PREVIEWS_EXPERIMENTS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698