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

Side by Side Diff: chrome/browser/media/router/presentation_service_delegate_impl.cc

Issue 1466573002: Presentation API: implement renderer side of PresentationConnection.close(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "chrome/browser/media/router/presentation_service_delegate_impl.h" 5 #include "chrome/browser/media/router/presentation_service_delegate_impl.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/containers/scoped_ptr_hash_map.h" 9 #include "base/containers/scoped_ptr_hash_map.h"
10 #include "base/containers/small_map.h" 10 #include "base/containers/small_map.h"
(...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 void PresentationServiceDelegateImpl::CloseSession( 723 void PresentationServiceDelegateImpl::CloseSession(
724 int render_process_id, 724 int render_process_id,
725 int render_frame_id, 725 int render_frame_id,
726 const std::string& presentation_id) { 726 const std::string& presentation_id) {
727 const MediaRoute::Id& route_id = frame_manager_->GetRouteId( 727 const MediaRoute::Id& route_id = frame_manager_->GetRouteId(
728 RenderFrameHostId(render_process_id, render_frame_id), presentation_id); 728 RenderFrameHostId(render_process_id, render_frame_id), presentation_id);
729 if (route_id.empty()) { 729 if (route_id.empty()) {
730 DVLOG(1) << "No active route for: " << presentation_id; 730 DVLOG(1) << "No active route for: " << presentation_id;
731 return; 731 return;
732 } 732 }
733
734 // TODO(mfoltz): implement CloseSession(). Probably rename CloseRoute()?
735 NOTIMPLEMENTED();
whywhat 2015/11/20 06:26:49 This can probably implemented similar to onPresent
mark a. foltz 2015/11/20 17:47:17 This should call router_->OnPresentationSessionDet
mlamouri (slow - plz ping) 2015/11/27 11:48:47 Rebased. I left the TODO. I will have a look in a
736 }
737
738 void PresentationServiceDelegateImpl::TerminateSession(
739 int render_process_id,
740 int render_frame_id,
741 const std::string& presentation_id) {
742 const MediaRoute::Id& route_id = frame_manager_->GetRouteId(
743 RenderFrameHostId(render_process_id, render_frame_id), presentation_id);
744 if (route_id.empty()) {
745 DVLOG(1) << "No active route for: " << presentation_id;
746 return;
747 }
733 router_->CloseRoute(route_id); 748 router_->CloseRoute(route_id);
734 } 749 }
735 750
736 void PresentationServiceDelegateImpl::ListenForSessionMessages( 751 void PresentationServiceDelegateImpl::ListenForSessionMessages(
737 int render_process_id, 752 int render_process_id,
738 int render_frame_id, 753 int render_frame_id,
739 const content::PresentationSessionInfo& session, 754 const content::PresentationSessionInfo& session,
740 const content::PresentationSessionMessageCallback& message_cb) { 755 const content::PresentationSessionMessageCallback& message_cb) {
741 frame_manager_->ListenForSessionMessages( 756 frame_manager_->ListenForSessionMessages(
742 RenderFrameHostId(render_process_id, render_frame_id), session, 757 RenderFrameHostId(render_process_id, render_frame_id), session,
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
822 bool PresentationServiceDelegateImpl::HasScreenAvailabilityListenerForTest( 837 bool PresentationServiceDelegateImpl::HasScreenAvailabilityListenerForTest(
823 int render_process_id, 838 int render_process_id,
824 int render_frame_id, 839 int render_frame_id,
825 const MediaSource::Id& source_id) const { 840 const MediaSource::Id& source_id) const {
826 RenderFrameHostId render_frame_host_id(render_process_id, render_frame_id); 841 RenderFrameHostId render_frame_host_id(render_process_id, render_frame_id);
827 return frame_manager_->HasScreenAvailabilityListenerForTest( 842 return frame_manager_->HasScreenAvailabilityListenerForTest(
828 render_frame_host_id, source_id); 843 render_frame_host_id, source_id);
829 } 844 }
830 845
831 } // namespace media_router 846 } // namespace media_router
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698