#include "content/browser/background_fetch/background_fetch_service_impl.h"
#include <memory>
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/uuid.h"
#include "content/browser/background_fetch/background_fetch_context.h"
#include "content/browser/background_fetch/background_fetch_metrics.h"
#include "content/browser/background_fetch/background_fetch_registration_id.h"
#include "content/browser/background_fetch/background_fetch_registration_notifier.h"
#include "content/browser/background_fetch/background_fetch_request_match_params.h"
#include "content/browser/bad_message.h"
#include "content/browser/renderer_host/render_frame_host_impl.h"
#include "content/browser/storage_partition_impl.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/service_worker_version_base_info.h"
#include "content/public/browser/web_contents.h"
#include "mojo/public/cpp/bindings/self_owned_receiver.h"
#include "third_party/blink/public/common/storage_key/storage_key.h"
#include "third_party/blink/public/mojom/fetch/fetch_api_request.mojom.h"
namespace content {
namespace {
constexpr size_t kMaxDeveloperIdLength = …;
}
void BackgroundFetchServiceImpl::CreateForWorker(
const net::NetworkIsolationKey& network_isolation_key,
const ServiceWorkerVersionBaseInfo& info,
mojo::PendingReceiver<blink::mojom::BackgroundFetchService> receiver) { … }
void BackgroundFetchServiceImpl::CreateForFrame(
RenderFrameHost* render_frame_host,
mojo::PendingReceiver<blink::mojom::BackgroundFetchService> receiver) { … }
BackgroundFetchServiceImpl::BackgroundFetchServiceImpl(
scoped_refptr<BackgroundFetchContext> background_fetch_context,
blink::StorageKey storage_key,
net::IsolationInfo isolation_info,
RenderProcessHost* rph,
RenderFrameHostImpl* rfh)
: … { … }
BackgroundFetchServiceImpl::~BackgroundFetchServiceImpl() { … }
void BackgroundFetchServiceImpl::Fetch(
int64_t service_worker_registration_id,
const std::string& developer_id,
std::vector<blink::mojom::FetchAPIRequestPtr> requests,
blink::mojom::BackgroundFetchOptionsPtr options,
const SkBitmap& icon,
blink::mojom::BackgroundFetchUkmDataPtr ukm_data,
FetchCallback callback) { … }
void BackgroundFetchServiceImpl::GetIconDisplaySize(
blink::mojom::BackgroundFetchService::GetIconDisplaySizeCallback callback) { … }
void BackgroundFetchServiceImpl::GetRegistration(
int64_t service_worker_registration_id,
const std::string& developer_id,
GetRegistrationCallback callback) { … }
void BackgroundFetchServiceImpl::GetDeveloperIds(
int64_t service_worker_registration_id,
GetDeveloperIdsCallback callback) { … }
bool BackgroundFetchServiceImpl::ValidateDeveloperId(
const std::string& developer_id) { … }
bool BackgroundFetchServiceImpl::ValidateUniqueId(
const std::string& unique_id) { … }
bool BackgroundFetchServiceImpl::ValidateRequests(
const std::vector<blink::mojom::FetchAPIRequestPtr>& requests) { … }
}