| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 | 48 |
| 49 public: | 49 public: |
| 50 static DatabaseManager& manager(); | 50 static DatabaseManager& manager(); |
| 51 static void terminateDatabaseThread(); | 51 static void terminateDatabaseThread(); |
| 52 | 52 |
| 53 // These 2 methods are for DatabaseContext (un)registration, and should only | 53 // These 2 methods are for DatabaseContext (un)registration, and should only |
| 54 // be called by the DatabaseContext constructor and destructor. | 54 // be called by the DatabaseContext constructor and destructor. |
| 55 void registerDatabaseContext(DatabaseContext*); | 55 void registerDatabaseContext(DatabaseContext*); |
| 56 void unregisterDatabaseContext(DatabaseContext*); | 56 void unregisterDatabaseContext(DatabaseContext*); |
| 57 | 57 |
| 58 #if ENABLE(ASSERT) | 58 #if DCHECK_IS_ON() |
| 59 void didConstructDatabaseContext(); | 59 void didConstructDatabaseContext(); |
| 60 void didDestructDatabaseContext(); | 60 void didDestructDatabaseContext(); |
| 61 #else | 61 #else |
| 62 void didConstructDatabaseContext() {} | 62 void didConstructDatabaseContext() {} |
| 63 void didDestructDatabaseContext() {} | 63 void didDestructDatabaseContext() {} |
| 64 #endif | 64 #endif |
| 65 | 65 |
| 66 static void throwExceptionForDatabaseError(DatabaseError, | 66 static void throwExceptionForDatabaseError(DatabaseError, |
| 67 const String& errorMessage, | 67 const String& errorMessage, |
| 68 ExceptionState&); | 68 ExceptionState&); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 | 102 |
| 103 static void logErrorMessage(ExecutionContext*, const String& message); | 103 static void logErrorMessage(ExecutionContext*, const String& message); |
| 104 | 104 |
| 105 // m_contextMap can have two or more entries even though we don't support | 105 // m_contextMap can have two or more entries even though we don't support |
| 106 // Web SQL on workers because single Blink process can have multiple main | 106 // Web SQL on workers because single Blink process can have multiple main |
| 107 // contexts. | 107 // contexts. |
| 108 typedef PersistentHeapHashMap<Member<ExecutionContext>, | 108 typedef PersistentHeapHashMap<Member<ExecutionContext>, |
| 109 Member<DatabaseContext>> | 109 Member<DatabaseContext>> |
| 110 ContextMap; | 110 ContextMap; |
| 111 ContextMap m_contextMap; | 111 ContextMap m_contextMap; |
| 112 #if ENABLE(ASSERT) | 112 #if DCHECK_IS_ON() |
| 113 int m_databaseContextRegisteredCount; | 113 int m_databaseContextRegisteredCount = 0; |
| 114 int m_databaseContextInstanceCount; | 114 int m_databaseContextInstanceCount = 0; |
| 115 #endif | 115 #endif |
| 116 }; | 116 }; |
| 117 | 117 |
| 118 } // namespace blink | 118 } // namespace blink |
| 119 | 119 |
| 120 #endif // DatabaseManager_h | 120 #endif // DatabaseManager_h |
| OLD | NEW |