| 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 30 matching lines...) Expand all Loading... |
| 41 #include "platform/weborigin/SecurityOrigin.h" | 41 #include "platform/weborigin/SecurityOrigin.h" |
| 42 #include "public/platform/WebTraceLocation.h" | 42 #include "public/platform/WebTraceLocation.h" |
| 43 #include "wtf/PtrUtil.h" | 43 #include "wtf/PtrUtil.h" |
| 44 | 44 |
| 45 namespace blink { | 45 namespace blink { |
| 46 | 46 |
| 47 static DatabaseManager* s_databaseManager; | 47 static DatabaseManager* s_databaseManager; |
| 48 | 48 |
| 49 DatabaseManager& DatabaseManager::manager() | 49 DatabaseManager& DatabaseManager::manager() |
| 50 { | 50 { |
| 51 ASSERT(isMainThread()); | 51 DCHECK(isMainThread()); |
| 52 if (!s_databaseManager) | 52 if (!s_databaseManager) |
| 53 s_databaseManager = new DatabaseManager(); | 53 s_databaseManager = new DatabaseManager(); |
| 54 return *s_databaseManager; | 54 return *s_databaseManager; |
| 55 } | 55 } |
| 56 | 56 |
| 57 void DatabaseManager::terminateDatabaseThread() | 57 void DatabaseManager::terminateDatabaseThread() |
| 58 { | 58 { |
| 59 ASSERT(isMainThread()); | 59 DCHECK(isMainThread()); |
| 60 if (!s_databaseManager) | 60 if (!s_databaseManager) |
| 61 return; | 61 return; |
| 62 for (const Member<DatabaseContext>& context : s_databaseManager->m_contextMa
p.values()) | 62 for (const Member<DatabaseContext>& context : s_databaseManager->m_contextMa
p.values()) |
| 63 context->stopDatabases(); | 63 context->stopDatabases(); |
| 64 } | 64 } |
| 65 | 65 |
| 66 DatabaseManager::DatabaseManager() | 66 DatabaseManager::DatabaseManager() |
| 67 #if ENABLE(ASSERT) | 67 #if ENABLE(ASSERT) |
| 68 : m_databaseContextRegisteredCount(0) | 68 : m_databaseContextRegisteredCount(0) |
| 69 , m_databaseContextInstanceCount(0) | 69 , m_databaseContextInstanceCount(0) |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 { | 230 { |
| 231 return DatabaseTracker::tracker().fullPathForDatabase(origin, name, createIf
DoesNotExist); | 231 return DatabaseTracker::tracker().fullPathForDatabase(origin, name, createIf
DoesNotExist); |
| 232 } | 232 } |
| 233 | 233 |
| 234 void DatabaseManager::logErrorMessage(ExecutionContext* context, const String& m
essage) | 234 void DatabaseManager::logErrorMessage(ExecutionContext* context, const String& m
essage) |
| 235 { | 235 { |
| 236 context->addConsoleMessage(ConsoleMessage::create(StorageMessageSource, Erro
rMessageLevel, message)); | 236 context->addConsoleMessage(ConsoleMessage::create(StorageMessageSource, Erro
rMessageLevel, message)); |
| 237 } | 237 } |
| 238 | 238 |
| 239 } // namespace blink | 239 } // namespace blink |
| OLD | NEW |