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

Side by Side Diff: media/filters/renderer_impl.cc

Issue 598023004: [src/media] Declaring the weak_ptr_factory in proper order in cast,mojo and filters (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/filters/renderer_impl.h" 5 #include "media/filters/renderer_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 18 matching lines...) Expand all
29 audio_renderer_(audio_renderer.Pass()), 29 audio_renderer_(audio_renderer.Pass()),
30 video_renderer_(video_renderer.Pass()), 30 video_renderer_(video_renderer.Pass()),
31 time_source_(NULL), 31 time_source_(NULL),
32 time_ticking_(false), 32 time_ticking_(false),
33 audio_buffering_state_(BUFFERING_HAVE_NOTHING), 33 audio_buffering_state_(BUFFERING_HAVE_NOTHING),
34 video_buffering_state_(BUFFERING_HAVE_NOTHING), 34 video_buffering_state_(BUFFERING_HAVE_NOTHING),
35 audio_ended_(false), 35 audio_ended_(false),
36 video_ended_(false), 36 video_ended_(false),
37 underflow_disabled_for_testing_(false), 37 underflow_disabled_for_testing_(false),
38 clockless_video_playback_enabled_for_testing_(false), 38 clockless_video_playback_enabled_for_testing_(false),
39 weak_factory_(this), 39 weak_factory_(this) {
40 weak_this_(weak_factory_.GetWeakPtr()) {
41 DVLOG(1) << __FUNCTION__; 40 DVLOG(1) << __FUNCTION__;
41 weak_this_ = weak_factory_.GetWeakPtr();
42 } 42 }
43 43
44 RendererImpl::~RendererImpl() { 44 RendererImpl::~RendererImpl() {
45 DVLOG(1) << __FUNCTION__; 45 DVLOG(1) << __FUNCTION__;
46 DCHECK(task_runner_->BelongsToCurrentThread()); 46 DCHECK(task_runner_->BelongsToCurrentThread());
47 47
48 // Tear down in opposite order of construction as |video_renderer_| can still 48 // Tear down in opposite order of construction as |video_renderer_| can still
49 // need |time_source_| (which can be |audio_renderer_|) to be alive. 49 // need |time_source_| (which can be |audio_renderer_|) to be alive.
50 video_renderer_.reset(); 50 video_renderer_.reset();
51 audio_renderer_.reset(); 51 audio_renderer_.reset();
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 DCHECK(task_runner_->BelongsToCurrentThread()); 496 DCHECK(task_runner_->BelongsToCurrentThread());
497 497
498 if (!init_cb_.is_null()) 498 if (!init_cb_.is_null())
499 base::ResetAndReturn(&init_cb_).Run(); 499 base::ResetAndReturn(&init_cb_).Run();
500 500
501 if (!flush_cb_.is_null()) 501 if (!flush_cb_.is_null())
502 base::ResetAndReturn(&flush_cb_).Run(); 502 base::ResetAndReturn(&flush_cb_).Run();
503 } 503 }
504 504
505 } // namespace media 505 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698