Commit bbac4d2c authored by Paul Miller's avatar Paul Miller Committed by Commit Bot

Reland "WebView: Ignore permanent-consistency experiments"

This reverts commit 8bf4bf24.

Reason for revert: PermutedEntropyProvider regressed perf & memory.

BUG=890413

Original change's description:
> Revert "WebView: Ignore permanent-consistency experiments"
> 
> This reverts commit ef70c85e.
> 
> Reason for revert: WebView now supports permanent-consistency.
> 
> BUG=866722
> 
> Original change's description:
> > WebView: Ignore permanent-consistency experiments
> > 
> > Android WebView currently treats permanent-consistency experiments
> > (which are intended to retain their group assignments across runs) as
> > session-consistency (which are intended to be randomly assigned on each
> > run). It's safer to not apply permanent-consistency experiments to
> > WebView at all, to avoid mistakes.
> > 
> > BUG=866722
> > 
> > Change-Id: I9d501437718d934c2a59b95335c787302ce758e7
> > Reviewed-on: https://chromium-review.googlesource.com/1148991
> > Reviewed-by: Changwan Ryu <changwan@chromium.org>
> > Reviewed-by: Steven Holte <holte@chromium.org>
> > Commit-Queue: Paul Miller <paulmiller@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#578070}
> 
> TBR=changwan@chromium.org,holte@chromium.org,paulmiller@chromium.org
> 
> # Not skipping CQ checks because original CL landed > 1 day ago.
> 
> Bug: 866722
> Change-Id: Ifd00450fbba1afc1db619109cf918ef75cbcf84f
> Reviewed-on: https://chromium-review.googlesource.com/1237244
> Reviewed-by: Paul Miller <paulmiller@chromium.org>
> Reviewed-by: Steven Holte <holte@chromium.org>
> Commit-Queue: Paul Miller <paulmiller@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#594491}

TBR=changwan@chromium.org,holte@chromium.org,paulmiller@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 866722
Change-Id: I58435ac0c107214e15b0e54ff8aee422eb98fa06
Reviewed-on: https://chromium-review.googlesource.com/c/1259807Reviewed-by: default avatarPaul Miller <paulmiller@chromium.org>
Commit-Queue: Paul Miller <paulmiller@chromium.org>
Cr-Commit-Position: refs/heads/master@{#596380}
parent cef1e897
......@@ -54,6 +54,10 @@ Channel AwVariationsServiceClient::GetChannel() {
return android_webview::GetChannelOrStable();
}
bool AwVariationsServiceClient::GetSupportsPermanentConsistency() {
return false;
}
bool AwVariationsServiceClient::OverridesRestrictParameter(
std::string* parameter) {
return false;
......
......@@ -31,6 +31,7 @@ class AwVariationsServiceClient : public variations::VariationsServiceClient {
scoped_refptr<network::SharedURLLoaderFactory> GetURLLoaderFactory() override;
network_time::NetworkTimeTracker* GetNetworkTimeTracker() override;
version_info::Channel GetChannel() override;
bool GetSupportsPermanentConsistency() override;
bool OverridesRestrictParameter(std::string* parameter) override;
DISALLOW_COPY_AND_ASSIGN(AwVariationsServiceClient);
......
......@@ -47,6 +47,11 @@ struct ClientFilterableState {
// Based on base::SysInfo::IsLowEndDevice().
bool is_low_end_device = false;
// Whether this platform supports experiments which retain their group
// assignments across runs.
// TODO(paulmiller): Remove this once https://crbug.com/866722 is resolved.
bool supports_permanent_consistency = true;
// The country code to use for studies configured with session consistency.
std::string session_consistency_country;
......
......@@ -12,6 +12,7 @@ static_library("service") {
"variations_field_trial_creator.h",
"variations_service.cc",
"variations_service.h",
"variations_service_client.cc",
"variations_service_client.h",
]
......
......@@ -250,6 +250,8 @@ VariationsFieldTrialCreator::GetClientFilterableStateForVersion(
// evaluated, that field trial would not be able to apply for this case.
state->is_low_end_device = base::SysInfo::IsLowEndDevice();
#endif
state->supports_permanent_consistency =
client_->GetSupportsPermanentConsistency();
state->session_consistency_country = GetLatestCountry();
state->permanent_consistency_country = LoadPermanentConsistencyCountry(
version, state->session_consistency_country);
......
// Copyright 2018 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.
#include "components/variations/service/variations_service_client.h"
namespace variations {
bool VariationsServiceClient::GetSupportsPermanentConsistency() {
return true;
}
} // namespace variations
......@@ -45,6 +45,11 @@ class VariationsServiceClient {
// Gets the channel of the embedder.
virtual version_info::Channel GetChannel() = 0;
// Gets whether this platform supports experiments which retain their group
// assignments across runs.
// TODO(paulmiller): Remove this once https://crbug.com/866722 is resolved.
virtual bool GetSupportsPermanentConsistency();
// Returns whether the embedder overrides the value of the restrict parameter.
// |parameter| is an out-param that will contain the value of the restrict
// parameter if true is returned.
......
......@@ -12,6 +12,7 @@
#include "base/stl_util.h"
#include "base/strings/string_util.h"
#include "components/variations/client_filterable_state.h"
#include "components/variations/proto/study.pb.h"
namespace variations {
namespace {
......@@ -266,6 +267,14 @@ bool ShouldAddStudy(const Study& study,
}
}
// TODO(paulmiller): Remove this once https://crbug.com/866722 is resolved.
if (study.consistency() == Study_Consistency_PERMANENT &&
!client_state.supports_permanent_consistency) {
DVLOG(1) << "Filtered out study " << study.name()
<< " due to supports_permanent_consistency.";
return false;
}
DVLOG(1) << "Kept study " << study.name() << ".";
return true;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment