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

Unified Diff: Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp

Issue 224733013: Remove unnecessary null checking in NavigatorContentUtils (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp
diff --git a/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp b/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp
index 59ee9c871d7ec8c53443508c2b71d718149d68be..03ff686572f9bc1b8724616c2564ab4694a3ba38 100644
--- a/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp
+++ b/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp
@@ -138,11 +138,8 @@ void NavigatorContentUtils::registerProtocolHandler(Navigator& navigator, const
if (!navigator.frame())
return;
- Document* document = navigator.frame()->document();
- if (!document)
- return;
-
- KURL baseURL = document->baseURL();
+ ASSERT(navigator.frame()->document());
+ KURL baseURL = navigator.frame()->document()->baseURL();
if (!verifyCustomHandlerURL(baseURL, url, exceptionState))
return;
@@ -181,6 +178,7 @@ String NavigatorContentUtils::isProtocolHandlerRegistered(Navigator& navigator,
return declined;
Document* document = navigator.frame()->document();
+ ASSERT(document);
if (document->activeDOMObjectsAreStopped())
return declined;
@@ -201,8 +199,8 @@ void NavigatorContentUtils::unregisterProtocolHandler(Navigator& navigator, cons
if (!navigator.frame())
return;
- Document* document = navigator.frame()->document();
- KURL baseURL = document->baseURL();
+ ASSERT(navigator.frame()->document());
+ KURL baseURL = navigator.frame()->document()->baseURL();
if (!verifyCustomHandlerURL(baseURL, url, exceptionState))
return;
« 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