| 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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 } | 151 } |
| 152 | 152 |
| 153 void DatabaseManager::didDestructDatabaseContext() | 153 void DatabaseManager::didDestructDatabaseContext() |
| 154 { | 154 { |
| 155 MutexLocker lock(m_contextMapLock); | 155 MutexLocker lock(m_contextMapLock); |
| 156 m_databaseContextInstanceCount--; | 156 m_databaseContextInstanceCount--; |
| 157 ASSERT(m_databaseContextRegisteredCount <= m_databaseContextInstanceCount); | 157 ASSERT(m_databaseContextRegisteredCount <= m_databaseContextInstanceCount); |
| 158 } | 158 } |
| 159 #endif | 159 #endif |
| 160 | 160 |
| 161 void DatabaseManager::throwExceptionForDatabaseError(const String& method, const
String& context, DatabaseError error, const String& errorMessage, ExceptionStat
e& exceptionState) | 161 void DatabaseManager::throwExceptionForDatabaseError(DatabaseError error, const
String& errorMessage, ExceptionState& exceptionState) |
| 162 { | 162 { |
| 163 switch (error) { | 163 switch (error) { |
| 164 case DatabaseError::None: | 164 case DatabaseError::None: |
| 165 return; | 165 return; |
| 166 case DatabaseError::GenericSecurityError: | 166 case DatabaseError::GenericSecurityError: |
| 167 exceptionState.throwSecurityError(ExceptionMessages::failedToExecute(met
hod, context, errorMessage)); | 167 exceptionState.throwSecurityError(errorMessage); |
| 168 return; | 168 return; |
| 169 case DatabaseError::InvalidDatabaseState: | 169 case DatabaseError::InvalidDatabaseState: |
| 170 exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::f
ailedToExecute(method, context, errorMessage)); | 170 exceptionState.throwDOMException(InvalidStateError, errorMessage); |
| 171 return; | 171 return; |
| 172 default: | 172 default: |
| 173 ASSERT_NOT_REACHED(); | 173 ASSERT_NOT_REACHED(); |
| 174 } | 174 } |
| 175 } | 175 } |
| 176 | 176 |
| 177 static void logOpenDatabaseError(ExecutionContext* context, const String& name) | 177 static void logOpenDatabaseError(ExecutionContext* context, const String& name) |
| 178 { | 178 { |
| 179 UNUSED_PARAM(context); | 179 UNUSED_PARAM(context); |
| 180 UNUSED_PARAM(name); | 180 UNUSED_PARAM(name); |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 if (databaseContext) | 299 if (databaseContext) |
| 300 m_server->interruptAllDatabasesForContext(databaseContext->backend().get
()); | 300 m_server->interruptAllDatabasesForContext(databaseContext->backend().get
()); |
| 301 } | 301 } |
| 302 | 302 |
| 303 void DatabaseManager::logErrorMessage(ExecutionContext* context, const String& m
essage) | 303 void DatabaseManager::logErrorMessage(ExecutionContext* context, const String& m
essage) |
| 304 { | 304 { |
| 305 context->addConsoleMessage(StorageMessageSource, ErrorMessageLevel, message)
; | 305 context->addConsoleMessage(StorageMessageSource, ErrorMessageLevel, message)
; |
| 306 } | 306 } |
| 307 | 307 |
| 308 } // namespace WebCore | 308 } // namespace WebCore |
| OLD | NEW |