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

Side by Side Diff: third_party/WebKit/Source/platform/audio/ReverbInputBuffer.cpp

Issue 2803073002: Convert RELEASE_ASSERT()/ASSERT(...) to CHECK()/DCHECK_op(...) in platform/audio (Closed)
Patch Set: Removing DCHECK_IS_ON from FFTFrameOpenMAXDLAndroid.cpp Created 3 years, 8 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 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 26 matching lines...) Expand all
37 size_t bufferLength = m_buffer.size(); 37 size_t bufferLength = m_buffer.size();
38 bool isCopySafe = m_writeIndex + numberOfFrames <= bufferLength; 38 bool isCopySafe = m_writeIndex + numberOfFrames <= bufferLength;
39 DCHECK(isCopySafe); 39 DCHECK(isCopySafe);
40 if (!isCopySafe) 40 if (!isCopySafe)
41 return; 41 return;
42 42
43 memcpy(m_buffer.data() + m_writeIndex, sourceP, 43 memcpy(m_buffer.data() + m_writeIndex, sourceP,
44 sizeof(float) * numberOfFrames); 44 sizeof(float) * numberOfFrames);
45 45
46 m_writeIndex += numberOfFrames; 46 m_writeIndex += numberOfFrames;
47 ASSERT(m_writeIndex <= bufferLength); 47 DCHECK_LE(m_writeIndex, bufferLength);
48 48
49 if (m_writeIndex >= bufferLength) 49 if (m_writeIndex >= bufferLength)
50 m_writeIndex = 0; 50 m_writeIndex = 0;
51 } 51 }
52 52
53 float* ReverbInputBuffer::directReadFrom(int* readIndex, 53 float* ReverbInputBuffer::directReadFrom(int* readIndex,
54 size_t numberOfFrames) { 54 size_t numberOfFrames) {
55 size_t bufferLength = m_buffer.size(); 55 size_t bufferLength = m_buffer.size();
56 bool isPointerGood = readIndex && *readIndex >= 0 && 56 bool isPointerGood = readIndex && *readIndex >= 0 &&
57 *readIndex + numberOfFrames <= bufferLength; 57 *readIndex + numberOfFrames <= bufferLength;
(...skipping 14 matching lines...) Expand all
72 72
73 return p; 73 return p;
74 } 74 }
75 75
76 void ReverbInputBuffer::reset() { 76 void ReverbInputBuffer::reset() {
77 m_buffer.zero(); 77 m_buffer.zero();
78 m_writeIndex = 0; 78 m_writeIndex = 0;
79 } 79 }
80 80
81 } // namespace blink 81 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698