chromium/components/image_fetcher/core/image_data_fetcher.cc

// 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.

#include "components/image_fetcher/core/image_data_fetcher.h"

#include <utility>

#include "base/functional/bind.h"
#include "base/not_fatal_until.h"
#include "components/image_fetcher/core/image_fetcher_metrics_reporter.h"
#include "net/base/data_url.h"
#include "net/base/load_flags.h"
#include "net/http/http_response_headers.h"
#include "net/http/http_status_code.h"
#include "services/network/public/cpp/resource_request.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
#include "services/network/public/cpp/simple_url_loader.h"
#include "services/network/public/mojom/url_response_head.mojom.h"
#include "url/gurl.h"
#include "url/url_constants.h"

namespace {

const char kContentLocationHeader[] =;
const char kNoUmaClient[] =;

const int kDownloadTimeoutSeconds =;

}  // namespace

namespace image_fetcher {

// An active image URL fetcher request. The struct contains the related requests
// state.
struct ImageDataFetcher::ImageDataFetcherRequest {};

ImageDataFetcher::ImageDataFetcher(
    scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory)
    :{}

ImageDataFetcher::~ImageDataFetcher() {}

void ImageDataFetcher::SetImageDownloadLimit(
    std::optional<int64_t> max_download_bytes) {}

void ImageDataFetcher::FetchImageData(const GURL& image_url,
                                      ImageDataFetcherCallback callback,
                                      ImageFetcherParams params,
                                      bool send_cookies) {}

void ImageDataFetcher::FetchImageData(
    const GURL& image_url,
    ImageDataFetcherCallback callback,
    const net::NetworkTrafficAnnotationTag& traffic_annotation,
    bool send_cookies) {}

void ImageDataFetcher::FetchImageData(
    const GURL& image_url,
    ImageDataFetcherCallback callback,
    const std::string& referrer,
    net::ReferrerPolicy referrer_policy,
    const net::NetworkTrafficAnnotationTag& traffic_annotation,
    bool send_cookies) {}

void ImageDataFetcher::FetchImageData(const GURL& image_url,
                                      ImageDataFetcherCallback callback,
                                      ImageFetcherParams params,
                                      const std::string& referrer,
                                      net::ReferrerPolicy referrer_policy,
                                      bool send_cookies) {}

void ImageDataFetcher::OnURLLoaderComplete(
    const network::SimpleURLLoader* source,
    ImageFetcherParams params,
    std::unique_ptr<std::string> response_body) {}

void ImageDataFetcher::FinishRequest(const network::SimpleURLLoader* source,
                                     const RequestMetadata& metadata,
                                     const std::string& image_data) {}

void ImageDataFetcher::InjectResultForTesting(const RequestMetadata& metadata,
                                              const std::string& image_data) {}

}  // namespace image_fetcher