| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2013 Apple Inc. All rights reserved. | 3 * Copyright (C) 2013 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 #include "wtf/RefPtr.h" | 38 #include "wtf/RefPtr.h" |
| 39 #include "wtf/ThreadSafeRefCounted.h" | 39 #include "wtf/ThreadSafeRefCounted.h" |
| 40 #include "wtf/text/WTFString.h" | 40 #include "wtf/text/WTFString.h" |
| 41 | 41 |
| 42 #if !LOG_DISABLED || !ERROR_DISABLED | 42 #if !LOG_DISABLED || !ERROR_DISABLED |
| 43 #include "platform/weborigin/SecurityOrigin.h" | 43 #include "platform/weborigin/SecurityOrigin.h" |
| 44 #endif | 44 #endif |
| 45 | 45 |
| 46 namespace blink { | 46 namespace blink { |
| 47 | 47 |
| 48 class Database; |
| 48 class DatabaseAuthorizer; | 49 class DatabaseAuthorizer; |
| 49 class DatabaseContext; | 50 class DatabaseContext; |
| 50 class DatabaseBase; | |
| 51 class ExecutionContext; | 51 class ExecutionContext; |
| 52 class SecurityOrigin; | 52 class SecurityOrigin; |
| 53 | 53 |
| 54 // FIXME: This abstraction is unnecessary because DatabaseBackendSync was | 54 // FIXME: This abstraction is unnecessary because DatabaseBackendSync was |
| 55 // removed. | 55 // removed. |
| 56 class DatabaseBackendBase : public ThreadSafeRefCountedWillBeGarbageCollectedFin
alized<DatabaseBackendBase> { | 56 class DatabaseBackendBase : public ThreadSafeRefCountedWillBeGarbageCollectedFin
alized<DatabaseBackendBase> { |
| 57 public: | 57 public: |
| 58 virtual ~DatabaseBackendBase(); | 58 virtual ~DatabaseBackendBase(); |
| 59 virtual void trace(Visitor*); | 59 virtual void trace(Visitor*); |
| 60 | 60 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 80 bool lastActionWasInsert(); | 80 bool lastActionWasInsert(); |
| 81 void resetDeletes(); | 81 void resetDeletes(); |
| 82 bool hadDeletes(); | 82 bool hadDeletes(); |
| 83 void resetAuthorizer(); | 83 void resetAuthorizer(); |
| 84 | 84 |
| 85 virtual void closeImmediately() = 0; | 85 virtual void closeImmediately() = 0; |
| 86 void closeDatabase(); | 86 void closeDatabase(); |
| 87 | 87 |
| 88 DatabaseContext* databaseContext() const { return m_databaseContext.get(); } | 88 DatabaseContext* databaseContext() const { return m_databaseContext.get(); } |
| 89 ExecutionContext* executionContext() const; | 89 ExecutionContext* executionContext() const; |
| 90 void setFrontend(DatabaseBase* frontend) { m_frontend = frontend; } | 90 void setFrontend(Database* frontend) { m_frontend = frontend; } |
| 91 | 91 |
| 92 protected: | 92 protected: |
| 93 friend class ChangeVersionWrapper; | 93 friend class ChangeVersionWrapper; |
| 94 friend class SQLStatementBackend; | 94 friend class SQLStatementBackend; |
| 95 friend class SQLTransactionBackend; | 95 friend class SQLTransactionBackend; |
| 96 | 96 |
| 97 DatabaseBackendBase(DatabaseContext*, const String& name, const String& expe
ctedVersion, | 97 DatabaseBackendBase(DatabaseContext*, const String& name, const String& expe
ctedVersion, |
| 98 const String& displayName, unsigned long estimatedSize); | 98 const String& displayName, unsigned long estimatedSize); |
| 99 | 99 |
| 100 virtual bool openAndVerifyVersion(bool setVersionInNewDatabase, DatabaseErro
r&, String& errorMessage) = 0; | 100 virtual bool openAndVerifyVersion(bool setVersionInNewDatabase, DatabaseErro
r&, String& errorMessage) = 0; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 119 | 119 |
| 120 RefPtr<SecurityOrigin> m_contextThreadSecurityOrigin; | 120 RefPtr<SecurityOrigin> m_contextThreadSecurityOrigin; |
| 121 RefPtrWillBeMember<DatabaseContext> m_databaseContext; // Associated with m_
executionContext. | 121 RefPtrWillBeMember<DatabaseContext> m_databaseContext; // Associated with m_
executionContext. |
| 122 | 122 |
| 123 String m_name; | 123 String m_name; |
| 124 String m_expectedVersion; | 124 String m_expectedVersion; |
| 125 String m_displayName; | 125 String m_displayName; |
| 126 unsigned long m_estimatedSize; | 126 unsigned long m_estimatedSize; |
| 127 String m_filename; | 127 String m_filename; |
| 128 | 128 |
| 129 DatabaseBase* m_frontend; | 129 Database* m_frontend; |
| 130 | 130 |
| 131 #if !LOG_DISABLED || !ERROR_DISABLED | 131 #if !LOG_DISABLED || !ERROR_DISABLED |
| 132 String databaseDebugName() const { return m_contextThreadSecurityOrigin->toS
tring() + "::" + m_name; } | 132 String databaseDebugName() const { return m_contextThreadSecurityOrigin->toS
tring() + "::" + m_name; } |
| 133 #endif | 133 #endif |
| 134 | 134 |
| 135 private: | 135 private: |
| 136 DatabaseGuid m_guid; | 136 DatabaseGuid m_guid; |
| 137 bool m_opened; | 137 bool m_opened; |
| 138 bool m_new; | 138 bool m_new; |
| 139 | 139 |
| 140 SQLiteDatabase m_sqliteDatabase; | 140 SQLiteDatabase m_sqliteDatabase; |
| 141 | 141 |
| 142 RefPtrWillBeMember<DatabaseAuthorizer> m_databaseAuthorizer; | 142 RefPtrWillBeMember<DatabaseAuthorizer> m_databaseAuthorizer; |
| 143 | 143 |
| 144 friend class DatabaseServer; | 144 friend class DatabaseServer; |
| 145 }; | 145 }; |
| 146 | 146 |
| 147 } // namespace blink | 147 } // namespace blink |
| 148 | 148 |
| 149 #endif // DatabaseBackendBase_h | 149 #endif // DatabaseBackendBase_h |
| OLD | NEW |