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

Unified Diff: third_party/WebKit/Source/modules/webaudio/WaveShaperNode.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 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 651f5c3d2f1594764cc9c5875939470dfa22756f..1507232dda705737f6741707482bbd277bff184f 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* curve_data,
GetWaveShaperProcessor()->SetCurve(curve_data, curve_length);
}
-void WaveShaperNode::setCurve(DOMFloat32Array* curve,
+void WaveShaperNode::setCurve(NotShared<DOMFloat32Array> curve,
ExceptionState& exception_state) {
DCHECK(IsMainThread());
if (curve)
- SetCurveImpl(curve->Data(), curve->length(), exception_state);
+ SetCurveImpl(curve.View()->Data(), curve.View()->length(), exception_state);
else
SetCurveImpl(nullptr, 0, exception_state);
}
@@ -109,17 +109,18 @@ void WaveShaperNode::setCurve(const Vector<float>& curve,
SetCurveImpl(curve.Data(), curve.size(), exception_state);
}
-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> new_curve = WTF::Float32Array::Create(size);
memcpy(new_curve->Data(), curve->Data(), sizeof(float) * size);
- return DOMFloat32Array::Create(new_curve.Release());
+ return NotShared<DOMFloat32Array>(
+ DOMFloat32Array::Create(new_curve.Release()));
}
void WaveShaperNode::setOversample(const String& type) {

Powered by Google App Engine
This is Rietveld 408576698