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

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

Issue 2707243006: [SharedArrayBuffer] Prevent SharedArrayBuffer being used in Web APIs (Closed)
Patch Set: update comment, add TODO 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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 165
166 DEFINE_STATIC_LOCAL( 166 DEFINE_STATIC_LOCAL(
167 EnumerationHistogram, filter_type_histogram, 167 EnumerationHistogram, filter_type_histogram,
168 ("WebAudio.BiquadFilter.Type", BiquadProcessor::kAllpass + 1)); 168 ("WebAudio.BiquadFilter.Type", BiquadProcessor::kAllpass + 1));
169 filter_type_histogram.Count(type); 169 filter_type_histogram.Count(type);
170 170
171 GetBiquadProcessor()->SetType(static_cast<BiquadProcessor::FilterType>(type)); 171 GetBiquadProcessor()->SetType(static_cast<BiquadProcessor::FilterType>(type));
172 return true; 172 return true;
173 } 173 }
174 174
175 void BiquadFilterNode::getFrequencyResponse(const DOMFloat32Array* frequency_hz, 175 void BiquadFilterNode::getFrequencyResponse(
176 DOMFloat32Array* mag_response, 176 NotShared<const DOMFloat32Array> frequency_hz,
177 DOMFloat32Array* phase_response) { 177 NotShared<DOMFloat32Array> mag_response,
178 NotShared<DOMFloat32Array> phase_response) {
178 DCHECK(frequency_hz); 179 DCHECK(frequency_hz);
179 DCHECK(mag_response); 180 DCHECK(mag_response);
180 DCHECK(phase_response); 181 DCHECK(phase_response);
181 182
182 int n = std::min(frequency_hz->length(), 183 int n = std::min(
183 std::min(mag_response->length(), phase_response->length())); 184 frequency_hz.View()->length(),
184 if (n) 185 std::min(mag_response.View()->length(), phase_response.View()->length()));
185 GetBiquadProcessor()->GetFrequencyResponse( 186 if (n) {
186 n, frequency_hz->Data(), mag_response->Data(), phase_response->Data()); 187 GetBiquadProcessor()->GetFrequencyResponse(n, frequency_hz.View()->Data(),
188 mag_response.View()->Data(),
189 phase_response.View()->Data());
190 }
187 } 191 }
188 192
189 } // namespace blink 193 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698