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

Unified Diff: content/browser/presentation/presentation_service_impl.cc

Issue 2958663002: [MediaRouter] PresentationServiceDelegateImpl cleanup. (Closed)
Patch Set: Created 3 years, 6 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
Index: content/browser/presentation/presentation_service_impl.cc
diff --git a/content/browser/presentation/presentation_service_impl.cc b/content/browser/presentation/presentation_service_impl.cc
index 6fb5641c60ac183f86feb0a642f0f09151575f0d..50d561113634adb8533b0c70bfa4608286dd6d2b 100644
--- a/content/browser/presentation/presentation_service_impl.cc
+++ b/content/browser/presentation/presentation_service_impl.cc
@@ -123,7 +123,7 @@ void PresentationServiceImpl::SetClient(
void PresentationServiceImpl::ListenForScreenAvailability(const GURL& url) {
DVLOG(2) << "ListenForScreenAvailability " << url.spec();
- if (!controller_delegate_) {
+ if (!controller_delegate_ || !url.is_valid()) {
client_->OnScreenAvailabilityUpdated(
url, blink::mojom::ScreenAvailability::UNAVAILABLE);
return;
@@ -459,13 +459,13 @@ PresentationServiceImpl::ScreenAvailabilityListenerImpl::
ScreenAvailabilityListenerImpl(const GURL& availability_url,
PresentationServiceImpl* service)
: availability_url_(availability_url), service_(service) {
+ DCHECK(availability_url_.is_valid());
DCHECK(service_);
DCHECK(service_->client_.get());
}
PresentationServiceImpl::ScreenAvailabilityListenerImpl::
-~ScreenAvailabilityListenerImpl() {
-}
+ ~ScreenAvailabilityListenerImpl() = default;
GURL PresentationServiceImpl::ScreenAvailabilityListenerImpl::
GetAvailabilityUrl() const {

Powered by Google App Engine
This is Rietveld 408576698