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

Unified Diff: content/renderer/media/speech_recognition_audio_sink_unittest.cc

Issue 649613002: Binding media stream audio track to speech recognition - bugfix (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/valgrind/drmemory/suppressions_full.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/speech_recognition_audio_sink_unittest.cc
diff --git a/content/renderer/media/speech_recognition_audio_sink_unittest.cc b/content/renderer/media/speech_recognition_audio_sink_unittest.cc
index 917b6a2f828688e3dfa5da10f864eadf689d4261..e9b0d32cd4957801bddace3d43d53a3000bf2165 100644
--- a/content/renderer/media/speech_recognition_audio_sink_unittest.cc
+++ b/content/renderer/media/speech_recognition_audio_sink_unittest.cc
@@ -116,11 +116,12 @@ class FakeSpeechRecognizer {
const media::AudioParameters& sink_params,
base::SharedMemoryHandle* foreign_memory_handle) {
// Shared memory is allocated, mapped and shared.
- uint32 shared_memory_size =
+ const uint32 kSharedMemorySize =
sizeof(media::AudioInputBufferParameters) +
media::AudioBus::CalculateMemorySize(sink_params);
shared_memory_.reset(new base::SharedMemory());
- ASSERT_TRUE(shared_memory_->CreateAndMapAnonymous(shared_memory_size));
+ ASSERT_TRUE(shared_memory_->CreateAndMapAnonymous(kSharedMemorySize));
+ memset(shared_memory_->memory(), 0, kSharedMemorySize);
ASSERT_TRUE(shared_memory_->ShareToProcess(base::GetCurrentProcessHandle(),
foreign_memory_handle));
« no previous file with comments | « no previous file | tools/valgrind/drmemory/suppressions_full.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698