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

Unified Diff: third_party/WebKit/Source/modules/webaudio/WaveShaperNode.cpp

Issue 2707243006: [SharedArrayBuffer] Prevent SharedArrayBuffer being used in Web APIs (Closed)
Patch Set: add some layout tests 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/webaudio/WaveShaperNode.cpp
diff --git a/third_party/WebKit/Source/modules/webaudio/WaveShaperNode.cpp b/third_party/WebKit/Source/modules/webaudio/WaveShaperNode.cpp
index c4700f0921381d9658f2fff559b5dce1aa4f4078..4ca2e97c0886ae59301748b8351411a0fc584f57 100644
--- a/third_party/WebKit/Source/modules/webaudio/WaveShaperNode.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/WaveShaperNode.cpp
@@ -92,12 +92,12 @@ void WaveShaperNode::setCurveImpl(const float* curveData,
getWaveShaperProcessor()->setCurve(curveData, curveLength);
}
-void WaveShaperNode::setCurve(DOMFloat32Array* curve,
+void WaveShaperNode::setCurve(NotShared<DOMFloat32Array> curve,
ExceptionState& exceptionState) {
DCHECK(isMainThread());
- if (curve)
- setCurveImpl(curve->data(), curve->length(), exceptionState);
+ if (curve.view())
+ setCurveImpl(curve.view()->data(), curve.view()->length(), exceptionState);
else
setCurveImpl(nullptr, 0, exceptionState);
}
@@ -109,17 +109,18 @@ void WaveShaperNode::setCurve(const Vector<float>& curve,
setCurveImpl(curve.data(), curve.size(), exceptionState);
}
-DOMFloat32Array* WaveShaperNode::curve() {
+NotShared<DOMFloat32Array> WaveShaperNode::curve() {
Vector<float>* curve = getWaveShaperProcessor()->curve();
if (!curve)
- return nullptr;
+ return NotShared<DOMFloat32Array>(nullptr);
unsigned size = curve->size();
RefPtr<WTF::Float32Array> newCurve = WTF::Float32Array::create(size);
memcpy(newCurve->data(), curve->data(), sizeof(float) * size);
- return DOMFloat32Array::create(newCurve.release());
+ return NotShared<DOMFloat32Array>(
+ DOMFloat32Array::create(newCurve.release()));
}
void WaveShaperNode::setOversample(const String& type) {

Powered by Google App Engine
This is Rietveld 408576698