chromium/components/performance_manager/graph/policies/process_priority_policy.cc

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

#include "components/performance_manager/graph/policies/process_priority_policy.h"

#include "base/feature_list.h"
#include "base/functional/bind.h"
#include "base/memory/ptr_util.h"
#include "components/performance_manager/public/features.h"
#include "components/performance_manager/public/render_process_host_proxy.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_process_host.h"

namespace performance_manager {
namespace policies {

namespace {

#if DCHECK_IS_ON()
size_t g_instance_count =;
#endif

// Used as a testing seam. If this is set then SetProcessPriorityOnUiThread will
// invoke the provided callback immediately after calling SetPriorityOverride on
// the RenderProcessHost.
ProcessPriorityPolicy::SetPriorityOnUiThreadCallback* g_callback =;

base::Process::Priority ToProcessPriority(base::TaskPriority priority) {}

// Helper function for setting the RenderProcessHost priority.
void SetProcessPriorityOnUIThread(RenderProcessHostProxy rph_proxy,
                                  base::Process::Priority priority) {}

// Dispatches a process priority change to the RenderProcessHost associated with
// a given ProcessNode. The task is posted to the UI thread, where the RPH
// lives.
void DispatchSetProcessPriority(const ProcessNode* process_node,
                                base::Process::Priority priority) {}

}  // namespace

ProcessPriorityPolicy::ProcessPriorityPolicy() {}

ProcessPriorityPolicy::~ProcessPriorityPolicy() {}

// static
void ProcessPriorityPolicy::SetCallbackForTesting(
    SetPriorityOnUiThreadCallback callback) {}

void ProcessPriorityPolicy::ClearCallbackForTesting() {}

void ProcessPriorityPolicy::OnPassedToGraph(Graph* graph) {}

void ProcessPriorityPolicy::OnTakenFromGraph(Graph* graph) {}

void ProcessPriorityPolicy::OnProcessNodeAdded(
    const ProcessNode* process_node) {}

void ProcessPriorityPolicy::OnPriorityChanged(
    const ProcessNode* process_node,
    base::TaskPriority previous_value) {}

}  // namespace policies
}  // namespace performance_manager