summarylogtreecommitdiffstats
path: root/0006-Revert-PM-Add-calculation-of-maximum-simultaneous-lo.patch
diff options
context:
space:
mode:
authorDaniel Playfair Cal2020-04-28 00:28:19 +1000
committerDaniel Playfair Cal2020-04-28 00:28:19 +1000
commitf5a7f79e5b7cc11028a5c3e14b9f235d3f7602c5 (patch)
tree75fd21b7a9ef0958d7356631713fda6130abe165 /0006-Revert-PM-Add-calculation-of-maximum-simultaneous-lo.patch
parent68351964753fbb3a7221b2e9f8b3c42b66e838dd (diff)
downloadaur-f5a7f79e5b7cc11028a5c3e14b9f235d3f7602c5.tar.gz
83.0.4103.23-1
Diffstat (limited to '0006-Revert-PM-Add-calculation-of-maximum-simultaneous-lo.patch')
-rw-r--r--0006-Revert-PM-Add-calculation-of-maximum-simultaneous-lo.patch244
1 files changed, 0 insertions, 244 deletions
diff --git a/0006-Revert-PM-Add-calculation-of-maximum-simultaneous-lo.patch b/0006-Revert-PM-Add-calculation-of-maximum-simultaneous-lo.patch
deleted file mode 100644
index 8901d446acb..00000000000
--- a/0006-Revert-PM-Add-calculation-of-maximum-simultaneous-lo.patch
+++ /dev/null
@@ -1,244 +0,0 @@
-From 5794a8df921586417f6ffd6e05214b0258df7a00 Mon Sep 17 00:00:00 2001
-From: Daniel Playfair Cal <daniel.playfair.cal@gmail.com>
-Date: Sat, 11 Apr 2020 13:01:16 +1000
-Subject: [PATCH 6/8] Revert "[PM] Add calculation of maximum simultaneous
- load"
-
-This reverts commit b759260ca14691c4ffc386a4c64aef6f4b404618.
----
- chrome/browser/BUILD.gn | 2 -
- .../policies/background_tab_loading_policy.cc | 19 -------
- .../policies/background_tab_loading_policy.h | 4 --
- .../background_tab_loading_policy_helpers.cc | 39 --------------
- .../background_tab_loading_policy_helpers.h | 25 ---------
- ...und_tab_loading_policy_helpers_unittest.cc | 54 -------------------
- chrome/test/BUILD.gn | 1 -
- 7 files changed, 144 deletions(-)
- delete mode 100644 chrome/browser/performance_manager/graph/policies/background_tab_loading_policy_helpers.cc
- delete mode 100644 chrome/browser/performance_manager/graph/policies/background_tab_loading_policy_helpers.h
- delete mode 100644 chrome/browser/performance_manager/graph/policies/background_tab_loading_policy_helpers_unittest.cc
-
-diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
-index 023024e81c99..61c2784bd4c7 100644
---- a/chrome/browser/BUILD.gn
-+++ b/chrome/browser/BUILD.gn
-@@ -3376,8 +3376,6 @@ jumbo_static_library("browser") {
- "page_load_metrics/observers/session_restore_page_load_metrics_observer.h",
- "performance_manager/graph/policies/background_tab_loading_policy.cc",
- "performance_manager/graph/policies/background_tab_loading_policy.h",
-- "performance_manager/graph/policies/background_tab_loading_policy_helpers.cc",
-- "performance_manager/graph/policies/background_tab_loading_policy_helpers.h",
- "performance_manager/graph/policies/urgent_page_discarding_policy.cc",
- "performance_manager/graph/policies/urgent_page_discarding_policy.h",
- "performance_manager/mechanisms/page_discarder.cc",
-diff --git a/chrome/browser/performance_manager/graph/policies/background_tab_loading_policy.cc b/chrome/browser/performance_manager/graph/policies/background_tab_loading_policy.cc
-index 7f68ad5c9c81..eb8c5a1ff489 100644
---- a/chrome/browser/performance_manager/graph/policies/background_tab_loading_policy.cc
-+++ b/chrome/browser/performance_manager/graph/policies/background_tab_loading_policy.cc
-@@ -4,8 +4,6 @@
-
- #include "chrome/browser/performance_manager/graph/policies/background_tab_loading_policy.h"
-
--#include "base/system/sys_info.h"
--#include "chrome/browser/performance_manager/graph/policies/background_tab_loading_policy_helpers.h"
- #include "chrome/browser/performance_manager/mechanisms/page_loader.h"
- #include "components/performance_manager/public/decorators/tab_properties_decorator.h"
- #include "components/performance_manager/public/graph/policies/background_tab_loading_policy.h"
-@@ -16,21 +14,7 @@ namespace performance_manager {
- namespace policies {
-
- namespace {
--
--// Pointer to the instance of itself.
- BackgroundTabLoadingPolicy* g_background_tab_loading_policy = nullptr;
--
--// Lower bound for the maximum number of tabs to load simultaneously.
--uint32_t kMinSimultaneousTabLoads = 1;
--
--// Upper bound for the maximum number of tabs to load simultaneously.
--// Setting to zero means no upper bound is applied.
--uint32_t kMaxSimultaneousTabLoads = 4;
--
--// The number of CPU cores required per permitted simultaneous tab
--// load. Setting to zero means no CPU core limit applies.
--uint32_t kCoresPerSimultaneousTabLoad = 2;
--
- } // namespace
-
- void ScheduleLoadForRestoredTabs(
-@@ -64,9 +48,6 @@ BackgroundTabLoadingPolicy::BackgroundTabLoadingPolicy()
- : page_loader_(std::make_unique<mechanism::PageLoader>()) {
- DCHECK(!g_background_tab_loading_policy);
- g_background_tab_loading_policy = this;
-- simultaneous_tab_loads_ = CalculateMaxSimultaneousTabLoads(
-- kMinSimultaneousTabLoads, kMaxSimultaneousTabLoads,
-- kCoresPerSimultaneousTabLoad, base::SysInfo::NumberOfProcessors());
- }
-
- BackgroundTabLoadingPolicy::~BackgroundTabLoadingPolicy() {
-diff --git a/chrome/browser/performance_manager/graph/policies/background_tab_loading_policy.h b/chrome/browser/performance_manager/graph/policies/background_tab_loading_policy.h
-index e9ea7180444a..b9187bfb2ae8 100644
---- a/chrome/browser/performance_manager/graph/policies/background_tab_loading_policy.h
-+++ b/chrome/browser/performance_manager/graph/policies/background_tab_loading_policy.h
-@@ -69,10 +69,6 @@ class BackgroundTabLoadingPolicy : public GraphOwned,
-
- // The set of PageNodes that are currently loading.
- std::vector<const PageNode*> page_nodes_loading_;
--
-- // The number of simultaneous tab loads that are permitted by policy. This
-- // is computed based on the number of cores on the machine.
-- size_t simultaneous_tab_loads_;
- };
-
- } // namespace policies
-diff --git a/chrome/browser/performance_manager/graph/policies/background_tab_loading_policy_helpers.cc b/chrome/browser/performance_manager/graph/policies/background_tab_loading_policy_helpers.cc
-deleted file mode 100644
-index 6ab117bc44c8..000000000000
---- a/chrome/browser/performance_manager/graph/policies/background_tab_loading_policy_helpers.cc
-+++ /dev/null
-@@ -1,39 +0,0 @@
--// Copyright 2020 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 "chrome/browser/performance_manager/graph/policies/background_tab_loading_policy_helpers.h"
--#include "base/logging.h"
--
--namespace performance_manager {
--
--namespace policies {
--
--size_t CalculateMaxSimultaneousTabLoads(size_t lower_bound,
-- size_t upper_bound,
-- size_t cores_per_load,
-- size_t num_cores) {
-- DCHECK(upper_bound == 0 || lower_bound <= upper_bound);
-- DCHECK(num_cores > 0);
--
-- size_t loads = 0;
--
-- // Setting |cores_per_load| == 0 means that no per-core limit is applied.
-- if (cores_per_load == 0) {
-- loads = std::numeric_limits<size_t>::max();
-- } else {
-- loads = num_cores / cores_per_load;
-- }
--
-- // If |upper_bound| isn't zero then apply the maximum that it implies.
-- if (upper_bound != 0)
-- loads = std::min(loads, upper_bound);
--
-- loads = std::max(loads, lower_bound);
--
-- return loads;
--}
--
--} // namespace policies
--
--} // namespace performance_manager
-diff --git a/chrome/browser/performance_manager/graph/policies/background_tab_loading_policy_helpers.h b/chrome/browser/performance_manager/graph/policies/background_tab_loading_policy_helpers.h
-deleted file mode 100644
-index fae53ab119bd..000000000000
---- a/chrome/browser/performance_manager/graph/policies/background_tab_loading_policy_helpers.h
-+++ /dev/null
-@@ -1,25 +0,0 @@
--// Copyright 2020 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 CHROME_BROWSER_PERFORMANCE_MANAGER_GRAPH_POLICIES_BACKGROUND_TAB_LOADING_POLICY_HELPERS_H_
--#define CHROME_BROWSER_PERFORMANCE_MANAGER_GRAPH_POLICIES_BACKGROUND_TAB_LOADING_POLICY_HELPERS_H_
--
--#include <stddef.h>
--
--namespace performance_manager {
--
--namespace policies {
--
--// Helper function for BackgroundTabLoadingPolicy to compute the number of
--// tabs that can load simultaneously.
--size_t CalculateMaxSimultaneousTabLoads(size_t lower_bound,
-- size_t upper_bound,
-- size_t cores_per_load,
-- size_t num_cores);
--
--} // namespace policies
--
--} // namespace performance_manager
--
--#endif // CHROME_BROWSER_PERFORMANCE_MANAGER_GRAPH_POLICIES_BACKGROUND_TAB_LOADING_POLICY_HELPERS_H_
-diff --git a/chrome/browser/performance_manager/graph/policies/background_tab_loading_policy_helpers_unittest.cc b/chrome/browser/performance_manager/graph/policies/background_tab_loading_policy_helpers_unittest.cc
-deleted file mode 100644
-index 4429a0e982f9..000000000000
---- a/chrome/browser/performance_manager/graph/policies/background_tab_loading_policy_helpers_unittest.cc
-+++ /dev/null
-@@ -1,54 +0,0 @@
--// Copyright 2020 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 "chrome/browser/performance_manager/graph/policies/background_tab_loading_policy_helpers.h"
--
--#include "testing/gtest/include/gtest/gtest.h"
--
--namespace performance_manager {
--
--namespace policies {
--
--namespace {
--
--class BackgroundTabLoadingPolicyHelpersTest : public ::testing::Test {};
--
--} // namespace
--
--TEST_F(BackgroundTabLoadingPolicyHelpersTest,
-- CalculateMaxSimultaneousTabLoads) {
-- // Test the lower bound is enforced.
-- EXPECT_EQ(10u, CalculateMaxSimultaneousTabLoads(
-- 10 /* lower_bound */, 20 /* upper_bound */,
-- 1 /* cores_per_load */, 1 /* cores */));
--
-- // Test the upper bound is enforced.
-- EXPECT_EQ(20u, CalculateMaxSimultaneousTabLoads(
-- 10 /* lower_bound */, 20 /* upper_bound */,
-- 1 /* cores_per_load */, 30 /* cores */));
--
-- // Test the per-core calculation is correct.
-- EXPECT_EQ(15u, CalculateMaxSimultaneousTabLoads(
-- 10 /* lower_bound */, 20 /* upper_bound */,
-- 1 /* cores_per_load */, 15 /* cores */));
-- EXPECT_EQ(15u, CalculateMaxSimultaneousTabLoads(
-- 10 /* lower_bound */, 20 /* upper_bound */,
-- 2 /* cores_per_load */, 30 /* cores */));
--
-- // If no per-core is specified then upper_bound is returned.
-- EXPECT_EQ(5u, CalculateMaxSimultaneousTabLoads(
-- 1 /* lower_bound */, 5 /* upper_bound */,
-- 0 /* cores_per_load */, 10 /* cores */));
--
-- // If no per-core and no upper_bound is applied, then "upper_bound" is
-- // returned.
-- EXPECT_EQ(
-- std::numeric_limits<size_t>::max(),
-- CalculateMaxSimultaneousTabLoads(3 /* lower_bound */, 0 /* upper_bound */,
-- 0 /* cores_per_load */, 4 /* cores */));
--}
--
--} // namespace policies
--
--} // namespace performance_manager
-diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
-index 2bce2f66a1ec..f7886e10f3eb 100644
---- a/chrome/test/BUILD.gn
-+++ b/chrome/test/BUILD.gn
-@@ -3991,7 +3991,6 @@ test("unit_tests") {
- "../browser/performance_manager/graph/policies/urgent_page_discarding_policy_unittest.cc",
-
- # Background tab loading from performance_manager isn't supported on Android.
-- "../browser/performance_manager/graph/policies/background_tab_loading_policy_helpers_unittest.cc",
- "../browser/performance_manager/graph/policies/background_tab_loading_policy_unittest.cc",
-
- # Android does not use the Message Center notification system.
---
-2.26.1
-