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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 virtual void trace(Visitor*) OVERRIDE; | 52 virtual void trace(Visitor*) OVERRIDE; |
53 | 53 |
54 virtual bool openAndVerifyVersion(bool setVersionInNewDatabase, DatabaseErro
r&, String& errorMessage) OVERRIDE FINAL; | 54 virtual bool openAndVerifyVersion(bool setVersionInNewDatabase, DatabaseErro
r&, String& errorMessage) OVERRIDE FINAL; |
55 void close(); | 55 void close(); |
56 | 56 |
57 PassRefPtr<SQLTransactionBackend> runTransaction(PassRefPtr<SQLTransaction>,
bool readOnly, const ChangeVersionData*); | 57 PassRefPtr<SQLTransactionBackend> runTransaction(PassRefPtrWillBeRawPtr<SQLT
ransaction>, bool readOnly, const ChangeVersionData*); |
58 void scheduleTransactionStep(SQLTransactionBackend*); | 58 void scheduleTransactionStep(SQLTransactionBackend*); |
59 void inProgressTransactionCompleted(); | 59 void inProgressTransactionCompleted(); |
60 | 60 |
61 SQLTransactionClient* transactionClient() const; | 61 SQLTransactionClient* transactionClient() const; |
62 SQLTransactionCoordinator* transactionCoordinator() const; | 62 SQLTransactionCoordinator* transactionCoordinator() const; |
63 | 63 |
64 private: | 64 private: |
65 class DatabaseOpenTask; | 65 class DatabaseOpenTask; |
66 class DatabaseCloseTask; | 66 class DatabaseCloseTask; |
67 class DatabaseTransactionTask; | 67 class DatabaseTransactionTask; |
68 class DatabaseTableNamesTask; | 68 class DatabaseTableNamesTask; |
69 | 69 |
70 virtual bool performOpenAndVerify(bool setVersionInNewDatabase, DatabaseErro
r&, String& errorMessage) OVERRIDE FINAL; | 70 virtual bool performOpenAndVerify(bool setVersionInNewDatabase, DatabaseErro
r&, String& errorMessage) OVERRIDE FINAL; |
71 | 71 |
72 void scheduleTransaction(); | 72 void scheduleTransaction(); |
73 | 73 |
74 Deque<RefPtr<SQLTransactionBackend> > m_transactionQueue; | 74 Deque<RefPtr<SQLTransactionBackend> > m_transactionQueue; |
75 Mutex m_transactionInProgressMutex; | 75 Mutex m_transactionInProgressMutex; |
76 bool m_transactionInProgress; | 76 bool m_transactionInProgress; |
77 bool m_isTransactionQueueEnabled; | 77 bool m_isTransactionQueueEnabled; |
78 | 78 |
79 friend class Database; | 79 friend class Database; |
80 }; | 80 }; |
81 | 81 |
82 } // namespace WebCore | 82 } // namespace WebCore |
83 | 83 |
84 #endif // DatabaseBackend_h | 84 #endif // DatabaseBackend_h |
OLD | NEW |