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

Side by Side Diff: third_party/WebKit/Source/modules/webaudio/AudioBufferSourceNode.h

Issue 2702243003: Disallow cross-thread Persistent<> read access. (Closed)
Patch Set: rebased upto r451733 Created 3 years, 10 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) 2010, Google Inc. All rights reserved. 2 * Copyright (C) 2010, 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 inline bool renderSilenceAndFinishIfNotLooping(AudioBus*, 117 inline bool renderSilenceAndFinishIfNotLooping(AudioBus*,
118 unsigned index, 118 unsigned index,
119 size_t framesToProcess); 119 size_t framesToProcess);
120 120
121 // Clamps grain parameters to the duration of the given AudioBuffer. 121 // Clamps grain parameters to the duration of the given AudioBuffer.
122 void clampGrainParameters(const AudioBuffer*); 122 void clampGrainParameters(const AudioBuffer*);
123 123
124 // m_buffer holds the sample data which this node outputs. 124 // m_buffer holds the sample data which this node outputs.
125 // This Persistent doesn't make a reference cycle including 125 // This Persistent doesn't make a reference cycle including
126 // AudioBufferSourceNode. 126 // AudioBufferSourceNode.
127 Persistent<AudioBuffer> m_buffer; 127 // It is cross-thread, as it will be accessed by the audio and main threads.
128 CrossThreadPersistent<AudioBuffer> m_buffer;
128 129
129 // Pointers for the buffer and destination. 130 // Pointers for the buffer and destination.
130 std::unique_ptr<const float* []> m_sourceChannels; 131 std::unique_ptr<const float* []> m_sourceChannels;
131 std::unique_ptr<float* []> m_destinationChannels; 132 std::unique_ptr<float* []> m_destinationChannels;
132 133
133 RefPtr<AudioParamHandler> m_playbackRate; 134 RefPtr<AudioParamHandler> m_playbackRate;
134 RefPtr<AudioParamHandler> m_detune; 135 RefPtr<AudioParamHandler> m_detune;
135 136
136 bool didSetLooping() const { return acquireLoad(&m_didSetLooping); } 137 bool didSetLooping() const { return acquireLoad(&m_didSetLooping); }
137 void setDidSetLooping(bool loop) { 138 void setDidSetLooping(bool loop) {
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 private: 205 private:
205 AudioBufferSourceNode(BaseAudioContext&); 206 AudioBufferSourceNode(BaseAudioContext&);
206 207
207 Member<AudioParam> m_playbackRate; 208 Member<AudioParam> m_playbackRate;
208 Member<AudioParam> m_detune; 209 Member<AudioParam> m_detune;
209 }; 210 };
210 211
211 } // namespace blink 212 } // namespace blink
212 213
213 #endif // AudioBufferSourceNode_h 214 #endif // AudioBufferSourceNode_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/workers/WorkerThread.h ('k') | third_party/WebKit/Source/modules/webaudio/ConvolverNode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698