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

Unified Diff: chrome/browser/media/android/remote/remote_media_player_manager.cc

Issue 1889233002: [Android,VideoFling] Never add null players to alternative ones (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/media/android/remote/remote_media_player_manager.cc
diff --git a/chrome/browser/media/android/remote/remote_media_player_manager.cc b/chrome/browser/media/android/remote/remote_media_player_manager.cc
index 90b70ea60454f890deffdc2cdd9d74a486e4b345..5d21245cb1ee120a5aa4a3d1f5a57d8cc1d3a777 100644
--- a/chrome/browser/media/android/remote/remote_media_player_manager.cc
+++ b/chrome/browser/media/android/remote/remote_media_player_manager.cc
@@ -150,6 +150,9 @@ void RemoteMediaPlayerManager::SwapCurrentPlayer(int player_id) {
MediaPlayerAndroid* new_player = *it;
std::unique_ptr<MediaPlayerAndroid> old_player =
SwapPlayer(player_id, new_player);
+ if (!old_player)
dgn 2016/04/18 13:18:49 In which case can this be null? Is it safe to run
whywhat 2016/04/18 13:21:51 SwapPlayer doesn't do anything if it can't find th
aberent 2016/04/18 13:44:57 Is all this one line too high? It seems that this
whywhat 2016/04/18 14:54:45 Good point, remove and delete the alternative play
+ return;
+
alternative_players_.weak_erase(it);
alternative_players_.push_back(old_player.release());
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698