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

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

Issue 2909613002: Replaced usage of RefPtr::Release with std::move wraps. (Closed)
Patch Set: Created 3 years, 7 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 Vector<float>* curve = GetWaveShaperProcessor()->Curve(); 113 Vector<float>* curve = GetWaveShaperProcessor()->Curve();
114 if (!curve) 114 if (!curve)
115 return NotShared<DOMFloat32Array>(nullptr); 115 return NotShared<DOMFloat32Array>(nullptr);
116 116
117 unsigned size = curve->size(); 117 unsigned size = curve->size();
118 RefPtr<WTF::Float32Array> new_curve = WTF::Float32Array::Create(size); 118 RefPtr<WTF::Float32Array> new_curve = WTF::Float32Array::Create(size);
119 119
120 memcpy(new_curve->Data(), curve->data(), sizeof(float) * size); 120 memcpy(new_curve->Data(), curve->data(), sizeof(float) * size);
121 121
122 return NotShared<DOMFloat32Array>( 122 return NotShared<DOMFloat32Array>(
123 DOMFloat32Array::Create(new_curve.Release())); 123 DOMFloat32Array::Create(std::move(new_curve)));
124 } 124 }
125 125
126 void WaveShaperNode::setOversample(const String& type) { 126 void WaveShaperNode::setOversample(const String& type) {
127 DCHECK(IsMainThread()); 127 DCHECK(IsMainThread());
128 128
129 // This is to synchronize with the changes made in 129 // This is to synchronize with the changes made in
130 // AudioBasicProcessorNode::checkNumberOfChannelsForInput() where we can 130 // AudioBasicProcessorNode::checkNumberOfChannelsForInput() where we can
131 // initialize() and uninitialize(). 131 // initialize() and uninitialize().
132 BaseAudioContext::AutoLocker context_locker(context()); 132 BaseAudioContext::AutoLocker context_locker(context());
133 133
(...skipping 19 matching lines...) Expand all
153 return "2x"; 153 return "2x";
154 case WaveShaperProcessor::kOverSample4x: 154 case WaveShaperProcessor::kOverSample4x:
155 return "4x"; 155 return "4x";
156 default: 156 default:
157 NOTREACHED(); 157 NOTREACHED();
158 return "none"; 158 return "none";
159 } 159 }
160 } 160 }
161 161
162 } // namespace blink 162 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698