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

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

Issue 2702243003: Disallow cross-thread Persistent<> read access. (Closed)
Patch Set: rebase fixup 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) 2012, Google Inc. All rights reserved. 2 * Copyright (C) 2012, 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 51
52 unsigned long maxChannelCount() const; 52 unsigned long maxChannelCount() const;
53 53
54 private: 54 private:
55 MediaStreamAudioDestinationHandler(AudioNode&, size_t numberOfChannels); 55 MediaStreamAudioDestinationHandler(AudioNode&, size_t numberOfChannels);
56 // As an audio source, we will never propagate silence. 56 // As an audio source, we will never propagate silence.
57 bool propagatesSilence() const override { return false; } 57 bool propagatesSilence() const override { return false; }
58 58
59 // This Persistent doesn't make a reference cycle. 59 // This Persistent doesn't make a reference cycle.
60 Persistent<MediaStream> m_stream; 60 Persistent<MediaStream> m_stream;
61 Persistent<MediaStreamSource> m_source; 61 // Accessed by main thread and during audio thread processing.
62 CrossThreadPersistent<MediaStreamSource> m_source;
haraken 2017/02/20 23:57:18 Ditto.
62 63
63 // This synchronizes dynamic changes to the channel count with 64 // This synchronizes dynamic changes to the channel count with
64 // process() to manage the mix bus. 65 // process() to manage the mix bus.
65 mutable Mutex m_processLock; 66 mutable Mutex m_processLock;
66 67
67 // This internal mix bus is for up/down mixing the input to the actual 68 // This internal mix bus is for up/down mixing the input to the actual
68 // number of channels in the destination. 69 // number of channels in the destination.
69 RefPtr<AudioBus> m_mixBus; 70 RefPtr<AudioBus> m_mixBus;
70 }; 71 };
71 72
(...skipping 10 matching lines...) Expand all
82 83
83 MediaStream* stream() const; 84 MediaStream* stream() const;
84 85
85 private: 86 private:
86 MediaStreamAudioDestinationNode(BaseAudioContext&, size_t numberOfChannels); 87 MediaStreamAudioDestinationNode(BaseAudioContext&, size_t numberOfChannels);
87 }; 88 };
88 89
89 } // namespace blink 90 } // namespace blink
90 91
91 #endif // MediaStreamAudioDestinationNode_h 92 #endif // MediaStreamAudioDestinationNode_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698