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

Side by Side Diff: ppapi/proxy/audio_input_resource.cc

Issue 915403003: Enable size_t to int truncation warnings in PPAPI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
OLDNEW
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 "ppapi/proxy/audio_input_resource.h" 5 #include "ppapi/proxy/audio_input_resource.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "ipc/ipc_platform_file.h" 9 #include "ipc/ipc_platform_file.h"
10 #include "media/audio/audio_parameters.h" 10 #include "media/audio/audio_parameters.h"
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 audio_input_thread_.reset(); 242 audio_input_thread_.reset();
243 } 243 }
244 } 244 }
245 245
246 void AudioInputResource::Run() { 246 void AudioInputResource::Run() {
247 // The shared memory represents AudioInputBufferParameters and the actual data 247 // The shared memory represents AudioInputBufferParameters and the actual data
248 // buffer stored as an audio bus. 248 // buffer stored as an audio bus.
249 media::AudioInputBuffer* buffer = 249 media::AudioInputBuffer* buffer =
250 static_cast<media::AudioInputBuffer*>(shared_memory_->memory()); 250 static_cast<media::AudioInputBuffer*>(shared_memory_->memory());
251 const uint32_t audio_bus_size_bytes = 251 const uint32_t audio_bus_size_bytes =
252 shared_memory_size_ - sizeof(media::AudioInputBufferParameters); 252 static_cast<uint32_t>(shared_memory_size_ -
253 sizeof(media::AudioInputBufferParameters));
253 254
254 while (true) { 255 while (true) {
255 int pending_data = 0; 256 int pending_data = 0;
256 size_t bytes_read = socket_->Receive(&pending_data, sizeof(pending_data)); 257 size_t bytes_read = socket_->Receive(&pending_data, sizeof(pending_data));
257 if (bytes_read != sizeof(pending_data)) { 258 if (bytes_read != sizeof(pending_data)) {
258 DCHECK_EQ(bytes_read, 0U); 259 DCHECK_EQ(bytes_read, 0U);
259 break; 260 break;
260 } 261 }
261 if (pending_data < 0) 262 if (pending_data < 0)
262 break; 263 break;
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 device_id, enter_config.object()->GetSampleRate(), 330 device_id, enter_config.object()->GetSampleRate(),
330 enter_config.object()->GetSampleFrameCount()); 331 enter_config.object()->GetSampleFrameCount());
331 Call<PpapiPluginMsg_AudioInput_OpenReply>( 332 Call<PpapiPluginMsg_AudioInput_OpenReply>(
332 RENDERER, msg, 333 RENDERER, msg,
333 base::Bind(&AudioInputResource::OnPluginMsgOpenReply, 334 base::Bind(&AudioInputResource::OnPluginMsgOpenReply,
334 base::Unretained(this))); 335 base::Unretained(this)));
335 return PP_OK_COMPLETIONPENDING; 336 return PP_OK_COMPLETIONPENDING;
336 } 337 }
337 } // namespace proxy 338 } // namespace proxy
338 } // namespace ppapi 339 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698