OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 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 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 DatabaseTracker::tracker().removeOpenDatabase(database.get()); | 102 DatabaseTracker::tracker().removeOpenDatabase(database.get()); |
103 return 0; | 103 return 0; |
104 } | 104 } |
105 | 105 |
106 DatabaseTracker::tracker().setDatabaseDetails(context->securityOrigin(), nam
e, displayName, estimatedSize); | 106 DatabaseTracker::tracker().setDatabaseDetails(context->securityOrigin(), nam
e, displayName, estimatedSize); |
107 | 107 |
108 context->setHasOpenDatabases(); | 108 context->setHasOpenDatabases(); |
109 | 109 |
110 InspectorInstrumentation::didOpenDatabase(context, database, context->securi
tyOrigin()->host(), name, expectedVersion); | 110 InspectorInstrumentation::didOpenDatabase(context, database, context->securi
tyOrigin()->host(), name, expectedVersion); |
111 | 111 |
112 // If it's a new database and a creation callback was provided, reset the ex
pected | |
113 // version to "" and schedule the creation callback. Because of some subtle
String | |
114 // implementation issues, we have to reset m_expectedVersion here instead of
doing | |
115 // it inside performOpenAndVerify() which is run on the DB thread. | |
116 if (database->isNew() && creationCallback.get()) { | 112 if (database->isNew() && creationCallback.get()) { |
117 database->m_expectedVersion = ""; | |
118 LOG(StorageAPI, "Scheduling DatabaseCreationCallbackTask for database %p
\n", database.get()); | 113 LOG(StorageAPI, "Scheduling DatabaseCreationCallbackTask for database %p
\n", database.get()); |
119 database->m_scriptExecutionContext->postTask(DatabaseCreationCallbackTas
k::create(database, creationCallback)); | 114 database->m_scriptExecutionContext->postTask(DatabaseCreationCallbackTas
k::create(database, creationCallback)); |
120 } | 115 } |
121 | 116 |
122 return database; | 117 return database; |
123 } | 118 } |
124 | 119 |
125 Database::Database(ScriptExecutionContext* context, const String& name, const St
ring& expectedVersion, const String& displayName, unsigned long estimatedSize) | 120 Database::Database(ScriptExecutionContext* context, const String& name, const St
ring& expectedVersion, const String& displayName, unsigned long estimatedSize) |
126 : AbstractDatabase(context, name, expectedVersion, displayName, estimatedSiz
e) | 121 : AbstractDatabase(context, name, expectedVersion, displayName, estimatedSiz
e) |
127 , m_transactionInProgress(false) | 122 , m_transactionInProgress(false) |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 if (m_scriptExecutionContext->isContextThread()) | 406 if (m_scriptExecutionContext->isContextThread()) |
412 return m_contextThreadSecurityOrigin.get(); | 407 return m_contextThreadSecurityOrigin.get(); |
413 if (currentThread() == m_scriptExecutionContext->databaseThread()->getThread
ID()) | 408 if (currentThread() == m_scriptExecutionContext->databaseThread()->getThread
ID()) |
414 return m_databaseThreadSecurityOrigin.get(); | 409 return m_databaseThreadSecurityOrigin.get(); |
415 return 0; | 410 return 0; |
416 } | 411 } |
417 | 412 |
418 } // namespace WebCore | 413 } // namespace WebCore |
419 | 414 |
420 #endif // ENABLE(DATABASE) | 415 #endif // ENABLE(DATABASE) |
OLD | NEW |