chromium/content/browser/background_fetch/storage/get_initialization_data_task.h

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

#ifndef CONTENT_BROWSER_BACKGROUND_FETCH_STORAGE_GET_INITIALIZATION_DATA_TASK_H_
#define CONTENT_BROWSER_BACKGROUND_FETCH_STORAGE_GET_INITIALIZATION_DATA_TASK_H_

#include <map>
#include <optional>
#include <string>
#include <vector>

#include "base/functional/callback.h"
#include "base/memory/scoped_refptr.h"
#include "content/browser/background_fetch/background_fetch_registration_id.h"
#include "content/browser/background_fetch/storage/database_task.h"
#include "content/browser/service_worker/service_worker_info.h"
#include "content/common/background_fetch/background_fetch_types.h"
#include "content/common/content_export.h"
#include "net/base/isolation_info.h"
#include "third_party/blink/public/common/service_worker/service_worker_status_code.h"
#include "third_party/blink/public/mojom/background_fetch/background_fetch.mojom.h"
#include "third_party/skia/include/core/SkBitmap.h"

namespace content {

class BackgroundFetchRequestInfo;

namespace background_fetch {

// All the information needed to create a JobController and resume the fetch
// after start-up.
struct CONTENT_EXPORT BackgroundFetchInitializationData {};

GetInitializationDataCallback;

// Gets all the data needed to resume fetches. The task starts by getting
// all the <ServiceWorker Registration ID, Background Fetch Unique ID>
// pairs available.
//    * TODO(crbug.com/41394781): Consider persisting which SWIDs contain BGF
//    info.
// Then for every Background Fetch Unique ID the required information is
// queried from the ServiceWorker Database to fill an instance of
// BackgroundFetchInitializationData.
//
// Note: All of this must run in one DatabaseTask, to ensure the
// BackgroundFetchContext is properly initialized with JobControllers before
// running any additional DatabaseTasks and reaching an incorrect state.
class GetInitializationDataTask : public DatabaseTask {};

}  // namespace background_fetch

}  // namespace content

#endif  // CONTENT_BROWSER_BACKGROUND_FETCH_STORAGE_GET_INITIALIZATION_DATA_TASK_H_