| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * * Redistributions of source code must retain the above copyright | 7 * * Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * * Redistributions in binary form must reproduce the above copyright | 9 * * Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 private_ = other.private_; | 37 private_ = other.private_; |
| 38 } | 38 } |
| 39 | 39 |
| 40 void WebSpeechRecognitionResult::Assign(const WebVector<WebString>& transcripts, | 40 void WebSpeechRecognitionResult::Assign(const WebVector<WebString>& transcripts, |
| 41 const WebVector<float>& confidences, | 41 const WebVector<float>& confidences, |
| 42 bool final) { | 42 bool final) { |
| 43 DCHECK_EQ(transcripts.size(), confidences.size()); | 43 DCHECK_EQ(transcripts.size(), confidences.size()); |
| 44 | 44 |
| 45 HeapVector<Member<SpeechRecognitionAlternative>> alternatives( | 45 HeapVector<Member<SpeechRecognitionAlternative>> alternatives( |
| 46 transcripts.size()); | 46 transcripts.size()); |
| 47 for (size_t i = 0; i < transcripts.size(); ++i) | 47 for (size_t i = 0; i < transcripts.size(); ++i) { |
| 48 alternatives[i] = | 48 alternatives[i] = |
| 49 SpeechRecognitionAlternative::Create(transcripts[i], confidences[i]); | 49 SpeechRecognitionAlternative::Create(transcripts[i], confidences[i]); |
| 50 } |
| 50 | 51 |
| 51 private_ = SpeechRecognitionResult::Create(alternatives, final); | 52 private_ = SpeechRecognitionResult::Create(alternatives, final); |
| 52 } | 53 } |
| 53 | 54 |
| 54 void WebSpeechRecognitionResult::Reset() { | 55 void WebSpeechRecognitionResult::Reset() { |
| 55 private_.Reset(); | 56 private_.Reset(); |
| 56 } | 57 } |
| 57 | 58 |
| 58 WebSpeechRecognitionResult::operator SpeechRecognitionResult*() const { | 59 WebSpeechRecognitionResult::operator SpeechRecognitionResult*() const { |
| 59 return private_.Get(); | 60 return private_.Get(); |
| 60 } | 61 } |
| 61 | 62 |
| 62 } // namespace blink | 63 } // namespace blink |
| OLD | NEW |