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 13 matching lines...) Expand all Loading... |
24 */ | 24 */ |
25 | 25 |
26 #include "config.h" | 26 #include "config.h" |
27 #include "modules/webdatabase/DatabaseManager.h" | 27 #include "modules/webdatabase/DatabaseManager.h" |
28 | 28 |
29 #include "bindings/v8/ExceptionMessages.h" | 29 #include "bindings/v8/ExceptionMessages.h" |
30 #include "bindings/v8/ExceptionState.h" | 30 #include "bindings/v8/ExceptionState.h" |
31 #include "core/dom/ExceptionCode.h" | 31 #include "core/dom/ExceptionCode.h" |
32 #include "core/dom/ExecutionContext.h" | 32 #include "core/dom/ExecutionContext.h" |
33 #include "core/dom/ExecutionContextTask.h" | 33 #include "core/dom/ExecutionContextTask.h" |
34 #include "core/inspector/InspectorDatabaseInstrumentation.h" | |
35 #include "platform/Logging.h" | 34 #include "platform/Logging.h" |
36 #include "modules/webdatabase/AbstractDatabaseServer.h" | 35 #include "modules/webdatabase/AbstractDatabaseServer.h" |
37 #include "modules/webdatabase/Database.h" | 36 #include "modules/webdatabase/Database.h" |
38 #include "modules/webdatabase/DatabaseBackend.h" | 37 #include "modules/webdatabase/DatabaseBackend.h" |
39 #include "modules/webdatabase/DatabaseBackendBase.h" | 38 #include "modules/webdatabase/DatabaseBackendBase.h" |
40 #include "modules/webdatabase/DatabaseBackendSync.h" | 39 #include "modules/webdatabase/DatabaseBackendSync.h" |
41 #include "modules/webdatabase/DatabaseCallback.h" | 40 #include "modules/webdatabase/DatabaseCallback.h" |
| 41 #include "modules/webdatabase/DatabaseClient.h" |
42 #include "modules/webdatabase/DatabaseContext.h" | 42 #include "modules/webdatabase/DatabaseContext.h" |
43 #include "modules/webdatabase/DatabaseServer.h" | 43 #include "modules/webdatabase/DatabaseServer.h" |
44 #include "modules/webdatabase/DatabaseSync.h" | 44 #include "modules/webdatabase/DatabaseSync.h" |
45 #include "modules/webdatabase/DatabaseTask.h" | 45 #include "modules/webdatabase/DatabaseTask.h" |
46 #include "platform/weborigin/SecurityOrigin.h" | 46 #include "platform/weborigin/SecurityOrigin.h" |
47 | 47 |
48 namespace WebCore { | 48 namespace WebCore { |
49 | 49 |
50 DatabaseManager& DatabaseManager::manager() | 50 DatabaseManager& DatabaseManager::manager() |
51 { | 51 { |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 bool setVersionInNewDatabase = !creationCallback; | 222 bool setVersionInNewDatabase = !creationCallback; |
223 RefPtr<DatabaseBackendBase> backend = openDatabaseBackend(context, DatabaseT
ype::Async, name, | 223 RefPtr<DatabaseBackendBase> backend = openDatabaseBackend(context, DatabaseT
ype::Async, name, |
224 expectedVersion, displayName, estimatedSize, setVersionInNewDatabase, er
ror, errorMessage); | 224 expectedVersion, displayName, estimatedSize, setVersionInNewDatabase, er
ror, errorMessage); |
225 if (!backend) | 225 if (!backend) |
226 return 0; | 226 return 0; |
227 | 227 |
228 RefPtr<Database> database = Database::create(context, backend); | 228 RefPtr<Database> database = Database::create(context, backend); |
229 | 229 |
230 RefPtr<DatabaseContext> databaseContext = databaseContextFor(context); | 230 RefPtr<DatabaseContext> databaseContext = databaseContextFor(context); |
231 databaseContext->setHasOpenDatabases(); | 231 databaseContext->setHasOpenDatabases(); |
232 InspectorInstrumentation::didOpenDatabase(context, database, context->securi
tyOrigin()->host(), name, expectedVersion); | 232 DatabaseClient::from(context)->didOpenDatabase(database, context->securityOr
igin()->host(), name, expectedVersion); |
233 | 233 |
234 if (backend->isNew() && creationCallback.get()) { | 234 if (backend->isNew() && creationCallback.get()) { |
235 WTF_LOG(StorageAPI, "Scheduling DatabaseCreationCallbackTask for databas
e %p\n", database.get()); | 235 WTF_LOG(StorageAPI, "Scheduling DatabaseCreationCallbackTask for databas
e %p\n", database.get()); |
236 database->m_executionContext->postTask(DatabaseCreationCallbackTask::cre
ate(database, creationCallback)); | 236 database->m_executionContext->postTask(DatabaseCreationCallbackTask::cre
ate(database, creationCallback)); |
237 } | 237 } |
238 | 238 |
239 ASSERT(database); | 239 ASSERT(database); |
240 return database.release(); | 240 return database.release(); |
241 } | 241 } |
242 | 242 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 if (databaseContext) | 289 if (databaseContext) |
290 m_server->interruptAllDatabasesForContext(databaseContext->backend().get
()); | 290 m_server->interruptAllDatabasesForContext(databaseContext->backend().get
()); |
291 } | 291 } |
292 | 292 |
293 void DatabaseManager::logErrorMessage(ExecutionContext* context, const String& m
essage) | 293 void DatabaseManager::logErrorMessage(ExecutionContext* context, const String& m
essage) |
294 { | 294 { |
295 context->addConsoleMessage(StorageMessageSource, ErrorMessageLevel, message)
; | 295 context->addConsoleMessage(StorageMessageSource, ErrorMessageLevel, message)
; |
296 } | 296 } |
297 | 297 |
298 } // namespace WebCore | 298 } // namespace WebCore |
OLD | NEW |