Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: chrome/browser/speech/speech_recognition_request.cc

Issue 6248026: Rename Real* to Double* in values.* and dependent files (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More renames Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/speech/speech_recognition_request.h" 5 #include "chrome/browser/speech/speech_recognition_request.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/json/json_reader.h" 9 #include "base/json/json_reader.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 const DictionaryValue* hypothesis_value = 84 const DictionaryValue* hypothesis_value =
85 static_cast<DictionaryValue*>(hypothesis); 85 static_cast<DictionaryValue*>(hypothesis);
86 string16 utterance; 86 string16 utterance;
87 if (!hypothesis_value->GetString(kUtteranceString, &utterance)) { 87 if (!hypothesis_value->GetString(kUtteranceString, &utterance)) {
88 LOG(WARNING) << "ParseServerResponse: Missing utterance value."; 88 LOG(WARNING) << "ParseServerResponse: Missing utterance value.";
89 break; 89 break;
90 } 90 }
91 91
92 // It is not an error if the 'confidence' field is missing. 92 // It is not an error if the 'confidence' field is missing.
93 double confidence = 0.0; 93 double confidence = 0.0;
94 hypothesis_value->GetReal(kConfidenceString, &confidence); 94 hypothesis_value->GetDouble(kConfidenceString, &confidence);
95 95
96 result->push_back(speech_input::SpeechInputResultItem(utterance, 96 result->push_back(speech_input::SpeechInputResultItem(utterance,
97 confidence)); 97 confidence));
98 } 98 }
99 99
100 if (index < hypotheses_list->GetSize()) { 100 if (index < hypotheses_list->GetSize()) {
101 result->clear(); 101 result->clear();
102 return false; 102 return false;
103 } 103 }
104 104
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 SpeechInputResultArray result; 188 SpeechInputResultArray result;
189 if (!error) 189 if (!error)
190 error = !ParseServerResponse(data, &result); 190 error = !ParseServerResponse(data, &result);
191 url_fetcher_.reset(); 191 url_fetcher_.reset();
192 192
193 DVLOG(1) << "SpeechRecognitionRequest: Invoking delegate with result."; 193 DVLOG(1) << "SpeechRecognitionRequest: Invoking delegate with result.";
194 delegate_->SetRecognitionResult(error, result); 194 delegate_->SetRecognitionResult(error, result);
195 } 195 }
196 196
197 } // namespace speech_input 197 } // namespace speech_input
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698