chromium/components/offline_pages/core/snapshot_controller.h

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

#ifndef COMPONENTS_OFFLINE_PAGES_CORE_SNAPSHOT_CONTROLLER_H_
#define COMPONENTS_OFFLINE_PAGES_CORE_SNAPSHOT_CONTROLLER_H_

#include "base/memory/raw_ptr.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/task/single_thread_task_runner.h"

namespace offline_pages {

// Takes various signals and produces StartSnapshot calls following a specific
// policy. Can request snapshots multiple times per 'session'. Session can be
// ended and another one started by calling Reset().
// Main invariants:
// - It never starts overlapping snapshots, Client reports when previous
//   snapshot is done.
// - The currently worked on (pending) snapshot is always allowed to complete,
//   the new attempts to start a snapshot are ignored until it does.
// - Some signals prevent more snapshots to be taken.
//   OnLoad is currently such signal.
// - Once Reset() is called on the SnapshotController, the delayed tasks are
//   reset so no StartSnapshot calls is made 'cross-session'.
class SnapshotController {};

}  // namespace offline_pages

#endif  // COMPONENTS_OFFLINE_PAGES_CORE_SNAPSHOT_CONTROLLER_H_