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 22 matching lines...) Expand all Loading... |
33 #include "core/dom/ExecutionContextTask.h" | 33 #include "core/dom/ExecutionContextTask.h" |
34 #include "core/inspector/ConsoleMessage.h" | 34 #include "core/inspector/ConsoleMessage.h" |
35 #include "modules/webdatabase/Database.h" | 35 #include "modules/webdatabase/Database.h" |
36 #include "modules/webdatabase/DatabaseCallback.h" | 36 #include "modules/webdatabase/DatabaseCallback.h" |
37 #include "modules/webdatabase/DatabaseClient.h" | 37 #include "modules/webdatabase/DatabaseClient.h" |
38 #include "modules/webdatabase/DatabaseContext.h" | 38 #include "modules/webdatabase/DatabaseContext.h" |
39 #include "modules/webdatabase/DatabaseTask.h" | 39 #include "modules/webdatabase/DatabaseTask.h" |
40 #include "modules/webdatabase/DatabaseTracker.h" | 40 #include "modules/webdatabase/DatabaseTracker.h" |
41 #include "platform/Logging.h" | 41 #include "platform/Logging.h" |
42 #include "platform/weborigin/SecurityOrigin.h" | 42 #include "platform/weborigin/SecurityOrigin.h" |
43 #include "public/platform/WebTraceLocation.h" | |
44 #include "wtf/MainThread.h" | 43 #include "wtf/MainThread.h" |
45 | 44 |
46 namespace blink { | 45 namespace blink { |
47 | 46 |
48 static DatabaseManager* s_databaseManager; | 47 static DatabaseManager* s_databaseManager; |
49 | 48 |
50 DatabaseManager& DatabaseManager::manager() | 49 DatabaseManager& DatabaseManager::manager() |
51 { | 50 { |
52 ASSERT(isMainThread()); | 51 ASSERT(isMainThread()); |
53 if (!s_databaseManager) | 52 if (!s_databaseManager) |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 Database* database = openDatabaseInternal(context, name, | 212 Database* database = openDatabaseInternal(context, name, |
214 expectedVersion, displayName, estimatedSize, setVersionInNewDatabase, er
ror, errorMessage); | 213 expectedVersion, displayName, estimatedSize, setVersionInNewDatabase, er
ror, errorMessage); |
215 if (!database) | 214 if (!database) |
216 return nullptr; | 215 return nullptr; |
217 | 216 |
218 databaseContextFor(context)->setHasOpenDatabases(); | 217 databaseContextFor(context)->setHasOpenDatabases(); |
219 DatabaseClient::from(context)->didOpenDatabase(database, context->securityOr
igin()->host(), name, expectedVersion); | 218 DatabaseClient::from(context)->didOpenDatabase(database, context->securityOr
igin()->host(), name, expectedVersion); |
220 | 219 |
221 if (database->isNew() && creationCallback) { | 220 if (database->isNew() && creationCallback) { |
222 WTF_LOG(StorageAPI, "Scheduling DatabaseCreationCallbackTask for databas
e %p\n", database); | 221 WTF_LOG(StorageAPI, "Scheduling DatabaseCreationCallbackTask for databas
e %p\n", database); |
223 database->executionContext()->postTask(FROM_HERE, DatabaseCreationCallba
ckTask::create(database, creationCallback)); | 222 database->executionContext()->postTask(DatabaseCreationCallbackTask::cre
ate(database, creationCallback)); |
224 } | 223 } |
225 | 224 |
226 ASSERT(database); | 225 ASSERT(database); |
227 return database; | 226 return database; |
228 } | 227 } |
229 | 228 |
230 String DatabaseManager::fullPathForDatabase(SecurityOrigin* origin, const String
& name, bool createIfDoesNotExist) | 229 String DatabaseManager::fullPathForDatabase(SecurityOrigin* origin, const String
& name, bool createIfDoesNotExist) |
231 { | 230 { |
232 return DatabaseTracker::tracker().fullPathForDatabase(origin, name, createIf
DoesNotExist); | 231 return DatabaseTracker::tracker().fullPathForDatabase(origin, name, createIf
DoesNotExist); |
233 } | 232 } |
234 | 233 |
235 void DatabaseManager::logErrorMessage(ExecutionContext* context, const String& m
essage) | 234 void DatabaseManager::logErrorMessage(ExecutionContext* context, const String& m
essage) |
236 { | 235 { |
237 context->addConsoleMessage(ConsoleMessage::create(StorageMessageSource, Erro
rMessageLevel, message)); | 236 context->addConsoleMessage(ConsoleMessage::create(StorageMessageSource, Erro
rMessageLevel, message)); |
238 } | 237 } |
239 | 238 |
240 } // namespace blink | 239 } // namespace blink |
OLD | NEW |