Commit e9e1d277 authored by Devlin Cronin's avatar Devlin Cronin Committed by Commit Bot

[Extensions Cleanup] Remove use of expired trial ExtensionSpeed

The ExtensionSpeed field trial was used to introduce a delay between
extension host starts (to reduce jank). This field trial has been
expired for some time. Remove its usage from the code.

Bug: 1028334, 477445
Change-Id: I963c0fa9236b86a4fd8c6c6d90296c9b00d8a360
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1937347
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: default avatarIlya Sherman <isherman@chromium.org>
Reviewed-by: default avatarKaran Bhatia <karandeepb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#719383}
parent 092c5815
...@@ -12,39 +12,10 @@ ...@@ -12,39 +12,10 @@
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
#include "base/threading/thread_task_runner_handle.h" #include "base/threading/thread_task_runner_handle.h"
#include "base/time/time.h" #include "base/time/time.h"
#include "components/variations/variations_associated_data.h"
#include "extensions/browser/deferred_start_render_host.h" #include "extensions/browser/deferred_start_render_host.h"
namespace extensions { namespace extensions {
namespace {
// Gets the number of milliseconds to delay between loading ExtensionHosts. By
// default this is 0, but it can be overridden by field trials.
int GetDelayMs() {
// TODO(devlin): I think these field trials are dead. Confirm, and remove.
// A sanity check for the maximum delay, to guard against a bad field trial
// config being pushed that delays loading too much (e.g. using wrong units).
static const int kMaxDelayMs = 30 * 1000;
static int delay_ms = -1;
if (delay_ms == -1) {
std::string delay_ms_param =
variations::GetVariationParamValue("ExtensionSpeed", "SerialEHQDelay");
if (delay_ms_param.empty()) {
delay_ms = 0;
} else if (!base::StringToInt(delay_ms_param, &delay_ms)) {
LOG(ERROR) << "Could not parse SerialEHQDelay: " << delay_ms_param;
delay_ms = 0;
} else if (delay_ms < 0 || delay_ms > kMaxDelayMs) {
LOG(ERROR) << "SerialEHQDelay out of range: " << delay_ms;
delay_ms = 0;
}
}
return delay_ms;
}
} // namespace
ExtensionHostQueue::ExtensionHostQueue() : pending_create_(false) {} ExtensionHostQueue::ExtensionHostQueue() : pending_create_(false) {}
ExtensionHostQueue::~ExtensionHostQueue() = default; ExtensionHostQueue::~ExtensionHostQueue() = default;
...@@ -62,11 +33,9 @@ void ExtensionHostQueue::Remove(DeferredStartRenderHost* host) { ...@@ -62,11 +33,9 @@ void ExtensionHostQueue::Remove(DeferredStartRenderHost* host) {
void ExtensionHostQueue::PostTask() { void ExtensionHostQueue::PostTask() {
if (!pending_create_) { if (!pending_create_) {
base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, FROM_HERE, base::BindOnce(&ExtensionHostQueue::ProcessOneHost,
base::BindOnce(&ExtensionHostQueue::ProcessOneHost, ptr_factory_.GetWeakPtr()));
ptr_factory_.GetWeakPtr()),
base::TimeDelta::FromMilliseconds(GetDelayMs()));
pending_create_ = true; pending_create_ = 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