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

Unified Diff: WebCore/storage/IDBDatabaseException.h

Issue 5722007: Merge 73605 - 2010-12-07 Jeremy Orlow <jorlow@chromium.org>... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/597/
Patch Set: Created 10 years 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 | « WebCore/storage/IDBDatabaseError.h ('k') | WebCore/storage/IDBDatabaseException.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: WebCore/storage/IDBDatabaseException.h
===================================================================
--- WebCore/storage/IDBDatabaseException.h (revision 73908)
+++ WebCore/storage/IDBDatabaseException.h (working copy)
@@ -26,46 +26,48 @@
#ifndef IDBDatabaseException_h
#define IDBDatabaseException_h
-#include "PlatformString.h"
-#include <wtf/PassRefPtr.h>
-#include <wtf/RefCounted.h>
-
#if ENABLE(INDEXED_DATABASE)
+#include "ExceptionBase.h"
+
namespace WebCore {
-class IDBDatabaseException : public RefCounted<IDBDatabaseException> {
+class IDBDatabaseException : public ExceptionBase {
public:
- static PassRefPtr<IDBDatabaseException> create()
+ static PassRefPtr<IDBDatabaseException> create(const ExceptionCodeDescription& description)
{
- return adoptRef(new IDBDatabaseException());
+ return adoptRef(new IDBDatabaseException(description));
}
- ~IDBDatabaseException() { }
- enum ErrorCode {
- UNKNOWN_ERR = 1,
- NON_TRANSIENT_ERR = 1,
- NOT_FOUND_ERR = 2,
- CONSTRAINT_ERR = 3,
- DATA_ERR = 4,
- NOT_ALLOWED_ERR = 5,
- SERIAL_ERR = 11,
- RECOVERABLE_ERR = 21,
- TRANSIENT_ERR = 31,
- TIMEOUT_ERR = 32,
- DEADLOCK_ERR = 33
+ static const int IDBDatabaseExceptionOffset = 1200;
+ static const int IDBDatabaseExceptionMax = 1299;
+
+ enum IDBDatabaseExceptionCode {
+ UNKNOWN_ERR = IDBDatabaseExceptionOffset + 1,
+ NON_TRANSIENT_ERR = IDBDatabaseExceptionOffset + 2,
+ NOT_FOUND_ERR = IDBDatabaseExceptionOffset + 3,
+ CONSTRAINT_ERR = IDBDatabaseExceptionOffset + 4,
+ DATA_ERR = IDBDatabaseExceptionOffset + 5,
+ NOT_ALLOWED_ERR = IDBDatabaseExceptionOffset + 6,
+ SERIAL_ERR = IDBDatabaseExceptionOffset + 7,
+ RECOVERABLE_ERR = IDBDatabaseExceptionOffset + 8,
+ TRANSIENT_ERR = IDBDatabaseExceptionOffset + 9,
+ TIMEOUT_ERR = IDBDatabaseExceptionOffset + 10,
+ DEADLOCK_ERR = IDBDatabaseExceptionOffset + 11
};
-
- unsigned short code() const { return m_code; }
- void setCode(unsigned short value) { m_code = value; }
- String message() const { return m_message; }
- void setMessage(const String& value) { m_message = value; }
+ static int ErrorCodeToExceptionCode(int errorCode)
+ {
+ if (!errorCode)
+ return 0;
+ return errorCode + IDBDatabaseExceptionOffset;
+ }
+
private:
- IDBDatabaseException() { }
-
- unsigned short m_code;
- String m_message;
+ IDBDatabaseException(const ExceptionCodeDescription& description)
+ : ExceptionBase(description)
+ {
+ }
};
} // namespace WebCore
« no previous file with comments | « WebCore/storage/IDBDatabaseError.h ('k') | WebCore/storage/IDBDatabaseException.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698