#include "content/browser/data_url_loader_factory.h"
#include <string_view>
#include "base/memory/ref_counted.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "mojo/public/cpp/system/data_pipe_producer.h"
#include "mojo/public/cpp/system/string_data_source.h"
#include "net/base/data_url.h"
#include "net/base/net_errors.h"
#include "net/http/http_response_headers.h"
#include "services/network/public/cpp/resource_request.h"
#include "services/network/public/mojom/url_loader.mojom.h"
#include "services/network/public/mojom/url_response_head.mojom.h"
namespace content {
namespace {
struct WriteData { … };
void OnWrite(std::unique_ptr<WriteData> write_data, MojoResult result) { … }
}
DataURLLoaderFactory::DataURLLoaderFactory(
const GURL& url,
mojo::PendingReceiver<network::mojom::URLLoaderFactory> factory_receiver)
: … { … }
DataURLLoaderFactory::~DataURLLoaderFactory() = default;
void DataURLLoaderFactory::CreateLoaderAndStart(
mojo::PendingReceiver<network::mojom::URLLoader> loader,
int32_t request_id,
uint32_t options,
const network::ResourceRequest& request,
mojo::PendingRemote<network::mojom::URLLoaderClient> client,
const net::MutableNetworkTrafficAnnotationTag& traffic_annotation) { … }
mojo::PendingRemote<network::mojom::URLLoaderFactory>
DataURLLoaderFactory::Create() { … }
mojo::PendingRemote<network::mojom::URLLoaderFactory>
DataURLLoaderFactory::CreateForOneSpecificUrl(const GURL& url) { … }
}