From c30a6232df03e1efbd9f3b226777b07e087a1122 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 12 Oct 2020 14:27:29 +0200 Subject: BASELINE: Update Chromium to 85.0.4183.140 Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057 Reviewed-by: Allan Sandfeld Jensen --- chromium/components/speech/downstream_loader.h | 46 ++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 chromium/components/speech/downstream_loader.h (limited to 'chromium/components/speech/downstream_loader.h') diff --git a/chromium/components/speech/downstream_loader.h b/chromium/components/speech/downstream_loader.h new file mode 100644 index 00000000000..f6682a7f8be --- /dev/null +++ b/chromium/components/speech/downstream_loader.h @@ -0,0 +1,46 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_SPEECH_DOWNSTREAM_LOADER_H_ +#define COMPONENTS_SPEECH_DOWNSTREAM_LOADER_H_ + +#include + +#include "base/callback_forward.h" +#include "base/strings/string_piece.h" +#include "services/network/public/cpp/resource_request.h" +#include "services/network/public/cpp/simple_url_loader.h" +#include "services/network/public/cpp/simple_url_loader_stream_consumer.h" + +namespace speech { + +class DownstreamLoaderClient; + +// Streams response data from the server to the DownstreamLoaderClient. +class DownstreamLoader : public network::SimpleURLLoaderStreamConsumer { + public: + DownstreamLoader(std::unique_ptr resource_request, + net::NetworkTrafficAnnotationTag upstream_traffic_annotation, + network::mojom::URLLoaderFactory* url_loader_factory, + DownstreamLoaderClient* downstream_loader_client); + DownstreamLoader(const DownstreamLoader&) = delete; + DownstreamLoader& operator=(const DownstreamLoader&) = delete; + ~DownstreamLoader() override; + + // SimpleURLLoaderStreamConsumer implementation: + void OnDataReceived(base::StringPiece string_piece, + base::OnceClosure resume) override; + void OnComplete(bool success) override; + void OnRetry(base::OnceClosure start_retry) override; + + private: + // The DownstreamLoaderClient must outlive the DownstreamLoader. + DownstreamLoaderClient* const downstream_loader_client_; + + std::unique_ptr simple_url_loader_; +}; + +} // namespace speech + +#endif // COMPONENTS_SPEECH_DOWNSTREAM_LOADER_H_ -- cgit v1.2.1