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

Unified 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: ppapi_unittests win x64 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/ppapi_tests.gypi ('k') | ppapi/proxy/device_enumeration_resource_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/audio_input_resource.cc
diff --git a/ppapi/proxy/audio_input_resource.cc b/ppapi/proxy/audio_input_resource.cc
index 7f1f81983e6ae77d4f5acd52ae537ab67204ea01..4a24255226f9fca2ccba1ceeae1f76d197dfe0e8 100644
--- a/ppapi/proxy/audio_input_resource.cc
+++ b/ppapi/proxy/audio_input_resource.cc
@@ -6,6 +6,7 @@
#include "base/bind.h"
#include "base/logging.h"
+#include "base/numerics/safe_conversions.h"
#include "ipc/ipc_platform_file.h"
#include "media/audio/audio_parameters.h"
#include "media/base/audio_bus.h"
@@ -249,7 +250,8 @@ void AudioInputResource::Run() {
media::AudioInputBuffer* buffer =
static_cast<media::AudioInputBuffer*>(shared_memory_->memory());
const uint32_t audio_bus_size_bytes =
- shared_memory_size_ - sizeof(media::AudioInputBufferParameters);
+ base::checked_cast<uint32_t>(shared_memory_size_ -
+ sizeof(media::AudioInputBufferParameters));
while (true) {
int pending_data = 0;
« no previous file with comments | « ppapi/ppapi_tests.gypi ('k') | ppapi/proxy/device_enumeration_resource_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698