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

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

Issue 1823983002: Remove secondary player from Media Sessions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix accidental formatting changes Created 4 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
« no previous file with comments | « no previous file | content/browser/media/android/media_web_contents_observer_android.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 630 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 scoped_ptr<media::MediaPlayerAndroid> BrowserMediaPlayerManager::SwapPlayer( 641 scoped_ptr<media::MediaPlayerAndroid> BrowserMediaPlayerManager::SwapPlayer(
642 int player_id, media::MediaPlayerAndroid* player) { 642 int player_id, media::MediaPlayerAndroid* player) {
643 media::MediaPlayerAndroid* previous_player = NULL; 643 media::MediaPlayerAndroid* previous_player = NULL;
644 for (ScopedVector<MediaPlayerAndroid>::iterator it = players_.begin(); 644 for (ScopedVector<MediaPlayerAndroid>::iterator it = players_.begin();
645 it != players_.end(); ++it) { 645 it != players_.end(); ++it) {
646 if ((*it)->player_id() == player_id) { 646 if ((*it)->player_id() == player_id) {
647 previous_player = *it; 647 previous_player = *it;
648 #if defined(VIDEO_HOLE) 648 #if defined(VIDEO_HOLE)
649 ReleaseExternalSurface(player_id); 649 ReleaseExternalSurface(player_id);
650 #endif 650 #endif
651 MediaWebContentsObserverAndroid::FromWebContents(web_contents_)
652 ->DisconnectMediaSession(render_frame_host_,
653 player_id_to_delegate_id_map_[player_id]);
651 players_.weak_erase(it); 654 players_.weak_erase(it);
652 players_.push_back(player); 655 players_.push_back(player);
653 break; 656 break;
654 } 657 }
655 } 658 }
656 return scoped_ptr<media::MediaPlayerAndroid>(previous_player); 659 return scoped_ptr<media::MediaPlayerAndroid>(previous_player);
657 } 660 }
658 661
659 bool BrowserMediaPlayerManager::RequestDecoderResources( 662 bool BrowserMediaPlayerManager::RequestDecoderResources(
660 int player_id, bool temporary) { 663 int player_id, bool temporary) {
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
736 if (!player) 739 if (!player)
737 return; 740 return;
738 player->Start(); 741 player->Start();
739 if (fullscreen_player_id_ == player_id && fullscreen_player_is_released_) { 742 if (fullscreen_player_id_ == player_id && fullscreen_player_is_released_) {
740 video_view_->OpenVideo(); 743 video_view_->OpenVideo();
741 fullscreen_player_is_released_ = false; 744 fullscreen_player_is_released_ = false;
742 } 745 }
743 } 746 }
744 747
745 } // namespace content 748 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/media/android/media_web_contents_observer_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698