#include "content/browser/speech/speech_recognition_dispatcher_host.h"
#include <memory>
#include "base/command_line.h"
#include "base/functional/bind.h"
#include "base/lazy_instance.h"
#include "content/browser/renderer_host/frame_tree_node.h"
#include "content/browser/renderer_host/render_frame_host_manager.h"
#include "content/browser/speech/speech_recognition_manager_impl.h"
#include "content/browser/speech/speech_recognition_session.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/speech_recognition_audio_forwarder_config.h"
#include "content/public/browser/speech_recognition_manager_delegate.h"
#include "content/public/browser/speech_recognition_session_config.h"
#include "content/public/browser/speech_recognition_session_context.h"
#include "content/public/browser/storage_partition.h"
#include "content/public/common/content_client.h"
#include "content/public/common/content_switches.h"
#include "media/mojo/mojom/speech_recognizer.mojom.h"
#include "mojo/public/cpp/bindings/message.h"
#include "mojo/public/cpp/bindings/self_owned_receiver.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
namespace content {
SpeechRecognitionDispatcherHost::SpeechRecognitionDispatcherHost(
int render_process_id,
int render_frame_id)
: … { … }
void SpeechRecognitionDispatcherHost::Create(
int render_process_id,
int render_frame_id,
mojo::PendingReceiver<media::mojom::SpeechRecognizer> receiver) { … }
SpeechRecognitionDispatcherHost::~SpeechRecognitionDispatcherHost() { … }
base::WeakPtr<SpeechRecognitionDispatcherHost>
SpeechRecognitionDispatcherHost::AsWeakPtr() { … }
void SpeechRecognitionDispatcherHost::Start(
media::mojom::StartSpeechRecognitionRequestParamsPtr params) { … }
void SpeechRecognitionDispatcherHost::StartRequestOnUI(
base::WeakPtr<SpeechRecognitionDispatcherHost>
speech_recognition_dispatcher_host,
int render_process_id,
int render_frame_id,
media::mojom::StartSpeechRecognitionRequestParamsPtr params) { … }
void SpeechRecognitionDispatcherHost::StartSessionOnIO(
media::mojom::StartSpeechRecognitionRequestParamsPtr params,
int embedder_render_process_id,
int embedder_render_frame_id,
const url::Origin& origin,
std::unique_ptr<network::PendingSharedURLLoaderFactory>
pending_shared_url_loader_factory,
const std::string& accept_language) { … }
}