| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2012 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 PassRefPtrWillBeRawPtr<DatabaseSync> openDatabaseSync(ExecutionContext*, con
st String& name, const String& expectedVersion, const String& displayName, unsig
ned long estimatedSize, PassOwnPtr<DatabaseCallback>, DatabaseError&, String& er
rorMessage); | 74 PassRefPtrWillBeRawPtr<DatabaseSync> openDatabaseSync(ExecutionContext*, con
st String& name, const String& expectedVersion, const String& displayName, unsig
ned long estimatedSize, PassOwnPtr<DatabaseCallback>, DatabaseError&, String& er
rorMessage); |
| 75 | 75 |
| 76 String fullPathForDatabase(SecurityOrigin*, const String& name, bool createI
fDoesNotExist = true); | 76 String fullPathForDatabase(SecurityOrigin*, const String& name, bool createI
fDoesNotExist = true); |
| 77 | 77 |
| 78 void closeDatabasesImmediately(const String& originIdentifier, const String&
name); | 78 void closeDatabasesImmediately(const String& originIdentifier, const String&
name); |
| 79 | 79 |
| 80 void interruptAllDatabasesForContext(DatabaseContext*); | 80 void interruptAllDatabasesForContext(DatabaseContext*); |
| 81 | 81 |
| 82 private: | 82 private: |
| 83 DatabaseManager(); | 83 DatabaseManager(); |
| 84 ~DatabaseManager() { } | 84 ~DatabaseManager(); |
| 85 | 85 |
| 86 // This gets a DatabaseContext for the specified ExecutionContext. | 86 // This gets a DatabaseContext for the specified ExecutionContext. |
| 87 // If one doesn't already exist, it will create a new one. | 87 // If one doesn't already exist, it will create a new one. |
| 88 DatabaseContext* databaseContextFor(ExecutionContext*); | 88 DatabaseContext* databaseContextFor(ExecutionContext*); |
| 89 // This gets a DatabaseContext for the specified ExecutionContext if | 89 // This gets a DatabaseContext for the specified ExecutionContext if |
| 90 // it already exist previously. Otherwise, it returns 0. | 90 // it already exist previously. Otherwise, it returns 0. |
| 91 DatabaseContext* existingDatabaseContextFor(ExecutionContext*); | 91 DatabaseContext* existingDatabaseContextFor(ExecutionContext*); |
| 92 | 92 |
| 93 PassRefPtrWillBeRawPtr<DatabaseBackendBase> openDatabaseBackend(ExecutionCon
text*, | 93 PassRefPtrWillBeRawPtr<DatabaseBackendBase> openDatabaseBackend(ExecutionCon
text*, |
| 94 DatabaseType, const String& name, const String& expectedVersion, const S
tring& displayName, | 94 DatabaseType, const String& name, const String& expectedVersion, const S
tring& displayName, |
| 95 unsigned long estimatedSize, bool setVersionInNewDatabase, DatabaseError
&, String& errorMessage); | 95 unsigned long estimatedSize, bool setVersionInNewDatabase, DatabaseError
&, String& errorMessage); |
| 96 | 96 |
| 97 static void logErrorMessage(ExecutionContext*, const String& message); | 97 static void logErrorMessage(ExecutionContext*, const String& message); |
| 98 | 98 |
| 99 AbstractDatabaseServer* m_server; | 99 AbstractDatabaseServer* m_server; |
| 100 | 100 |
| 101 // Access to the following fields require locking m_contextMapLock: | 101 // Access to the following fields require locking m_contextMapLock: |
| 102 typedef HashMap<ExecutionContext*, DatabaseContext*> ContextMap; | 102 typedef HashMap<ExecutionContext*, RefPtr<DatabaseContext> > ContextMap; |
| 103 ContextMap m_contextMap; | 103 ContextMap m_contextMap; |
| 104 #if !ASSERT_DISABLED | 104 #if !ASSERT_DISABLED |
| 105 int m_databaseContextRegisteredCount; | 105 int m_databaseContextRegisteredCount; |
| 106 int m_databaseContextInstanceCount; | 106 int m_databaseContextInstanceCount; |
| 107 #endif | 107 #endif |
| 108 Mutex m_contextMapLock; | 108 Mutex m_contextMapLock; |
| 109 }; | 109 }; |
| 110 | 110 |
| 111 } // namespace WebCore | 111 } // namespace WebCore |
| 112 | 112 |
| 113 #endif // DatabaseManager_h | 113 #endif // DatabaseManager_h |
| OLD | NEW |