chromium/components/offline_pages/core/background/initialize_store_task.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_BACKGROUND_INITIALIZE_STORE_TASK_H_
#define COMPONENTS_OFFLINE_PAGES_CORE_BACKGROUND_INITIALIZE_STORE_TASK_H_

#include <stdint.h>

#include "base/memory/raw_ptr.h"
#include "base/memory/weak_ptr.h"
#include "components/offline_pages/core/background/request_queue_store.h"
#include "components/offline_pages/task/task.h"

namespace offline_pages {

// Task performing a request queue store initialization and reset if one is
// necessary. Reset is triggered in case the initialization fails. If reset
// fails (perhaps not able to delete the folder or raze the database in case of
// SQLite-backed store) a new attempt can be made. Number of attempts is limited
// by |reset_attempts_left_|. Successful reset will be followed by another
// attempt to initialize the database.
//
// Task is completed when either the store is correctly initialized or there are
// not more reset attempts left.
class InitializeStoreTask : public Task {};

}  // namespace offline_pages

#endif  // COMPONENTS_OFFLINE_PAGES_CORE_BACKGROUND_INITIALIZE_STORE_TASK_H_