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

Unified Diff: content/renderer/media/webaudiosourceprovider_impl.cc

Issue 193303002: WeakPtr destruction order cleanup: media edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 6 years, 9 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
« no previous file with comments | « content/renderer/media/webaudiosourceprovider_impl.h ('k') | media/audio/alsa/alsa_input.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/webaudiosourceprovider_impl.cc
diff --git a/content/renderer/media/webaudiosourceprovider_impl.cc b/content/renderer/media/webaudiosourceprovider_impl.cc
index 47bd384c239df082e9d1cfedf11ee5f905582e72..48bcf1cd407c8fdce92414f760b382107499d997 100644
--- a/content/renderer/media/webaudiosourceprovider_impl.cc
+++ b/content/renderer/media/webaudiosourceprovider_impl.cc
@@ -48,15 +48,14 @@ class AutoTryLock {
WebAudioSourceProviderImpl::WebAudioSourceProviderImpl(
const scoped_refptr<media::AudioRendererSink>& sink)
- : weak_this_(this),
- channels_(0),
+ : channels_(0),
sample_rate_(0),
volume_(1.0),
state_(kStopped),
renderer_(NULL),
client_(NULL),
- sink_(sink) {
-}
+ sink_(sink),
+ weak_factory_(this) {}
WebAudioSourceProviderImpl::~WebAudioSourceProviderImpl() {
}
@@ -71,9 +70,8 @@ void WebAudioSourceProviderImpl::setClient(
// The client will now take control by calling provideInput() periodically.
client_ = client;
- set_format_cb_ = media::BindToCurrentLoop(
- base::Bind(&WebAudioSourceProviderImpl::OnSetFormat,
- weak_this_.GetWeakPtr()));
+ set_format_cb_ = media::BindToCurrentLoop(base::Bind(
+ &WebAudioSourceProviderImpl::OnSetFormat, weak_factory_.GetWeakPtr()));
// If |renderer_| is set, then run |set_format_cb_| to send |client_|
// the current format info. If |renderer_| is not set, then |set_format_cb_|
« no previous file with comments | « content/renderer/media/webaudiosourceprovider_impl.h ('k') | media/audio/alsa/alsa_input.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698