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

Unified Diff: components/previews/previews_experiments.h

Issue 2335023002: Adding a previews IO-thread blacklist (Closed)
Patch Set: build.gn dependency on gurl 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 side-by-side diff with in-line comments
Download patch
Index: components/previews/previews_experiments.h
diff --git a/components/previews/previews_experiments.h b/components/previews/previews_experiments.h
index 7fff9c476a9b0e332ae4c29b02335781ac4f72a2..59d33d531185bc5d79f1c4e423a8fa09a590b0d9 100644
--- a/components/previews/previews_experiments.h
+++ b/components/previews/previews_experiments.h
@@ -1,23 +1,48 @@
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_PREVIEWS_PREVIEWS_EXPERIMENTS_H_
#define COMPONENTS_PREVIEWS_PREVIEWS_EXPERIMENTS_H_
+#include "base/time/time.h"
+
namespace previews {
+namespace params {
+
+// The number of most recent previews navigations the black list looks at to
+// determine if a domain is blacklisted.
+size_t StoredHistoryLengthForBlackList();
+
+// The number of recent navigations that were opted out of that would trigger
+// the domain to be blacklisted.
+int BlackListOptOutThreshold();
+
+// The amount of time a domain remains blacklisted due to opt outs.
+base::TimeDelta BlackListDuration();
+
+// Whether the black list params are non-zero.
+bool BlackListParamsAreValid();
+}
+
// Returns true if any client-side previews experiment is active.
bool IsIncludedInClientSidePreviewsExperimentsFieldTrial();
// Returns true if the field trial that should enable offline pages for
// prohibitvely slow networks is active.
bool IsOfflinePreviewsEnabled();
// Sets the appropriate state for field trial and variations to imitate the
// offline pages field trial.
bool EnableOfflinePreviewsForTesting();
+// Sets the appropriate state for field trial and variations to force the passed
+// in black list params.
+bool EnableBlackListParamsForTesting(const int history_length,
+ const int opt_out_threshold,
+ const int duration_time_in_seconds);
+
} // namespace previews
#endif // COMPONENTS_PREVIEWS_PREVIEWS_EXPERIMENTS_H_

Powered by Google App Engine
This is Rietveld 408576698