chromium/chrome/common/notifications/notification_image_retainer.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 "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[] =);

// How long to keep the temp files before deleting them. The formula for picking
// the delay is t * (n + 1), where t is the default on-screen display time for
// an Action Center notification (6 seconds) and n is the number of
// notifications that can be shown on-screen at once (1).
constexpr base::TimeDelta kDeletionDelay =;

// Returns the temporary directory within the user data directory. The regular
// temporary directory is not used to minimize the risk of files getting deleted
// by accident. It is also not profile-bound because the notification bridge
// is profile-agnostic.
base::FilePath DetermineImageDirectory() {}

// Returns the full paths to all immediate file and directory children of |dir|,
// excluding those present in |registered_names|.
std::vector<base::FilePath> GetFilesFromPrevSessions(
    const base::FilePath& dir,
    const std::set<base::FilePath>& registered_names) {}

// Deletes files in |paths|.
void DeleteFiles(std::vector<base::FilePath> paths) {}

}  // namespace

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() {}