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

Unified Diff: media/cdm/ppapi/cdm_helpers.cc

Issue 26592003: Switch CdmWrapper to use uint32_t for size types per style guide. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase over audio. Created 7 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 | « media/cdm/ppapi/cdm_helpers.h ('k') | media/cdm/ppapi/cdm_wrapper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cdm/ppapi/cdm_helpers.cc
diff --git a/media/cdm/ppapi/cdm_helpers.cc b/media/cdm/ppapi/cdm_helpers.cc
index c0db2ed465f8580de32ac8bda669d862329ff196..36b95021f8cc21abb46292be1beac191dbd1f441 100644
--- a/media/cdm/ppapi/cdm_helpers.cc
+++ b/media/cdm/ppapi/cdm_helpers.cc
@@ -20,10 +20,10 @@
namespace media {
-cdm::Buffer* PpbBufferAllocator::Allocate(int32_t capacity) {
+cdm::Buffer* PpbBufferAllocator::Allocate(uint32_t capacity) {
PP_DCHECK(pp::Module::Get()->core()->IsMainThread());
- if (capacity <= 0)
+ if (!capacity)
return NULL;
pp::Buffer_Dev buffer;
@@ -64,19 +64,19 @@ void PpbBufferAllocator::Release(uint32_t buffer_id) {
allocated_buffers_.erase(found);
}
-pp::Buffer_Dev PpbBufferAllocator::AllocateNewBuffer(int32_t capacity) {
+pp::Buffer_Dev PpbBufferAllocator::AllocateNewBuffer(uint32_t capacity) {
// Always pad new allocated buffer so that we don't need to reallocate
// buffers frequently if requested sizes fluctuate slightly.
- static const int kBufferPadding = 512;
+ static const uint32_t kBufferPadding = 512;
// Maximum number of free buffers we can keep when allocating new buffers.
- static const int kFreeLimit = 3;
+ static const uint32_t kFreeLimit = 3;
// Destroy the smallest buffer before allocating a new bigger buffer if the
// number of free buffers exceeds a limit. This mechanism helps avoid ending
// up with too many small buffers, which could happen if the size to be
// allocated keeps increasing.
- if (free_buffers_.size() >= static_cast<uint32_t>(kFreeLimit))
+ if (free_buffers_.size() >= kFreeLimit)
free_buffers_.erase(free_buffers_.begin());
// Creation of pp::Buffer_Dev is expensive! It involves synchronous IPC calls.
@@ -88,7 +88,7 @@ VideoFrameImpl::VideoFrameImpl()
: format_(cdm::kUnknownVideoFormat),
frame_buffer_(NULL),
timestamp_(0) {
- for (int32_t i = 0; i < kMaxPlanes; ++i) {
+ for (uint32_t i = 0; i < kMaxPlanes; ++i) {
plane_offsets_[i] = 0;
strides_[i] = 0;
}
« no previous file with comments | « media/cdm/ppapi/cdm_helpers.h ('k') | media/cdm/ppapi/cdm_wrapper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698