chromium/chrome/browser/ui/task_manager/task_manager_table_model.cc

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

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "chrome/browser/ui/task_manager/task_manager_table_model.h"

#include <stddef.h>

#include <string>
#include <vector>

#include "base/command_line.h"
#include "base/i18n/number_formatting.h"
#include "base/i18n/rtl.h"
#include "base/i18n/time_formatting.h"
#include "base/process/process_handle.h"
#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
#include "build/build_config.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/task_manager/task_manager_interface.h"
#include "chrome/browser/ui/task_manager/task_manager_columns.h"
#include "chrome/common/pref_names.h"
#include "chrome/grit/generated_resources.h"
#include "components/nacl/browser/nacl_browser.h"
#include "components/nacl/common/buildflags.h"
#include "components/nacl/common/nacl_switches.h"
#include "components/prefs/scoped_user_pref_update.h"
#include "content/public/common/result_codes.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/models/image_model.h"
#include "ui/base/models/table_model_observer.h"
#include "ui/base/text/bytes_formatting.h"

namespace task_manager {

namespace {

const char kCpuTextFormatString[] =;

#if BUILDFLAG(IS_MAC)
// Match Activity Monitor's default refresh rate.
const int64_t kRefreshTimeMS = 2000;
#else
const int64_t kRefreshTimeMS =;
#endif  // BUILDFLAG(IS_MAC)

// The columns that are shared by a group will show the value of the column
// only once per group.
bool IsSharedByGroup(int column_id) {}

// Used to sort various column values.
template <class T>
int ValueCompare(T value1, T value2) {}

// This forces NaN values to the bottom of the table.
template <>
int ValueCompare(double value1, double value2) {}

// This is used to sort process priority. We want the backgrounded process (with
// a true value) to come first.
int BooleanCompare(bool value1, bool value2) {}

// Used when one or both of the results to compare are unavailable.
int OrderUnavailableValue(bool v1, bool v2) {}

}  // namespace

// A class to stringify the task manager's values into string16s and to
// cache the common strings that will be reused many times like "N/A" and so on.
class TaskManagerValuesStringifier {};

////////////////////////////////////////////////////////////////////////////////
// TableSortDescriptor:
////////////////////////////////////////////////////////////////////////////////

TableSortDescriptor::TableSortDescriptor()
    :{}

TableSortDescriptor::TableSortDescriptor(int col_id, bool ascending)
    :{}

////////////////////////////////////////////////////////////////////////////////
// TaskManagerTableModel:
////////////////////////////////////////////////////////////////////////////////

TaskManagerTableModel::TaskManagerTableModel(TableViewDelegate* delegate)
    :{}

TaskManagerTableModel::~TaskManagerTableModel() {}

size_t TaskManagerTableModel::RowCount() {}

std::u16string TaskManagerTableModel::GetText(size_t row, int column) {}

ui::ImageModel TaskManagerTableModel::GetIcon(size_t row) {}

void TaskManagerTableModel::SetObserver(
    ui::TableModelObserver* observer) {}

int TaskManagerTableModel::CompareValues(size_t row1,
                                         size_t row2,
                                         int column_id) {}

void TaskManagerTableModel::GetRowsGroupRange(size_t row_index,
                                              size_t* out_start,
                                              size_t* out_length) {}

void TaskManagerTableModel::OnTaskAdded(TaskId id) {}

void TaskManagerTableModel::OnTaskToBeRemoved(TaskId id) {}

void TaskManagerTableModel::OnTasksRefreshed(
    const TaskIdList& task_ids) {}

void TaskManagerTableModel::OnActiveTaskFetched(TaskId id) {}

void TaskManagerTableModel::ActivateTask(size_t row_index) {}

void TaskManagerTableModel::KillTask(size_t row_index) {}

void TaskManagerTableModel::UpdateRefreshTypes(int column_id, bool visibility) {}

bool TaskManagerTableModel::IsTaskKillable(size_t row_index) const {}

void TaskManagerTableModel::RetrieveSavedColumnsSettingsAndUpdateTable() {}

void TaskManagerTableModel::StoreColumnsSettings() {}

void TaskManagerTableModel::ToggleColumnVisibility(int column_id) {}

std::optional<size_t> TaskManagerTableModel::GetRowForWebContents(
    content::WebContents* web_contents) {}

std::optional<size_t> TaskManagerTableModel::GetRowForActiveTask() {}

void TaskManagerTableModel::StartUpdating() {}

void TaskManagerTableModel::StopUpdating() {}

void TaskManagerTableModel::OnRefresh() {}

bool TaskManagerTableModel::IsTaskFirstInGroup(size_t row_index) const {}

}  // namespace task_manager