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

Side by Side Diff: third_party/WebKit/Source/modules/webaudio/OfflineAudioDestinationNode.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) 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 99
100 // The offline version of render() method. If the rendering needs to be 100 // The offline version of render() method. If the rendering needs to be
101 // suspended after checking, this stops the rendering and returns true. 101 // suspended after checking, this stops the rendering and returns true.
102 // Otherwise, it returns false after rendering one quantum. 102 // Otherwise, it returns false after rendering one quantum.
103 bool renderIfNotSuspended(AudioBus* sourceBus, 103 bool renderIfNotSuspended(AudioBus* sourceBus,
104 AudioBus* destinationBus, 104 AudioBus* destinationBus,
105 size_t numberOfFrames); 105 size_t numberOfFrames);
106 106
107 // This AudioHandler renders into this AudioBuffer. 107 // This AudioHandler renders into this AudioBuffer.
108 // This Persistent doesn't make a reference cycle including the owner 108 // This Persistent doesn't make a reference cycle including the owner
109 // OfflineAudioDestinationNode. 109 // OfflineAudioDestinationNode. It is accessed by both audio and main thread.
110 Persistent<AudioBuffer> m_renderTarget; 110 CrossThreadPersistent<AudioBuffer> m_renderTarget;
111 // Temporary AudioBus for each render quantum. 111 // Temporary AudioBus for each render quantum.
112 RefPtr<AudioBus> m_renderBus; 112 RefPtr<AudioBus> m_renderBus;
113 113
114 // Rendering thread. 114 // Rendering thread.
115 std::unique_ptr<WebThread> m_renderThread; 115 std::unique_ptr<WebThread> m_renderThread;
116 116
117 // These variables are for counting the number of frames for the current 117 // These variables are for counting the number of frames for the current
118 // progress and the remaining frames to be processed. 118 // progress and the remaining frames to be processed.
119 size_t m_framesProcessed; 119 size_t m_framesProcessed;
120 size_t m_framesToProcess; 120 size_t m_framesToProcess;
(...skipping 12 matching lines...) Expand all
133 static OfflineAudioDestinationNode* create(BaseAudioContext*, 133 static OfflineAudioDestinationNode* create(BaseAudioContext*,
134 AudioBuffer* renderTarget); 134 AudioBuffer* renderTarget);
135 135
136 private: 136 private:
137 OfflineAudioDestinationNode(BaseAudioContext&, AudioBuffer* renderTarget); 137 OfflineAudioDestinationNode(BaseAudioContext&, AudioBuffer* renderTarget);
138 }; 138 };
139 139
140 } // namespace blink 140 } // namespace blink
141 141
142 #endif // OfflineAudioDestinationNode_h 142 #endif // OfflineAudioDestinationNode_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698