Chromium Code Reviews| 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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 108 | 108 |
| 109 Vector<String> tableNames(); | 109 Vector<String> tableNames(); |
| 110 void scheduleTransactionCallback(SQLTransaction*); | 110 void scheduleTransactionCallback(SQLTransaction*); |
| 111 void closeImmediately(); | 111 void closeImmediately(); |
| 112 void closeDatabase(); | 112 void closeDatabase(); |
| 113 | 113 |
| 114 DatabaseContext* getDatabaseContext() const { | 114 DatabaseContext* getDatabaseContext() const { |
| 115 return m_databaseContext.get(); | 115 return m_databaseContext.get(); |
| 116 } | 116 } |
| 117 ExecutionContext* getExecutionContext() const; | 117 ExecutionContext* getExecutionContext() const; |
| 118 WebTaskRunner* getDatabaseTaskRunner() const; | |
| 118 | 119 |
| 119 private: | 120 private: |
| 120 class DatabaseOpenTask; | 121 class DatabaseOpenTask; |
| 121 class DatabaseCloseTask; | 122 class DatabaseCloseTask; |
| 122 class DatabaseTransactionTask; | 123 class DatabaseTransactionTask; |
| 123 class DatabaseTableNamesTask; | 124 class DatabaseTableNamesTask; |
| 124 | 125 |
| 125 Database(DatabaseContext*, | 126 Database(DatabaseContext*, |
| 126 const String& name, | 127 const String& name, |
| 127 const String& expectedVersion, | 128 const String& expectedVersion, |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 169 void logErrorMessage(const String&); | 170 void logErrorMessage(const String&); |
| 170 static const char* databaseInfoTableName(); | 171 static const char* databaseInfoTableName(); |
| 171 String databaseDebugName() const { | 172 String databaseDebugName() const { |
| 172 return m_contextThreadSecurityOrigin->toString() + "::" + m_name; | 173 return m_contextThreadSecurityOrigin->toString() + "::" + m_name; |
| 173 } | 174 } |
| 174 | 175 |
| 175 RefPtr<SecurityOrigin> m_contextThreadSecurityOrigin; | 176 RefPtr<SecurityOrigin> m_contextThreadSecurityOrigin; |
| 176 RefPtr<SecurityOrigin> m_databaseThreadSecurityOrigin; | 177 RefPtr<SecurityOrigin> m_databaseThreadSecurityOrigin; |
| 177 Member<DatabaseContext> | 178 Member<DatabaseContext> |
| 178 m_databaseContext; // Associated with m_executionContext. | 179 m_databaseContext; // Associated with m_executionContext. |
| 180 // TaskRunnerHelper::get is not thread-safe, so we save WebTaskRunner for | |
| 181 // DatabaseContext for later use as the constructor runs in the main thread. | |
|
nhiroki
2017/03/09 09:07:39
s/DatabaseContext/TaskType::DatabaseAccess/ ?
yuryu
2017/03/10 06:00:57
Done.
| |
| 182 RefPtr<WebTaskRunner> m_databaseTaskRunner; | |
| 179 | 183 |
| 180 String m_name; | 184 String m_name; |
| 181 String m_expectedVersion; | 185 String m_expectedVersion; |
| 182 String m_displayName; | 186 String m_displayName; |
| 183 unsigned long m_estimatedSize; | 187 unsigned long m_estimatedSize; |
| 184 String m_filename; | 188 String m_filename; |
| 185 | 189 |
| 186 DatabaseGuid m_guid; | 190 DatabaseGuid m_guid; |
| 187 int m_opened; | 191 int m_opened; |
| 188 bool m_new; | 192 bool m_new; |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 199 friend class ChangeVersionWrapper; | 203 friend class ChangeVersionWrapper; |
| 200 friend class DatabaseManager; | 204 friend class DatabaseManager; |
| 201 friend class SQLStatementBackend; | 205 friend class SQLStatementBackend; |
| 202 friend class SQLTransaction; | 206 friend class SQLTransaction; |
| 203 friend class SQLTransactionBackend; | 207 friend class SQLTransactionBackend; |
| 204 }; | 208 }; |
| 205 | 209 |
| 206 } // namespace blink | 210 } // namespace blink |
| 207 | 211 |
| 208 #endif // Database_h | 212 #endif // Database_h |
| OLD | NEW |