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

Unified Diff: Source/modules/indexeddb/IDBFactory.cpp

Issue 23135009: Improve IDB module's SecurityError messages. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Only IDB. Created 7 years, 3 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 | « LayoutTests/fast/frames/sandboxed-iframe-storage-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/indexeddb/IDBFactory.cpp
diff --git a/Source/modules/indexeddb/IDBFactory.cpp b/Source/modules/indexeddb/IDBFactory.cpp
index 451b8cdf278d601805841b66fd34f18985d0ad94..d22f15490189f82ec45d6a809fe9241278664376 100644
--- a/Source/modules/indexeddb/IDBFactory.cpp
+++ b/Source/modules/indexeddb/IDBFactory.cpp
@@ -29,6 +29,7 @@
#include "config.h"
#include "modules/indexeddb/IDBFactory.h"
+#include "bindings/v8/ExceptionMessages.h"
#include "bindings/v8/ExceptionState.h"
#include "bindings/v8/IDBBindingUtilities.h"
#include "core/dom/Document.h"
@@ -81,7 +82,7 @@ PassRefPtr<IDBRequest> IDBFactory::getDatabaseNames(ScriptExecutionContext* cont
if (!isContextValid(context))
return 0;
if (!context->securityOrigin()->canAccessDatabase()) {
- es.throwDOMException(SecurityError);
+ es.throwSecurityError(ExceptionMessages::failedToExecute("getDatabaseNames", "IDBFactory", "access to the Indexed Database API is denied in this context."));
return 0;
}
@@ -111,7 +112,7 @@ PassRefPtr<IDBOpenDBRequest> IDBFactory::openInternal(ScriptExecutionContext* co
if (!isContextValid(context))
return 0;
if (!context->securityOrigin()->canAccessDatabase()) {
- es.throwDOMException(SecurityError);
+ es.throwSecurityError(ExceptionMessages::failedToExecute("open", "IDBFactory", "access to the Indexed Database API is denied in this context."));
return 0;
}
@@ -139,7 +140,7 @@ PassRefPtr<IDBOpenDBRequest> IDBFactory::deleteDatabase(ScriptExecutionContext*
if (!isContextValid(context))
return 0;
if (!context->securityOrigin()->canAccessDatabase()) {
- es.throwDOMException(SecurityError);
+ es.throwSecurityError(ExceptionMessages::failedToExecute("deleteDatabase", "IDBFactory", "access to the Indexed Database API is denied in this context."));
return 0;
}
« no previous file with comments | « LayoutTests/fast/frames/sandboxed-iframe-storage-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698