| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008, 2013 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 2013 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 namespace WebCore { | 39 namespace WebCore { |
| 40 | 40 |
| 41 class ChangeVersionData; | 41 class ChangeVersionData; |
| 42 class DatabaseCallback; | 42 class DatabaseCallback; |
| 43 class DatabaseContext; | 43 class DatabaseContext; |
| 44 class SecurityOrigin; | 44 class SecurityOrigin; |
| 45 class SQLTransaction; | 45 class SQLTransaction; |
| 46 class SQLTransactionBackend; | 46 class SQLTransactionBackend; |
| 47 class SQLTransactionCallback; | 47 class SQLTransactionCallback; |
| 48 class SQLTransactionErrorCallback; | 48 class SQLTransactionErrorCallback; |
| 49 class VoidCallback; | 49 class SQLVoidCallback; |
| 50 | 50 |
| 51 class Database : public DatabaseBase, public DatabaseBackend, public ScriptWrapp
able { | 51 class Database : public DatabaseBase, public DatabaseBackend, public ScriptWrapp
able { |
| 52 public: | 52 public: |
| 53 virtual ~Database(); | 53 virtual ~Database(); |
| 54 | 54 |
| 55 // Direct support for the DOM API | 55 // Direct support for the DOM API |
| 56 virtual String version() const; | 56 virtual String version() const; |
| 57 void changeVersion(const String& oldVersion, const String& newVersion, PassR
efPtr<SQLTransactionCallback>, | 57 void changeVersion(const String& oldVersion, const String& newVersion, PassR
efPtr<SQLTransactionCallback>, PassRefPtr<SQLTransactionErrorCallback>, PassRefP
tr<SQLVoidCallback> successCallback); |
| 58 PassRefPtr<SQLTransactionErrorCallback>, PassRefPtr<VoidC
allback> successCallback); | 58 void transaction(PassRefPtr<SQLTransactionCallback>, PassRefPtr<SQLTransacti
onErrorCallback>, PassRefPtr<SQLVoidCallback> successCallback); |
| 59 void transaction(PassRefPtr<SQLTransactionCallback>, PassRefPtr<SQLTransacti
onErrorCallback>, PassRefPtr<VoidCallback> successCallback); | 59 void readTransaction(PassRefPtr<SQLTransactionCallback>, PassRefPtr<SQLTrans
actionErrorCallback>, PassRefPtr<SQLVoidCallback> successCallback); |
| 60 void readTransaction(PassRefPtr<SQLTransactionCallback>, PassRefPtr<SQLTrans
actionErrorCallback>, PassRefPtr<VoidCallback> successCallback); | |
| 61 | 60 |
| 62 // Internal engine support | 61 // Internal engine support |
| 63 static Database* from(DatabaseBackend*); | 62 static Database* from(DatabaseBackend*); |
| 64 DatabaseContext* databaseContext() const { return m_databaseContext.get(); } | 63 DatabaseContext* databaseContext() const { return m_databaseContext.get(); } |
| 65 | 64 |
| 66 Vector<String> tableNames(); | 65 Vector<String> tableNames(); |
| 67 | 66 |
| 68 virtual SecurityOrigin* securityOrigin() const; | 67 virtual SecurityOrigin* securityOrigin() const; |
| 69 | 68 |
| 70 virtual void closeImmediately(); | 69 virtual void closeImmediately(); |
| 71 | 70 |
| 72 void scheduleTransactionCallback(SQLTransaction*); | 71 void scheduleTransactionCallback(SQLTransaction*); |
| 73 | 72 |
| 74 private: | 73 private: |
| 75 Database(PassRefPtr<DatabaseContext>, const String& name, | 74 Database(PassRefPtr<DatabaseContext>, const String& name, |
| 76 const String& expectedVersion, const String& displayName, unsigned long
estimatedSize); | 75 const String& expectedVersion, const String& displayName, unsigned long
estimatedSize); |
| 77 PassRefPtr<DatabaseBackend> backend(); | 76 PassRefPtr<DatabaseBackend> backend(); |
| 78 static PassRefPtr<Database> create(ExecutionContext*, PassRefPtr<DatabaseBac
kendBase>); | 77 static PassRefPtr<Database> create(ExecutionContext*, PassRefPtr<DatabaseBac
kendBase>); |
| 79 | 78 |
| 80 void runTransaction(PassRefPtr<SQLTransactionCallback>, PassRefPtr<SQLTransa
ctionErrorCallback>, | 79 void runTransaction(PassRefPtr<SQLTransactionCallback>, PassRefPtr<SQLTransa
ctionErrorCallback>, |
| 81 PassRefPtr<VoidCallback> successCallback, bool readOnly, const ChangeVer
sionData* = 0); | 80 PassRefPtr<SQLVoidCallback> successCallback, bool readOnly, const Change
VersionData* = 0); |
| 82 | 81 |
| 83 Vector<String> performGetTableNames(); | 82 Vector<String> performGetTableNames(); |
| 84 | 83 |
| 85 void reportStartTransactionResult(int errorSite, int webSqlErrorCode, int sq
liteErrorCode); | 84 void reportStartTransactionResult(int errorSite, int webSqlErrorCode, int sq
liteErrorCode); |
| 86 void reportCommitTransactionResult(int errorSite, int webSqlErrorCode, int s
qliteErrorCode); | 85 void reportCommitTransactionResult(int errorSite, int webSqlErrorCode, int s
qliteErrorCode); |
| 87 | 86 |
| 88 RefPtr<SecurityOrigin> m_databaseThreadSecurityOrigin; | 87 RefPtr<SecurityOrigin> m_databaseThreadSecurityOrigin; |
| 89 RefPtr<DatabaseContext> m_databaseContext; | 88 RefPtr<DatabaseContext> m_databaseContext; |
| 90 | 89 |
| 91 friend class DatabaseManager; | 90 friend class DatabaseManager; |
| 92 friend class DatabaseServer; // FIXME: remove this when the backend has been
split out. | 91 friend class DatabaseServer; // FIXME: remove this when the backend has been
split out. |
| 93 friend class DatabaseBackend; // FIXME: remove this when the backend has bee
n split out. | 92 friend class DatabaseBackend; // FIXME: remove this when the backend has bee
n split out. |
| 94 friend class SQLStatement; | 93 friend class SQLStatement; |
| 95 friend class SQLTransaction; | 94 friend class SQLTransaction; |
| 96 }; | 95 }; |
| 97 | 96 |
| 98 } // namespace WebCore | 97 } // namespace WebCore |
| 99 | 98 |
| 100 #endif // Database_h | 99 #endif // Database_h |
| OLD | NEW |