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

Side by Side Diff: content/browser/media/android/browser_media_player_manager.cc

Issue 1836093003: Remove secondary player from Media Sessions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2661
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 unified diff | Download patch
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 #include "content/browser/media/android/browser_media_player_manager.h" 5 #include "content/browser/media/android/browser_media_player_manager.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/android/scoped_java_ref.h" 9 #include "base/android/scoped_java_ref.h"
10 #include "content/browser/frame_host/render_frame_host_impl.h" 10 #include "content/browser/frame_host/render_frame_host_impl.h"
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after
645 scoped_ptr<media::MediaPlayerAndroid> BrowserMediaPlayerManager::SwapPlayer( 645 scoped_ptr<media::MediaPlayerAndroid> BrowserMediaPlayerManager::SwapPlayer(
646 int player_id, media::MediaPlayerAndroid* player) { 646 int player_id, media::MediaPlayerAndroid* player) {
647 media::MediaPlayerAndroid* previous_player = NULL; 647 media::MediaPlayerAndroid* previous_player = NULL;
648 for (ScopedVector<MediaPlayerAndroid>::iterator it = players_.begin(); 648 for (ScopedVector<MediaPlayerAndroid>::iterator it = players_.begin();
649 it != players_.end(); ++it) { 649 it != players_.end(); ++it) {
650 if ((*it)->player_id() == player_id) { 650 if ((*it)->player_id() == player_id) {
651 previous_player = *it; 651 previous_player = *it;
652 #if defined(VIDEO_HOLE) 652 #if defined(VIDEO_HOLE)
653 ReleaseExternalSurface(player_id); 653 ReleaseExternalSurface(player_id);
654 #endif 654 #endif
655 MediaWebContentsObserverAndroid::FromWebContents(web_contents_)
656 ->DisconnectMediaSession(render_frame_host_,
657 player_id_to_delegate_id_map_[player_id]);
655 players_.weak_erase(it); 658 players_.weak_erase(it);
656 players_.push_back(player); 659 players_.push_back(player);
657 break; 660 break;
658 } 661 }
659 } 662 }
660 return scoped_ptr<media::MediaPlayerAndroid>(previous_player); 663 return scoped_ptr<media::MediaPlayerAndroid>(previous_player);
661 } 664 }
662 665
663 bool BrowserMediaPlayerManager::RequestDecoderResources( 666 bool BrowserMediaPlayerManager::RequestDecoderResources(
664 int player_id, bool temporary) { 667 int player_id, bool temporary) {
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
740 if (!player) 743 if (!player)
741 return; 744 return;
742 player->Start(); 745 player->Start();
743 if (fullscreen_player_id_ == player_id && fullscreen_player_is_released_) { 746 if (fullscreen_player_id_ == player_id && fullscreen_player_is_released_) {
744 video_view_->OpenVideo(); 747 video_view_->OpenVideo();
745 fullscreen_player_is_released_ = false; 748 fullscreen_player_is_released_ = false;
746 } 749 }
747 } 750 }
748 751
749 } // namespace content 752 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698