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

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

Issue 398743002: Refactor verifyProtocolHandlerScheme() in NavigatorContentUtils.cpp (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 5 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 fdd04992108529cb2c5ff2b0685a49822ef84286..9e06b5af6e3a73d2f29e2a43ace267b702434267 100644
--- a/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp
+++ b/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp
@@ -107,7 +107,7 @@ static bool isProtocolWhitelisted(const String& scheme)
return protocolWhitelist->contains(builder.toString());
}
-static bool verifyProtocolHandlerScheme(const String& scheme, const String& method, ExceptionState& exceptionState)
+static bool verifyCustomHandlerScheme(const String& scheme, ExceptionState& exceptionState)
{
if (!isValidProtocol(scheme)) {
exceptionState.throwSecurityError("The scheme '" + scheme + "' is not valid protocol");
@@ -155,7 +155,7 @@ void NavigatorContentUtils::registerProtocolHandler(Navigator& navigator, const
if (!verifyCustomHandlerURL(baseURL, url, exceptionState))
return;
- if (!verifyProtocolHandlerScheme(scheme, "registerProtocolHandler", exceptionState))
+ if (!verifyCustomHandlerScheme(scheme, exceptionState))
return;
ASSERT(navigator.frame()->page());
@@ -198,7 +198,7 @@ String NavigatorContentUtils::isProtocolHandlerRegistered(Navigator& navigator,
if (!verifyCustomHandlerURL(baseURL, url, exceptionState))
return declined;
- if (!verifyProtocolHandlerScheme(scheme, "isProtocolHandlerRegistered", exceptionState))
+ if (!verifyCustomHandlerScheme(scheme, exceptionState))
return declined;
ASSERT(navigator.frame()->page());
@@ -216,7 +216,7 @@ void NavigatorContentUtils::unregisterProtocolHandler(Navigator& navigator, cons
if (!verifyCustomHandlerURL(baseURL, url, exceptionState))
return;
- if (!verifyProtocolHandlerScheme(scheme, "unregisterProtocolHandler", exceptionState))
+ if (!verifyCustomHandlerScheme(scheme, exceptionState))
return;
ASSERT(navigator.frame()->page());
« 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