#include "chrome/browser/performance_manager/mechanisms/page_discarder.h"
#include <utility>
#include <vector>
#include "base/functional/bind.h"
#include "base/memory/weak_ptr.h"
#include "base/task/task_traits.h"
#include "build/build_config.h"
#include "chrome/browser/performance_manager/public/user_tuning/user_tuning_utils.h"
#include "chrome/browser/resource_coordinator/tab_lifecycle_unit.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "components/performance_manager/public/graph/page_node.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/web_contents.h"
namespace performance_manager {
namespace mechanism {
namespace {
bool disabled_for_testing = …;
WebContentsAndPmf;
std::vector<PageDiscarder::DiscardEvent> DiscardPagesOnUIThread(
const std::vector<WebContentsAndPmf>& web_contents_and_pmf,
resource_coordinator::LifecycleUnitDiscardReason discard_reason) { … }
}
void PageDiscarder::DisableForTesting() { … }
void PageDiscarder::DiscardPageNodes(
const std::vector<const PageNode*>& page_nodes,
resource_coordinator::LifecycleUnitDiscardReason discard_reason,
base::OnceCallback<void(const std::vector<DiscardEvent>&)>
post_discard_cb) { … }
}
}