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

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

Issue 72363002: Rename es => exceptionState in other than bindings/ (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Retry Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/mediastream/UserMediaRequest.cpp ('k') | Source/modules/notifications/Notification.cpp » ('j') | 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 cab1a310ab4c55c7ef97bec0de330c09142f3ecf..2b8067ef2d99c1c983237d9bda4bb66688bd81b5 100644
--- a/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp
+++ b/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp
@@ -70,14 +70,14 @@ static void initProtocolHandlerWhitelist()
protocolWhitelist->add(protocols[i]);
}
-static bool verifyCustomHandlerURL(const String& baseURL, const String& url, ExceptionState& es)
+static bool verifyCustomHandlerURL(const String& baseURL, const String& url, ExceptionState& exceptionState)
{
// The specification requires that it is a SyntaxError if the "%s" token is
// not present.
static const char token[] = "%s";
int index = url.find(token);
if (-1 == index) {
- es.throwUninformativeAndGenericDOMException(SyntaxError);
+ exceptionState.throwUninformativeAndGenericDOMException(SyntaxError);
return false;
}
@@ -90,7 +90,7 @@ static bool verifyCustomHandlerURL(const String& baseURL, const String& url, Exc
KURL kurl(base, newURL);
if (kurl.isEmpty() || !kurl.isValid()) {
- es.throwUninformativeAndGenericDOMException(SyntaxError);
+ exceptionState.throwUninformativeAndGenericDOMException(SyntaxError);
return false;
}
@@ -104,22 +104,22 @@ static bool isProtocolWhitelisted(const String& scheme)
return protocolWhitelist->contains(scheme);
}
-static bool verifyProtocolHandlerScheme(const String& scheme, const String& method, ExceptionState& es)
+static bool verifyProtocolHandlerScheme(const String& scheme, const String& method, ExceptionState& exceptionState)
{
if (scheme.startsWith("web+")) {
// The specification requires that the length of scheme is at least five characteres (including 'web+' prefix).
if (scheme.length() >= 5 && isValidProtocol(scheme))
return true;
if (!isValidProtocol(scheme))
- es.throwSecurityError(ExceptionMessages::failedToExecute(method, "Navigator", "The scheme '" + scheme + "' is not a valid protocol."));
+ exceptionState.throwSecurityError(ExceptionMessages::failedToExecute(method, "Navigator", "The scheme '" + scheme + "' is not a valid protocol."));
else
- es.throwSecurityError(ExceptionMessages::failedToExecute(method, "Navigator", "The scheme '" + scheme + "' is less than five characters long."));
+ exceptionState.throwSecurityError(ExceptionMessages::failedToExecute(method, "Navigator", "The scheme '" + scheme + "' is less than five characters long."));
return false;
}
if (isProtocolWhitelisted(scheme))
return true;
- es.throwSecurityError(ExceptionMessages::failedToExecute(method, "Navigator", "The scheme '" + scheme + "' doesn't belong to the protocol whitelist. Please prefix non-whitelisted schemes with the string 'web+'."));
+ exceptionState.throwSecurityError(ExceptionMessages::failedToExecute(method, "Navigator", "The scheme '" + scheme + "' doesn't belong to the protocol whitelist. Please prefix non-whitelisted schemes with the string 'web+'."));
return false;
}
@@ -137,7 +137,7 @@ PassRefPtr<NavigatorContentUtils> NavigatorContentUtils::create(NavigatorContent
return adoptRef(new NavigatorContentUtils(client));
}
-void NavigatorContentUtils::registerProtocolHandler(Navigator* navigator, const String& scheme, const String& url, const String& title, ExceptionState& es)
+void NavigatorContentUtils::registerProtocolHandler(Navigator* navigator, const String& scheme, const String& url, const String& title, ExceptionState& exceptionState)
{
if (!navigator->frame())
return;
@@ -148,10 +148,10 @@ void NavigatorContentUtils::registerProtocolHandler(Navigator* navigator, const
String baseURL = document->baseURL().baseAsString();
- if (!verifyCustomHandlerURL(baseURL, url, es))
+ if (!verifyCustomHandlerURL(baseURL, url, exceptionState))
return;
- if (!verifyProtocolHandlerScheme(scheme, "registerProtocolHandler", es))
+ if (!verifyProtocolHandlerScheme(scheme, "registerProtocolHandler", exceptionState))
return;
NavigatorContentUtils::from(navigator->frame()->page())->client()->registerProtocolHandler(scheme, baseURL, url, title);
@@ -177,7 +177,7 @@ static String customHandlersStateString(const NavigatorContentUtilsClient::Custo
return String();
}
-String NavigatorContentUtils::isProtocolHandlerRegistered(Navigator* navigator, const String& scheme, const String& url, ExceptionState& es)
+String NavigatorContentUtils::isProtocolHandlerRegistered(Navigator* navigator, const String& scheme, const String& url, ExceptionState& exceptionState)
{
DEFINE_STATIC_LOCAL(const String, declined, ("declined"));
@@ -187,16 +187,16 @@ String NavigatorContentUtils::isProtocolHandlerRegistered(Navigator* navigator,
Document* document = navigator->frame()->document();
String baseURL = document->baseURL().baseAsString();
- if (!verifyCustomHandlerURL(baseURL, url, es))
+ if (!verifyCustomHandlerURL(baseURL, url, exceptionState))
return declined;
- if (!verifyProtocolHandlerScheme(scheme, "isProtocolHandlerRegistered", es))
+ if (!verifyProtocolHandlerScheme(scheme, "isProtocolHandlerRegistered", exceptionState))
return declined;
return customHandlersStateString(NavigatorContentUtils::from(navigator->frame()->page())->client()->isProtocolHandlerRegistered(scheme, baseURL, url));
}
-void NavigatorContentUtils::unregisterProtocolHandler(Navigator* navigator, const String& scheme, const String& url, ExceptionState& es)
+void NavigatorContentUtils::unregisterProtocolHandler(Navigator* navigator, const String& scheme, const String& url, ExceptionState& exceptionState)
{
if (!navigator->frame())
return;
@@ -204,10 +204,10 @@ void NavigatorContentUtils::unregisterProtocolHandler(Navigator* navigator, cons
Document* document = navigator->frame()->document();
String baseURL = document->baseURL().baseAsString();
- if (!verifyCustomHandlerURL(baseURL, url, es))
+ if (!verifyCustomHandlerURL(baseURL, url, exceptionState))
return;
- if (!verifyProtocolHandlerScheme(scheme, "unregisterProtocolHandler", es))
+ if (!verifyProtocolHandlerScheme(scheme, "unregisterProtocolHandler", exceptionState))
return;
NavigatorContentUtils::from(navigator->frame()->page())->client()->unregisterProtocolHandler(scheme, baseURL, url);
« no previous file with comments | « Source/modules/mediastream/UserMediaRequest.cpp ('k') | Source/modules/notifications/Notification.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698