#include "chrome/common/notifications/notification_image_retainer.h"
#include <algorithm>
#include <set>
#include "base/containers/contains.h"
#include "base/files/file_enumerator.h"
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/memory/ref_counted_memory.h"
#include "base/numerics/safe_conversions.h"
#include "base/path_service.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/thread_pool.h"
#include "base/time/default_tick_clock.h"
#include "chrome/common/chrome_paths.h"
#include "ui/gfx/image/image.h"
namespace {
constexpr base::FilePath::CharType kImageRoot[] = …);
constexpr base::TimeDelta kDeletionDelay = …;
base::FilePath DetermineImageDirectory() { … }
std::vector<base::FilePath> GetFilesFromPrevSessions(
const base::FilePath& dir,
const std::set<base::FilePath>& registered_names) { … }
void DeleteFiles(std::vector<base::FilePath> paths) { … }
}
NotificationImageRetainer::NotificationImageRetainer(
scoped_refptr<base::SequencedTaskRunner> deletion_task_runner,
const base::TickClock* tick_clock)
: … { … }
NotificationImageRetainer::NotificationImageRetainer()
: … { … }
NotificationImageRetainer::~NotificationImageRetainer() { … }
void NotificationImageRetainer::CleanupFilesFromPrevSessions() { … }
base::FilePath NotificationImageRetainer::RegisterTemporaryImage(
const gfx::Image& image) { … }
base::OnceClosure NotificationImageRetainer::GetCleanupTask() { … }
void NotificationImageRetainer::DeleteExpiredFiles() { … }