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

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

Issue 23135009: Improve IDB module's SecurityError messages. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: test Created 7 years, 4 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: Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp
diff --git a/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp b/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp
index df33faf653a043e35e7e35c781a7440d448ab64e..cf2a34e80b49f23f8d1038e71ed9a21553879863 100644
--- a/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp
+++ b/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp
@@ -29,6 +29,7 @@
#if ENABLE(NAVIGATOR_CONTENT_UTILS)
+#include "bindings/v8/ExceptionMessages.h"
#include "bindings/v8/ExceptionState.h"
#include "core/dom/Document.h"
#include "core/dom/ExceptionCode.h"
@@ -109,13 +110,16 @@ static bool verifyProtocolHandlerScheme(const String& scheme, ExceptionState& es
// The specification requires that the length of scheme is at least five characteres (including 'web+' prefix).
if (scheme.length() >= 5 && isValidProtocol(scheme))
return true;
- es.throwDOMException(SecurityError);
+ if (scheme.length() < 5)
+ es.throwSecurityError(ExceptionMessages::failedToExecute("registerProtocolHandler", "Navigator", "the scheme length (including 'web+') must be at least 5 characters."));
+ else
+ es.throwSecurityError(ExceptionMessages::failedToExecute("registerProtocolHandler", "Navigator", "the scheme '" + scheme + "' may not be registered."));
return false;
}
if (isProtocolWhitelisted(scheme))
return true;
- es.throwDOMException(SecurityError);
+ es.throwSecurityError(ExceptionMessages::failedToExecute("registerProtocolHandler", "Navigator", "the scheme '" + scheme + "' may not be registered."));
return false;
}

Powered by Google App Engine
This is Rietveld 408576698