| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 class DatabaseManager { | 54 class DatabaseManager { |
| 55 WTF_MAKE_NONCOPYABLE(DatabaseManager); WTF_MAKE_FAST_ALLOCATED; | 55 WTF_MAKE_NONCOPYABLE(DatabaseManager); WTF_MAKE_FAST_ALLOCATED; |
| 56 public: | 56 public: |
| 57 static DatabaseManager& manager(); | 57 static DatabaseManager& manager(); |
| 58 | 58 |
| 59 // These 2 methods are for DatabaseContext (un)registration, and should only | 59 // These 2 methods are for DatabaseContext (un)registration, and should only |
| 60 // be called by the DatabaseContext constructor and destructor. | 60 // be called by the DatabaseContext constructor and destructor. |
| 61 void registerDatabaseContext(DatabaseContext*); | 61 void registerDatabaseContext(DatabaseContext*); |
| 62 void unregisterDatabaseContext(DatabaseContext*); | 62 void unregisterDatabaseContext(DatabaseContext*); |
| 63 | 63 |
| 64 #if ASSERT_ENABLED | 64 #if ENABLE(ASSERT) |
| 65 void didConstructDatabaseContext(); | 65 void didConstructDatabaseContext(); |
| 66 void didDestructDatabaseContext(); | 66 void didDestructDatabaseContext(); |
| 67 #else | 67 #else |
| 68 void didConstructDatabaseContext() { } | 68 void didConstructDatabaseContext() { } |
| 69 void didDestructDatabaseContext() { } | 69 void didDestructDatabaseContext() { } |
| 70 #endif | 70 #endif |
| 71 | 71 |
| 72 static void throwExceptionForDatabaseError(DatabaseError, const String& erro
rMessage, ExceptionState&); | 72 static void throwExceptionForDatabaseError(DatabaseError, const String& erro
rMessage, ExceptionState&); |
| 73 | 73 |
| 74 PassRefPtrWillBeRawPtr<Database> openDatabase(ExecutionContext*, const Strin
g& name, const String& expectedVersion, const String& displayName, unsigned long
estimatedSize, PassOwnPtr<DatabaseCallback>, DatabaseError&, String& errorMessa
ge); | 74 PassRefPtrWillBeRawPtr<Database> openDatabase(ExecutionContext*, const Strin
g& name, const String& expectedVersion, const String& displayName, unsigned long
estimatedSize, PassOwnPtr<DatabaseCallback>, DatabaseError&, String& errorMessa
ge); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 100 AbstractDatabaseServer* m_server; | 100 AbstractDatabaseServer* m_server; |
| 101 | 101 |
| 102 // Access to the following fields require locking m_contextMapLock: | 102 // Access to the following fields require locking m_contextMapLock: |
| 103 #if ENABLE(OILPAN) | 103 #if ENABLE(OILPAN) |
| 104 // We can't use PersistentHeapHashMap because multiple threads update the ma
p. | 104 // We can't use PersistentHeapHashMap because multiple threads update the ma
p. |
| 105 typedef HashMap<ExecutionContext*, OwnPtr<Persistent<DatabaseContext> > > Co
ntextMap; | 105 typedef HashMap<ExecutionContext*, OwnPtr<Persistent<DatabaseContext> > > Co
ntextMap; |
| 106 #else | 106 #else |
| 107 typedef HashMap<ExecutionContext*, RefPtr<DatabaseContext> > ContextMap; | 107 typedef HashMap<ExecutionContext*, RefPtr<DatabaseContext> > ContextMap; |
| 108 #endif | 108 #endif |
| 109 ContextMap m_contextMap; | 109 ContextMap m_contextMap; |
| 110 #if ASSERT_ENABLED | 110 #if ENABLE(ASSERT) |
| 111 int m_databaseContextRegisteredCount; | 111 int m_databaseContextRegisteredCount; |
| 112 int m_databaseContextInstanceCount; | 112 int m_databaseContextInstanceCount; |
| 113 #endif | 113 #endif |
| 114 Mutex m_contextMapLock; | 114 Mutex m_contextMapLock; |
| 115 }; | 115 }; |
| 116 | 116 |
| 117 } // namespace WebCore | 117 } // namespace WebCore |
| 118 | 118 |
| 119 #endif // DatabaseManager_h | 119 #endif // DatabaseManager_h |
| OLD | NEW |