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

Unified Diff: third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.h
diff --git a/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.h b/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.h
index 1a855674e3858ac78d6fbcf21f5514fbcfbc8e8a..e8b77142a2ef2ef0cf62821b09c208b6460098bf 100644
--- a/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.h
+++ b/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.h
@@ -45,7 +45,7 @@ class MediaElementAudioSourceHandler final : public AudioHandler {
HTMLMediaElement&);
~MediaElementAudioSourceHandler() override;
- HTMLMediaElement* mediaElement() { return m_mediaElement.get(); }
+ HTMLMediaElement* mediaElement() const;
// AudioHandler
void dispose() override;
@@ -76,7 +76,10 @@ class MediaElementAudioSourceHandler final : public AudioHandler {
// This Persistent doesn't make a reference cycle. The reference from
// HTMLMediaElement to AudioSourceProvideClient, which
// MediaElementAudioSourceNode implements, is weak.
- Persistent<HTMLMediaElement> m_mediaElement;
+ //
+ // It is accessed by both audio and main thread. TODO: we really should
+ // try to minimize or avoid the audio thread touching this element.
+ CrossThreadPersistent<HTMLMediaElement> m_mediaElement;
Mutex m_processLock;
unsigned m_sourceNumberOfChannels;

Powered by Google App Engine
This is Rietveld 408576698