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

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

Issue 2553903002: Changes error code to NotFoundError. (Closed)
Patch Set: Typo. Created 4 years 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include <unordered_map> 8 #include <unordered_map>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after
781 error_cb.Run(content::PresentationError(content::PRESENTATION_ERROR_UNKNOWN, 781 error_cb.Run(content::PresentationError(content::PRESENTATION_ERROR_UNKNOWN,
782 "Invalid presentation arguments.")); 782 "Invalid presentation arguments."));
783 return; 783 return;
784 } 784 }
785 785
786 // TODO(crbug.com/670848): Improve handling of invalid URLs in 786 // TODO(crbug.com/670848): Improve handling of invalid URLs in
787 // PresentationService::start(). 787 // PresentationService::start().
788 if (presentation_urls.empty() || 788 if (presentation_urls.empty() ||
789 std::find_if_not(presentation_urls.begin(), presentation_urls.end(), 789 std::find_if_not(presentation_urls.begin(), presentation_urls.end(),
790 IsValidPresentationUrl) != presentation_urls.end()) { 790 IsValidPresentationUrl) != presentation_urls.end()) {
791 error_cb.Run(content::PresentationError(content::PRESENTATION_ERROR_UNKNOWN, 791 error_cb.Run(content::PresentationError(
792 "Invalid presentation URL.")); 792 content::PRESENTATION_ERROR_NO_PRESENTATION_FOUND,
793 "Invalid presentation URL."));
793 return; 794 return;
794 } 795 }
795 796
796 RenderFrameHostId render_frame_host_id(render_process_id, render_frame_id); 797 RenderFrameHostId render_frame_host_id(render_process_id, render_frame_id);
797 std::unique_ptr<CreatePresentationConnectionRequest> request( 798 std::unique_ptr<CreatePresentationConnectionRequest> request(
798 new CreatePresentationConnectionRequest( 799 new CreatePresentationConnectionRequest(
799 render_frame_host_id, presentation_urls, 800 render_frame_host_id, presentation_urls,
800 GetLastCommittedURLForFrame(render_frame_host_id, web_contents_), 801 GetLastCommittedURLForFrame(render_frame_host_id, web_contents_),
801 base::Bind(&PresentationServiceDelegateImpl::OnStartSessionSucceeded, 802 base::Bind(&PresentationServiceDelegateImpl::OnStartSessionSucceeded,
802 weak_factory_.GetWeakPtr(), render_process_id, 803 weak_factory_.GetWeakPtr(), render_process_id,
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
970 bool PresentationServiceDelegateImpl::HasScreenAvailabilityListenerForTest( 971 bool PresentationServiceDelegateImpl::HasScreenAvailabilityListenerForTest(
971 int render_process_id, 972 int render_process_id,
972 int render_frame_id, 973 int render_frame_id,
973 const MediaSource::Id& source_id) const { 974 const MediaSource::Id& source_id) const {
974 RenderFrameHostId render_frame_host_id(render_process_id, render_frame_id); 975 RenderFrameHostId render_frame_host_id(render_process_id, render_frame_id);
975 return frame_manager_->HasScreenAvailabilityListenerForTest( 976 return frame_manager_->HasScreenAvailabilityListenerForTest(
976 render_frame_host_id, source_id); 977 render_frame_host_id, source_id);
977 } 978 }
978 979
979 } // namespace media_router 980 } // namespace media_router
OLDNEW
« 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