#include "components/pdf/browser/plugin_response_writer.h"
#include <memory>
#include <string>
#include <utility>
#include "base/check_op.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/memory/scoped_refptr.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "components/pdf/browser/pdf_stream_delegate.h"
#include "mojo/public/c/system/types.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/system/data_pipe.h"
#include "mojo/public/cpp/system/data_pipe_producer.h"
#include "mojo/public/cpp/system/string_data_source.h"
#include "net/base/net_errors.h"
#include "net/http/http_response_headers.h"
#include "pdf/pdf_features.h"
#include "services/network/public/cpp/url_loader_completion_status.h"
#include "services/network/public/mojom/url_loader.mojom.h"
#include "services/network/public/mojom/url_response_head.mojom.h"
#include "url/gurl.h"
namespace pdf {
namespace {
std::string GenerateResponse(const PdfStreamDelegate::StreamInfo& stream_info) { … }
}
PluginResponseWriter::PluginResponseWriter(
const PdfStreamDelegate::StreamInfo& stream_info,
mojo::PendingRemote<network::mojom::URLLoaderClient> client)
: … { … }
PluginResponseWriter::~PluginResponseWriter() = default;
void PluginResponseWriter::Start(base::OnceClosure done_callback) { … }
void PluginResponseWriter::OnWrite(base::OnceClosure done_callback,
MojoResult result) { … }
}