chromium/content/browser/startup_helper.cc

// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "content/browser/startup_helper.h"

#include <algorithm>
#include <memory>
#include <set>
#include <string>

#include "base/base_switches.h"
#include "base/command_line.h"
#include "base/system/sys_info.h"
#include "base/task/thread_pool/initialization_util.h"
#include "base/task/thread_pool/thread_pool_instance.h"
#include "build/build_config.h"
#include "components/miracle_parameter/common/public/miracle_parameter.h"
#include "content/common/thread_pool_util.h"
#include "content/public/common/content_switch_dependent_feature_overrides.h"
#include "content/public/common/content_switches.h"

namespace content {

std::unique_ptr<base::FieldTrialList> SetUpFieldTrialsAndFeatureList() {}

namespace {

BASE_FEATURE();

// For iOS see ios/web/app/web_main_loop.cc.
MIRACLE_PARAMETER_FOR_INT(GetBrowserThreadPoolMin,
                          kBrowserThreadPoolAdjustment,
                          "BrowserThreadPoolMin",
#if BUILDFLAG(IS_ANDROID)
                          6
#else
                          16
#endif
)

MIRACLE_PARAMETER_FOR_INT(GetBrowserThreadPoolMax,
                          kBrowserThreadPoolAdjustment,
                          "BrowserThreadPoolMax",
#if BUILDFLAG(IS_ANDROID)
                          8
#else
                          32
#endif
)

MIRACLE_PARAMETER_FOR_DOUBLE(GetBrowserThreadPoolCoresMultiplier,
                             kBrowserThreadPoolAdjustment,
                             "BrowserThreadPoolCoresMultiplier",
                             0.6)

MIRACLE_PARAMETER_FOR_INT(GetBrowserThreadPoolOffset,
                          kBrowserThreadPoolAdjustment,
                          "BrowserThreadPoolOffset",
                          0)

}  // namespace

// TODO(scheduler-dev): Standardize thread pool logic and remove the need for
// specifying thread count manually.
void StartBrowserThreadPool() {}

}  // namespace content