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

Side by Side Diff: content/renderer/media/android/media_source_delegate.h

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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #ifndef CONTENT_RENDERER_MEDIA_ANDROID_MEDIA_SOURCE_DELEGATE_H_ 5 #ifndef CONTENT_RENDERER_MEDIA_ANDROID_MEDIA_SOURCE_DELEGATE_H_
6 #define CONTENT_RENDERER_MEDIA_ANDROID_MEDIA_SOURCE_DELEGATE_H_ 6 #define CONTENT_RENDERER_MEDIA_ANDROID_MEDIA_SOURCE_DELEGATE_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 bool IsSeeking() const; 175 bool IsSeeking() const;
176 176
177 // Returns |seek_time| if it is still buffered or if there is no currently 177 // Returns |seek_time| if it is still buffered or if there is no currently
178 // buffered range including or soon after |seek_time|. If |seek_time| is not 178 // buffered range including or soon after |seek_time|. If |seek_time| is not
179 // buffered, but there is a later range buffered near to |seek_time|, returns 179 // buffered, but there is a later range buffered near to |seek_time|, returns
180 // next buffered range's start time instead. Only call this for browser seeks. 180 // next buffered range's start time instead. Only call this for browser seeks.
181 // |seeking_lock_| must be held by caller. 181 // |seeking_lock_| must be held by caller.
182 base::TimeDelta FindBufferedBrowserSeekTime_Locked( 182 base::TimeDelta FindBufferedBrowserSeekTime_Locked(
183 const base::TimeDelta& seek_time) const; 183 const base::TimeDelta& seek_time) const;
184 184
185 // Message loop for main renderer thread and corresponding weak pointer.
186 const scoped_refptr<base::MessageLoopProxy> main_loop_;
187 base::WeakPtrFactory<MediaSourceDelegate> main_weak_factory_;
188 base::WeakPtr<MediaSourceDelegate> main_weak_this_;
189
190 // Message loop for media thread and corresponding weak pointer.
191 const scoped_refptr<base::MessageLoopProxy> media_loop_;
192 base::WeakPtrFactory<MediaSourceDelegate> media_weak_factory_;
193
194 RendererDemuxerAndroid* demuxer_client_; 185 RendererDemuxerAndroid* demuxer_client_;
195 int demuxer_client_id_; 186 int demuxer_client_id_;
196 187
197 scoped_refptr<media::MediaLog> media_log_; 188 scoped_refptr<media::MediaLog> media_log_;
198 UpdateNetworkStateCB update_network_state_cb_; 189 UpdateNetworkStateCB update_network_state_cb_;
199 DurationChangeCB duration_change_cb_; 190 DurationChangeCB duration_change_cb_;
200 191
201 scoped_ptr<media::ChunkDemuxer> chunk_demuxer_; 192 scoped_ptr<media::ChunkDemuxer> chunk_demuxer_;
202 bool is_demuxer_ready_; 193 bool is_demuxer_ready_;
203 194
(...skipping 29 matching lines...) Expand all
233 // not a regular seek is expected soon. If a regular seek is expected soon, 224 // not a regular seek is expected soon. If a regular seek is expected soon,
234 // then any in-progress browser seek will be canceled pending the 225 // then any in-progress browser seek will be canceled pending the
235 // regular seek, if using |chunk_demuxer_|, and any requested browser seek 226 // regular seek, if using |chunk_demuxer_|, and any requested browser seek
236 // will be trivially finished. Access is serialized by |seeking_lock_|. 227 // will be trivially finished. Access is serialized by |seeking_lock_|.
237 bool doing_browser_seek_; 228 bool doing_browser_seek_;
238 base::TimeDelta browser_seek_time_; 229 base::TimeDelta browser_seek_time_;
239 bool expecting_regular_seek_; 230 bool expecting_regular_seek_;
240 231
241 size_t access_unit_size_; 232 size_t access_unit_size_;
242 233
234 // Message loop for main renderer and media threads.
235 const scoped_refptr<base::MessageLoopProxy> main_loop_;
236 const scoped_refptr<base::MessageLoopProxy> media_loop_;
237
238 // NOTE: Weak pointers must be invalidated before all other member variables.
239 base::WeakPtrFactory<MediaSourceDelegate> main_weak_factory_;
240 base::WeakPtrFactory<MediaSourceDelegate> media_weak_factory_;
241 base::WeakPtr<MediaSourceDelegate> main_weak_this_;
242
243 DISALLOW_COPY_AND_ASSIGN(MediaSourceDelegate); 243 DISALLOW_COPY_AND_ASSIGN(MediaSourceDelegate);
244 }; 244 };
245 245
246 } // namespace content 246 } // namespace content
247 247
248 #endif // CONTENT_RENDERER_MEDIA_ANDROID_MEDIA_SOURCE_DELEGATE_H_ 248 #endif // CONTENT_RENDERER_MEDIA_ANDROID_MEDIA_SOURCE_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698