| Index: chrome/browser/speech/speech_recognition_request.cc
|
| diff --git a/chrome/browser/speech/speech_recognition_request.cc b/chrome/browser/speech/speech_recognition_request.cc
|
| index b1234b04f5d5b32719bae0d76a70bf28e176c859..a97b9ac700d8565d132814cdefc2ce03174e2526 100644
|
| --- a/chrome/browser/speech/speech_recognition_request.cc
|
| +++ b/chrome/browser/speech/speech_recognition_request.cc
|
| @@ -120,11 +120,10 @@ SpeechRecognitionRequest::SpeechRecognitionRequest(
|
|
|
| SpeechRecognitionRequest::~SpeechRecognitionRequest() {}
|
|
|
| -bool SpeechRecognitionRequest::Send(const std::string& language,
|
| - const std::string& grammar,
|
| - const std::string& hardware_info,
|
| - const std::string& content_type,
|
| - const std::string& audio_data) {
|
| +void SpeechRecognitionRequest::Start(const std::string& language,
|
| + const std::string& grammar,
|
| + const std::string& hardware_info,
|
| + const std::string& content_type) {
|
| DCHECK(!url_fetcher_.get());
|
|
|
| std::vector<std::string> parts;
|
| @@ -158,7 +157,7 @@ bool SpeechRecognitionRequest::Send(const std::string& language,
|
| url,
|
| URLFetcher::POST,
|
| this));
|
| - url_fetcher_->set_upload_data(content_type, audio_data);
|
| + url_fetcher_->set_chunked_transfer_upload(content_type);
|
| url_fetcher_->set_request_context(url_context_);
|
|
|
| // The speech recognition API does not require user identification as part
|
| @@ -169,7 +168,16 @@ bool SpeechRecognitionRequest::Send(const std::string& language,
|
| net::LOAD_DO_NOT_SAVE_COOKIES | net::LOAD_DO_NOT_SEND_COOKIES |
|
| net::LOAD_DO_NOT_SEND_AUTH_DATA);
|
| url_fetcher_->Start();
|
| - return true;
|
| +}
|
| +
|
| +void SpeechRecognitionRequest::UploadAudioChunk(const std::string& audio_data) {
|
| + DCHECK(url_fetcher_.get());
|
| + url_fetcher_->AppendChunkToUpload(audio_data);
|
| +}
|
| +
|
| +void SpeechRecognitionRequest::FinishAudioUpload() {
|
| + DCHECK(url_fetcher_.get());
|
| + url_fetcher_->MarkEndOfChunks();
|
| }
|
|
|
| void SpeechRecognitionRequest::OnURLFetchComplete(
|
|
|