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

Unified Diff: media/base/android/media_source_player.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/base/android/media_player_bridge.cc ('k') | media/base/android/media_source_player.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/android/media_source_player.h
diff --git a/media/base/android/media_source_player.h b/media/base/android/media_source_player.h
index b3af1be238e866794fd6842bf2a2e711b2dc5693..168126fe96f268d8e3180a2fb33a39487eb43202 100644
--- a/media/base/android/media_source_player.h
+++ b/media/base/android/media_source_player.h
@@ -74,6 +74,8 @@ class MEDIA_EXPORT MediaSourcePlayer : public MediaPlayerAndroid,
virtual void OnDemuxerDurationChanged(base::TimeDelta duration) OVERRIDE;
private:
+ friend class MediaSourcePlayerTest;
+
// Update the current timestamp.
void UpdateTimestamps(const base::TimeDelta& presentation_timestamp,
size_t audio_output_bytes);
@@ -266,9 +268,6 @@ class MEDIA_EXPORT MediaSourcePlayer : public MediaPlayerAndroid,
// Object to calculate the current audio timestamp for A/V sync.
scoped_ptr<AudioTimestampHelper> audio_timestamp_helper_;
- // Weak pointer passed to media decoder jobs for callbacks.
- base::WeakPtrFactory<MediaSourcePlayer> weak_this_;
-
MediaDrmBridge* drm_bridge_;
// No decryption key available to decrypt the encrypted buffer. In this case,
@@ -282,7 +281,10 @@ class MEDIA_EXPORT MediaSourcePlayer : public MediaPlayerAndroid,
// Whether |surface_| is currently used by the player.
bool is_surface_in_use_;
- friend class MediaSourcePlayerTest;
+ // Weak pointer passed to media decoder jobs for callbacks.
+ // NOTE: Weak pointers must be invalidated before all other member variables.
+ base::WeakPtrFactory<MediaSourcePlayer> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(MediaSourcePlayer);
};
« no previous file with comments | « media/base/android/media_player_bridge.cc ('k') | media/base/android/media_source_player.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698