chromium/components/offline_pages/core/model/clear_storage_task.cc

// Copyright 2017 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/offline_pages/core/model/clear_storage_task.h"

#include <algorithm>
#include <map>
#include <memory>
#include <string>
#include <utility>
#include <vector>

#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/memory/raw_ref.h"
#include "base/metrics/histogram_macros.h"
#include "base/time/time.h"
#include "base/trace_event/trace_event.h"
#include "components/offline_pages/core/model/delete_page_task.h"
#include "components/offline_pages/core/model/get_pages_task.h"
#include "components/offline_pages/core/offline_page_client_policy.h"
#include "components/offline_pages/core/offline_page_metadata_store.h"
#include "components/offline_pages/core/offline_store_utils.h"
#include "components/offline_pages/core/page_criteria.h"
#include "sql/database.h"
#include "sql/statement.h"
#include "sql/transaction.h"

namespace offline_pages {

ClearStorageResult;

namespace {

// Maximum % of total available storage that will be occupied by offline pages
// before a storage clearup.
const double kOfflinePageStorageLimit =;
// The target % of storage usage we try to reach below when expiring pages.
const double kOfflinePageStorageClearThreshold =;

class PageClearCriteria {};

std::vector<OfflinePageItem> GetPagesToClear(
    const base::Time& start_time,
    const ArchiveManager::StorageStats& stats,
    sql::Database* db) {}

std::pair<size_t, DeletePageResult> ClearPagesSync(
    const base::Time& start_time,
    const ArchiveManager::StorageStats& stats,
    sql::Database* db) {}

}  // namespace

ClearStorageTask::ClearStorageTask(OfflinePageMetadataStore* store,
                                   ArchiveManager* archive_manager,
                                   const base::Time& clearup_time,
                                   ClearStorageCallback callback)
    :{}

ClearStorageTask::~ClearStorageTask() {}

void ClearStorageTask::Run() {}

void ClearStorageTask::OnGetStorageStatsDone(
    const ArchiveManager::StorageStats& stats) {}

void ClearStorageTask::OnClearPagesDone(
    std::pair<size_t, DeletePageResult> result) {}

void ClearStorageTask::InformClearStorageDone(size_t pages_cleared,
                                              ClearStorageResult result) {}

}  // namespace offline_pages