chromium/net/disk_cache/cache_util.cc

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

#include "net/disk_cache/cache_util.h"

#include <limits>

#include "base/files/file_enumerator.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/files/safe_base_name.h"
#include "base/functional/bind.h"
#include "base/location.h"
#include "base/metrics/field_trial_params.h"
#include "base/numerics/clamped_math.h"
#include "base/numerics/ostream_operators.h"
#include "base/strings/strcat.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/bind_post_task.h"
#include "base/task/thread_pool.h"
#include "base/threading/thread_restrictions.h"
#include "build/build_config.h"

namespace {

const int kMaxOldFolders =;

// Returns a fully qualified name from path and name, using a given name prefix
// and index number. For instance, if the arguments are "/foo", "bar" and 5, it
// will return "/foo/old_bar_005".
base::FilePath GetPrefixedName(const base::FilePath& path,
                               const base::SafeBaseName& basename,
                               int index) {}

base::FilePath GetTempCacheName(const base::FilePath& dirname,
                                const base::SafeBaseName& basename) {}

void CleanupTemporaryDirectories(const base::FilePath& path) {}

bool MoveDirectoryToTemporaryDirectory(const base::FilePath& path) {}

// In order to process a potentially large number of files, we'll rename the
// cache directory to old_ + original_name + number, (located on the same parent
// directory), and use a worker thread to delete all the files on all the stale
// cache directories. The whole process can still fail if we are not able to
// rename the cache directory (for instance due to a sharing violation), and in
// that case a cache for this profile (on the desired path) cannot be created.
bool CleanupDirectoryInternal(const base::FilePath& path) {}

int64_t PreferredCacheSizeInternal(int64_t available) {}

}  // namespace

namespace disk_cache {

const int kDefaultCacheSize =;

BASE_FEATURE();

void DeleteCache(const base::FilePath& path, bool remove_folder) {}

void CleanupDirectory(const base::FilePath& path,
                      base::OnceCallback<void(bool)> callback) {}

bool CleanupDirectorySync(const base::FilePath& path) {}

// Returns the preferred maximum number of bytes for the cache given the
// number of available bytes.
int PreferredCacheSize(int64_t available, net::CacheType type) {}

}  // namespace disk_cache