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

Side by Side Diff: third_party/WebKit/Source/modules/webaudio/WaveShaperDSPKernel.cpp

Issue 2809023002: Replace ASSERT/ASSERT_NOT_REACHED with DCHECK/NOTREACHED in modules/webaudio (Closed)
Patch Set: 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) 2011, Google Inc. All rights reserved. 2 * Copyright (C) 2011, 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 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 ProcessCurve(source, destination, frames_to_process); 63 ProcessCurve(source, destination, frames_to_process);
64 break; 64 break;
65 case WaveShaperProcessor::kOverSample2x: 65 case WaveShaperProcessor::kOverSample2x:
66 ProcessCurve2x(source, destination, frames_to_process); 66 ProcessCurve2x(source, destination, frames_to_process);
67 break; 67 break;
68 case WaveShaperProcessor::kOverSample4x: 68 case WaveShaperProcessor::kOverSample4x:
69 ProcessCurve4x(source, destination, frames_to_process); 69 ProcessCurve4x(source, destination, frames_to_process);
70 break; 70 break;
71 71
72 default: 72 default:
73 ASSERT_NOT_REACHED(); 73 NOTREACHED();
74 } 74 }
75 } 75 }
76 76
77 void WaveShaperDSPKernel::ProcessCurve(const float* source, 77 void WaveShaperDSPKernel::ProcessCurve(const float* source,
78 float* destination, 78 float* destination,
79 size_t frames_to_process) { 79 size_t frames_to_process) {
80 DCHECK(source); 80 DCHECK(source);
81 DCHECK(destination); 81 DCHECK(destination);
82 DCHECK(GetWaveShaperProcessor()); 82 DCHECK(GetWaveShaperProcessor());
83 83
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 latency_frames += down_sampler_->LatencyFrames(); 197 latency_frames += down_sampler_->LatencyFrames();
198 198
199 // Account for second stage upsampling. 199 // Account for second stage upsampling.
200 // and divide by 2 to get back down to the regular sample-rate. 200 // and divide by 2 to get back down to the regular sample-rate.
201 size_t latency_frames2 = 201 size_t latency_frames2 =
202 (up_sampler2_->LatencyFrames() + down_sampler2_->LatencyFrames()) / 2; 202 (up_sampler2_->LatencyFrames() + down_sampler2_->LatencyFrames()) / 2;
203 latency_frames += latency_frames2; 203 latency_frames += latency_frames2;
204 break; 204 break;
205 } 205 }
206 default: 206 default:
207 ASSERT_NOT_REACHED(); 207 NOTREACHED();
208 } 208 }
209 209
210 return static_cast<double>(latency_frames) / SampleRate(); 210 return static_cast<double>(latency_frames) / SampleRate();
211 } 211 }
212 212
213 } // namespace blink 213 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698