| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 | 45 |
| 46 static DatabaseManager* g_database_manager; | 46 static DatabaseManager* g_database_manager; |
| 47 | 47 |
| 48 DatabaseManager& DatabaseManager::Manager() { | 48 DatabaseManager& DatabaseManager::Manager() { |
| 49 DCHECK(IsMainThread()); | 49 DCHECK(IsMainThread()); |
| 50 if (!g_database_manager) | 50 if (!g_database_manager) |
| 51 g_database_manager = new DatabaseManager(); | 51 g_database_manager = new DatabaseManager(); |
| 52 return *g_database_manager; | 52 return *g_database_manager; |
| 53 } | 53 } |
| 54 | 54 |
| 55 DatabaseManager::DatabaseManager() | 55 DatabaseManager::DatabaseManager() {} |
| 56 { | |
| 57 } | |
| 58 | 56 |
| 59 DatabaseManager::~DatabaseManager() {} | 57 DatabaseManager::~DatabaseManager() {} |
| 60 | 58 |
| 61 DatabaseContext* DatabaseManager::ExistingDatabaseContextFor( | 59 DatabaseContext* DatabaseManager::ExistingDatabaseContextFor( |
| 62 ExecutionContext* context) { | 60 ExecutionContext* context) { |
| 63 #if DCHECK_IS_ON() | 61 #if DCHECK_IS_ON() |
| 64 DCHECK_GE(database_context_registered_count_, 0); | 62 DCHECK_GE(database_context_registered_count_, 0); |
| 65 DCHECK_GE(database_context_instance_count_, 0); | 63 DCHECK_GE(database_context_instance_count_, 0); |
| 66 DCHECK_LE(database_context_registered_count_, | 64 DCHECK_LE(database_context_registered_count_, |
| 67 database_context_instance_count_); | 65 database_context_instance_count_); |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 origin, name, create_if_does_not_exist); | 200 origin, name, create_if_does_not_exist); |
| 203 } | 201 } |
| 204 | 202 |
| 205 void DatabaseManager::LogErrorMessage(ExecutionContext* context, | 203 void DatabaseManager::LogErrorMessage(ExecutionContext* context, |
| 206 const String& message) { | 204 const String& message) { |
| 207 context->AddConsoleMessage(ConsoleMessage::Create( | 205 context->AddConsoleMessage(ConsoleMessage::Create( |
| 208 kStorageMessageSource, kErrorMessageLevel, message)); | 206 kStorageMessageSource, kErrorMessageLevel, message)); |
| 209 } | 207 } |
| 210 | 208 |
| 211 } // namespace blink | 209 } // namespace blink |
| OLD | NEW |