chromium/content/browser/background_fetch/background_fetch_job_controller.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 "content/browser/background_fetch/background_fetch_job_controller.h"

#include <utility>

#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/not_fatal_until.h"
#include "content/browser/background_fetch/background_fetch_cross_origin_filter.h"
#include "content/browser/background_fetch/background_fetch_data_manager.h"
#include "content/browser/background_fetch/background_fetch_request_match_params.h"
#include "content/public/browser/browser_thread.h"
#include "services/network/public/cpp/cors/cors.h"
#include "services/network/public/cpp/is_potentially_trustworthy.h"
#include "third_party/blink/public/mojom/background_fetch/background_fetch.mojom.h"

namespace content {

namespace {

// Performs mixed content checks on the |request| for Background Fetch.
// Background Fetch depends on Service Workers, which are restricted for use
// on secure origins. We can therefore assume that the registration's origin
// is secure. This test ensures that the origin for the url of every
// request is also secure.
bool IsMixedContent(const BackgroundFetchRequestInfo& request) {}

// Whether the |request| needs CORS preflight.
// Requests that require CORS preflights are temporarily blocked, because the
// browser side of Background Fetch doesn't yet support performing CORS
// checks. TODO(crbug.com/40515511): Remove this temporary block.
bool RequiresCorsPreflight(const BackgroundFetchRequestInfo& request,
                           const url::Origin& origin) {}

}  // namespace

BackgroundFetchError;
BackgroundFetchFailureReason;

BackgroundFetchJobController::BackgroundFetchJobController(
    BackgroundFetchDataManager* data_manager,
    BackgroundFetchDelegateProxy* delegate_proxy,
    const BackgroundFetchRegistrationId& registration_id,
    blink::mojom::BackgroundFetchOptionsPtr options,
    const SkBitmap& icon,
    uint64_t bytes_downloaded,
    uint64_t bytes_uploaded,
    uint64_t upload_total,
    ProgressCallback progress_callback,
    FinishedCallback finished_callback)
    :{}

void BackgroundFetchJobController::InitializeRequestStatus(
    int completed_downloads,
    int total_downloads,
    std::vector<scoped_refptr<BackgroundFetchRequestInfo>>
        active_fetch_requests,
    bool start_paused,
    std::optional<net::IsolationInfo> isolation_info) {}

BackgroundFetchJobController::~BackgroundFetchJobController() {}

bool BackgroundFetchJobController::HasMoreRequests() {}

void BackgroundFetchJobController::StartRequest(
    scoped_refptr<BackgroundFetchRequestInfo> request,
    RequestFinishedCallback request_finished_callback) {}

void BackgroundFetchJobController::DidStartRequest(
    const std::string& guid,
    std::unique_ptr<BackgroundFetchResponse> response) {}

void BackgroundFetchJobController::DidUpdateRequest(const std::string& guid,
                                                    uint64_t bytes_uploaded,
                                                    uint64_t bytes_downloaded) {}

void BackgroundFetchJobController::DidCompleteRequest(
    const std::string& guid,
    std::unique_ptr<BackgroundFetchResult> result) {}

blink::mojom::BackgroundFetchRegistrationDataPtr
BackgroundFetchJobController::NewRegistrationData() const {}

uint64_t BackgroundFetchJobController::GetInProgressDownloadedBytes() {}

uint64_t BackgroundFetchJobController::GetInProgressUploadedBytes() {}

void BackgroundFetchJobController::AbortFromDelegate(
    BackgroundFetchFailureReason failure_reason) {}

void BackgroundFetchJobController::Abort(
    BackgroundFetchFailureReason failure_reason,
    ErrorCallback callback) {}

void BackgroundFetchJobController::Finish(
    BackgroundFetchFailureReason reason_to_abort,
    ErrorCallback callback) {}

void BackgroundFetchJobController::PopNextRequest(
    RequestStartedCallback request_started_callback,
    RequestFinishedCallback request_finished_callback) {}

void BackgroundFetchJobController::DidPopNextRequest(
    RequestStartedCallback request_started_callback,
    RequestFinishedCallback request_finished_callback,
    BackgroundFetchError error,
    scoped_refptr<BackgroundFetchRequestInfo> request_info) {}

void BackgroundFetchJobController::MarkRequestAsComplete(
    scoped_refptr<BackgroundFetchRequestInfo> request_info) {}

void BackgroundFetchJobController::DidMarkRequestAsComplete(
    BackgroundFetchError error) {}

void BackgroundFetchJobController::NotifyDownloadComplete(
    scoped_refptr<BackgroundFetchRequestInfo> request) {}

void BackgroundFetchJobController::GetUploadData(
    const std::string& guid,
    BackgroundFetchDelegate::GetUploadDataCallback callback) {}

void BackgroundFetchJobController::DidGetUploadData(
    BackgroundFetchDelegate::GetUploadDataCallback callback,
    BackgroundFetchError error,
    blink::mojom::SerializedBlobPtr blob) {}

}  // namespace content