OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Apple Inc. All rights reserved. | 2 * Copyright (C) 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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 // FIXME: This implementation of DatabaseBackend is only a place holder | 43 // FIXME: This implementation of DatabaseBackend is only a place holder |
44 // for the split out of the Database backend to be done later. This | 44 // for the split out of the Database backend to be done later. This |
45 // place holder is needed to allow other code that need to reference the | 45 // place holder is needed to allow other code that need to reference the |
46 // DatabaseBackend to do so before the proper backend split is | 46 // DatabaseBackend to do so before the proper backend split is |
47 // available. This should be replaced with the actual implementation later. | 47 // available. This should be replaced with the actual implementation later. |
48 | 48 |
49 class DatabaseBackend : public DatabaseBackendBase { | 49 class DatabaseBackend : public DatabaseBackendBase { |
50 public: | 50 public: |
51 DatabaseBackend(PassRefPtr<DatabaseContext>, const String& name, const Strin
g& expectedVersion, const String& displayName, unsigned long estimatedSize); | 51 DatabaseBackend(PassRefPtr<DatabaseContext>, const String& name, const Strin
g& expectedVersion, const String& displayName, unsigned long estimatedSize); |
52 | 52 |
53 virtual bool openAndVerifyVersion(bool setVersionInNewDatabase, DatabaseErro
r&, String& errorMessage); | 53 virtual bool openAndVerifyVersion(bool setVersionInNewDatabase, DatabaseErro
r&, String& errorMessage) OVERRIDE FINAL; |
54 void close(); | 54 void close(); |
55 | 55 |
56 PassRefPtr<SQLTransactionBackend> runTransaction(PassRefPtr<SQLTransaction>,
bool readOnly, const ChangeVersionData*); | 56 PassRefPtr<SQLTransactionBackend> runTransaction(PassRefPtr<SQLTransaction>,
bool readOnly, const ChangeVersionData*); |
57 void scheduleTransactionStep(SQLTransactionBackend*); | 57 void scheduleTransactionStep(SQLTransactionBackend*); |
58 void inProgressTransactionCompleted(); | 58 void inProgressTransactionCompleted(); |
59 | 59 |
60 SQLTransactionClient* transactionClient() const; | 60 SQLTransactionClient* transactionClient() const; |
61 SQLTransactionCoordinator* transactionCoordinator() const; | 61 SQLTransactionCoordinator* transactionCoordinator() const; |
62 | 62 |
63 private: | 63 private: |
64 class DatabaseOpenTask; | 64 class DatabaseOpenTask; |
65 class DatabaseCloseTask; | 65 class DatabaseCloseTask; |
66 class DatabaseTransactionTask; | 66 class DatabaseTransactionTask; |
67 class DatabaseTableNamesTask; | 67 class DatabaseTableNamesTask; |
68 | 68 |
69 virtual bool performOpenAndVerify(bool setVersionInNewDatabase, DatabaseErro
r&, String& errorMessage); | 69 virtual bool performOpenAndVerify(bool setVersionInNewDatabase, DatabaseErro
r&, String& errorMessage) OVERRIDE FINAL; |
70 | 70 |
71 void scheduleTransaction(); | 71 void scheduleTransaction(); |
72 | 72 |
73 Deque<RefPtr<SQLTransactionBackend> > m_transactionQueue; | 73 Deque<RefPtr<SQLTransactionBackend> > m_transactionQueue; |
74 Mutex m_transactionInProgressMutex; | 74 Mutex m_transactionInProgressMutex; |
75 bool m_transactionInProgress; | 75 bool m_transactionInProgress; |
76 bool m_isTransactionQueueEnabled; | 76 bool m_isTransactionQueueEnabled; |
77 | 77 |
78 friend class Database; | 78 friend class Database; |
79 }; | 79 }; |
80 | 80 |
81 } // namespace WebCore | 81 } // namespace WebCore |
82 | 82 |
83 #endif // DatabaseBackend_h | 83 #endif // DatabaseBackend_h |
OLD | NEW |