OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/renderer/speech_recognition_dispatcher.h" | 5 #include "content/renderer/speech_recognition_dispatcher.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 const base::SyncSocket::TransitDescriptor descriptor) { | 265 const base::SyncSocket::TransitDescriptor descriptor) { |
266 #if defined(ENABLE_WEBRTC) | 266 #if defined(ENABLE_WEBRTC) |
267 DCHECK(!speech_audio_sink_.get()); | 267 DCHECK(!speech_audio_sink_.get()); |
268 if (audio_track_.isNull()) { | 268 if (audio_track_.isNull()) { |
269 ResetAudioSink(); | 269 ResetAudioSink(); |
270 return; | 270 return; |
271 } | 271 } |
272 | 272 |
273 // The instantiation and type of SyncSocket is up to the client since it | 273 // The instantiation and type of SyncSocket is up to the client since it |
274 // is dependency injected to the SpeechRecognitionAudioSink. | 274 // is dependency injected to the SpeechRecognitionAudioSink. |
275 scoped_ptr<base::SyncSocket> socket(new base::CancelableSyncSocket( | 275 std::unique_ptr<base::SyncSocket> socket(new base::CancelableSyncSocket( |
276 base::SyncSocket::UnwrapHandle(descriptor))); | 276 base::SyncSocket::UnwrapHandle(descriptor))); |
277 | 277 |
278 speech_audio_sink_.reset(new SpeechRecognitionAudioSink( | 278 speech_audio_sink_.reset(new SpeechRecognitionAudioSink( |
279 audio_track_, params, memory, std::move(socket), | 279 audio_track_, params, memory, std::move(socket), |
280 base::Bind(&SpeechRecognitionDispatcher::ResetAudioSink, | 280 base::Bind(&SpeechRecognitionDispatcher::ResetAudioSink, |
281 base::Unretained(this)))); | 281 base::Unretained(this)))); |
282 #endif | 282 #endif |
283 } | 283 } |
284 | 284 |
285 int SpeechRecognitionDispatcher::GetOrCreateIDForHandle( | 285 int SpeechRecognitionDispatcher::GetOrCreateIDForHandle( |
(...skipping 30 matching lines...) Expand all Loading... |
316 } | 316 } |
317 | 317 |
318 const WebSpeechRecognitionHandle& SpeechRecognitionDispatcher::GetHandleFromID( | 318 const WebSpeechRecognitionHandle& SpeechRecognitionDispatcher::GetHandleFromID( |
319 int request_id) { | 319 int request_id) { |
320 HandleMap::iterator iter = handle_map_.find(request_id); | 320 HandleMap::iterator iter = handle_map_.find(request_id); |
321 CHECK(iter != handle_map_.end()); | 321 CHECK(iter != handle_map_.end()); |
322 return iter->second; | 322 return iter->second; |
323 } | 323 } |
324 | 324 |
325 } // namespace content | 325 } // namespace content |
OLD | NEW |