Changeset 55474 in webkit
- Timestamp:
- Mar 3, 2010 1:48:49 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 9 added
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r55471 r55474 1 2010-03-03 Dumitru Daniliuc <dumi@chromium.org> 2 3 Reviewed by Adam Barth. 4 5 Adding a test to test the creation callback passed to 6 openDatabase() and another one to make sure it is executed in the 7 correct world. 8 9 https://bugs.webkit.org/show_bug.cgi?id=34726 10 11 * storage/open-database-creation-callback-expected.txt: Added. 12 * storage/open-database-creation-callback.html: Added. 13 * storage/open-database-creation-callback-isolated-world-expected.txt: Added. 14 * storage/open-database-creation-callback-isolated-world.html: Added. 15 1 16 2010-03-03 Alexey Proskuryakov <ap@apple.com> 2 17 -
trunk/WebCore/Android.jscbindings.mk
r53915 r55474 81 81 bindings/js/JSCustomSQLTransactionErrorCallback.cpp \ 82 82 bindings/js/JSCustomVoidCallback.cpp \ 83 bindings/js/JSDatabaseCallback.cpp \ 83 84 bindings/js/JSDesktopNotificationsCustom.cpp \ 84 85 bindings/js/JSDOMApplicationCacheCustom.cpp \ -
trunk/WebCore/Android.v8bindings.mk
r55096 r55474 109 109 bindings/v8/custom/V8DOMWindowCustom.cpp \ 110 110 bindings/v8/custom/V8DataGridColumnListCustom.cpp \ 111 bindings/v8/custom/V8DatabaseCallback.cpp \ 111 112 bindings/v8/custom/V8DatabaseCustom.cpp \ 112 113 bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp \ -
trunk/WebCore/ChangeLog
r55466 r55474 1 2010-03-03 Dumitru Daniliuc <dumi@chromium.org> 2 3 Reviewed by Adam Barth. 4 5 Adding support for the optional creation callback that could be 6 passed to openDatabase(). 7 8 Test: storage/open-database-creation-callback.html 9 10 https://bugs.webkit.org/show_bug.cgi?id=34726 11 12 * Android.jscbindings.mk 13 * Android.v8bindings.mk 14 * GNUmakefile.am: 15 * WebCore.gypi: 16 * WebCore.pro: 17 * WebCore.vcproj/WebCore.vcproj: 18 * WebCore.xcodeproj/project.pbxproj: 19 * bindings/js/JSDOMWindowCustom.cpp: 20 (WebCore::JSDOMWindow::openDatabase): 21 * bindings/js/JSDatabaseCallback.cpp: Added. 22 (WebCore::JSDatabaseCallback::JSDatabaseCallback): 23 (WebCore::JSDatabaseCallback::~JSDatabaseCallback): 24 (WebCore::JSDatabaseCallback::handleEvent): 25 * bindings/js/JSDatabaseCallback.h: Added. 26 (WebCore::JSDatabaseCallback::create): 27 * bindings/v8/custom/V8DOMWindowCustom.cpp: 28 (WebCore::V8DOMWindow::openDatabaseCallback): 29 * bindings/v8/custom/V8DatabaseCallback.cpp: Added. 30 (WebCore::V8DatabaseCallback::V8DatabaseCallback): 31 (WebCore::V8DatabaseCallback::~V8DatabaseCallback): 32 (WebCore::V8DatabaseCallback::handleEvent): 33 * bindings/v8/custom/V8DatabaseCallback.h: Added. 34 (WebCore::V8DatabaseCallback::create): 35 * page/DOMWindow.cpp: 36 (WebCore::DOMWindow::openDatabase): 37 * page/DOMWindow.h: 38 * page/DOMWindow.idl: 39 * storage/Database.cpp: 40 (WebCore::DatabaseCreationCallbackTask::create): 41 (WebCore::DatabaseCreationCallbackTask::performTask): 42 (WebCore::DatabaseCreationCallbackTask::DatabaseCreationCallbackTask): 43 (WebCore::Database::openDatabase): 44 (WebCore::Database::Database): 45 (WebCore::Database::performOpenAndVerify): 46 (WebCore::Database::performCreationCallback): 47 * storage/Database.h: 48 (WebCore::Database::isNew): 49 * storage/DatabaseCallback.h: Added. 50 (WebCore::DatabaseCallback::~DatabaseCallback): 51 * workers/WorkerContext.cpp: 52 (WebCore::WorkerContext::openDatabase): 53 * workers/WorkerContext.h: 54 1 55 2010-03-03 Alexander Pavlov <apavlov@chromium.org> 2 56 -
trunk/WebCore/GNUmakefile.am
r55457 r55474 2229 2229 WebCore/bindings/js/JSCustomSQLTransactionErrorCallback.cpp \ 2230 2230 WebCore/bindings/js/JSCustomSQLTransactionErrorCallback.h \ 2231 WebCore/bindings/js/JSDatabaseCallback.cpp \ 2232 WebCore/bindings/js/JSDatabaseCallback.h \ 2231 2233 WebCore/bindings/js/JSDatabaseCustom.cpp \ 2232 2234 WebCore/bindings/js/JSSQLResultSetRowListCustom.cpp \ … … 2249 2251 WebCore/storage/DatabaseAuthorizer.cpp \ 2250 2252 WebCore/storage/DatabaseAuthorizer.h \ 2253 WebCore/storage/DatabaseCallback.h \ 2251 2254 WebCore/storage/DatabaseDetails.h \ 2252 2255 WebCore/storage/DatabaseTask.cpp \ -
trunk/WebCore/WebCore.gypi
r55424 r55474 704 704 'bindings/v8/custom/V8CustomXPathNSResolver.cpp', 705 705 'bindings/v8/custom/V8CustomXPathNSResolver.h', 706 'bindings/v8/custom/V8DatabaseCallback.cpp', 707 'bindings/v8/custom/V8DatabaseCallback.h', 706 708 'bindings/v8/custom/V8DatabaseCustom.cpp', 707 709 'bindings/v8/custom/V8DataGridColumnListCustom.cpp', … … 3219 3221 'storage/DatabaseAuthorizer.cpp', 3220 3222 'storage/DatabaseAuthorizer.h', 3223 'storage/DatabaseCallback.h', 3221 3224 'storage/DatabaseDetails.h', 3222 3225 'storage/DatabaseTask.cpp', -
trunk/WebCore/WebCore.pro
r55455 r55474 1013 1013 bindings/js/JSCustomVoidCallback.h \ 1014 1014 bindings/js/JSCustomXPathNSResolver.h \ 1015 bindings/js/JSDatabaseCallback.h \ 1015 1016 bindings/js/JSDataGridDataSource.h \ 1016 1017 bindings/js/JSDOMBinding.h \ … … 2221 2222 bindings/js/JSCustomSQLTransactionCallback.cpp \ 2222 2223 bindings/js/JSCustomSQLTransactionErrorCallback.cpp \ 2224 bindings/js/JSDatabaseCallback.cpp \ 2223 2225 bindings/js/JSDatabaseCustom.cpp \ 2224 2226 bindings/js/JSSQLResultSetRowListCustom.cpp \ … … 2231 2233 storage/DatabaseAuthorizer.h \ 2232 2234 storage/Database.h \ 2235 storage/DatabaseCallback.h \ 2233 2236 storage/DatabaseTask.h \ 2234 2237 storage/DatabaseThread.h \ -
trunk/WebCore/WebCore.vcproj/WebCore.vcproj
r55387 r55474 35341 35341 </File> 35342 35342 <File 35343 RelativePath="..\bindings\js\JSDatabaseCallback.cpp" 35344 > 35345 </File> 35346 <File 35347 RelativePath="..\bindings\js\JSDatabaseCallback.h" 35348 > 35349 </File> 35350 <File 35343 35351 RelativePath="..\bindings\js\JSDatabaseCustom.cpp" 35344 35352 > … … 42278 42286 </File> 42279 42287 <File 42288 RelativePath="..\storage\DatabaseCallback.h" 42289 > 42290 </File> 42291 <File 42280 42292 RelativePath="..\storage\DatabaseTask.cpp" 42281 42293 > -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r55455 r55474 4115 4115 B5C1123B102B6C4600096578 /* SQLTransactionCoordinator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B5C11239102B6C4600096578 /* SQLTransactionCoordinator.cpp */; }; 4116 4116 B5C1123C102B6C4600096578 /* SQLTransactionCoordinator.h in Headers */ = {isa = PBXBuildFile; fileRef = B5C1123A102B6C4600096578 /* SQLTransactionCoordinator.h */; }; 4117 B5D3601A112F8B560048DEA8 /* DatabaseCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = B5D36019112F8B560048DEA8 /* DatabaseCallback.h */; }; 4118 B5D3601D112F8BA00048DEA8 /* JSDatabaseCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = B5D3601C112F8BA00048DEA8 /* JSDatabaseCallback.h */; }; 4119 B5D3601F112F8BA80048DEA8 /* JSDatabaseCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B5D3601E112F8BA80048DEA8 /* JSDatabaseCallback.cpp */; }; 4117 4120 B71FE6DF11091CB300DAEF77 /* PrintContext.h in Headers */ = {isa = PBXBuildFile; fileRef = B776D43A1104525D00BEB0EC /* PrintContext.h */; settings = {ATTRIBUTES = (Private, ); }; }; 4118 4121 B776D43D1104527500BEB0EC /* PrintContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B776D43C1104527500BEB0EC /* PrintContext.cpp */; }; … … 9374 9377 B5C11239102B6C4600096578 /* SQLTransactionCoordinator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SQLTransactionCoordinator.cpp; sourceTree = "<group>"; }; 9375 9378 B5C1123A102B6C4600096578 /* SQLTransactionCoordinator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SQLTransactionCoordinator.h; sourceTree = "<group>"; }; 9379 B5D36019112F8B560048DEA8 /* DatabaseCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DatabaseCallback.h; sourceTree = "<group>"; }; 9380 B5D3601C112F8BA00048DEA8 /* JSDatabaseCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDatabaseCallback.h; sourceTree = "<group>"; }; 9381 B5D3601E112F8BA80048DEA8 /* JSDatabaseCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDatabaseCallback.cpp; sourceTree = "<group>"; }; 9376 9382 B776D43A1104525D00BEB0EC /* PrintContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PrintContext.h; sourceTree = "<group>"; }; 9377 9383 B776D43C1104527500BEB0EC /* PrintContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PrintContext.cpp; sourceTree = "<group>"; }; … … 10567 10573 51A45B550CAD7FD7000D2BE9 /* DatabaseAuthorizer.cpp */, 10568 10574 51A45B540CAD7FD7000D2BE9 /* DatabaseAuthorizer.h */, 10575 B5D36019112F8B560048DEA8 /* DatabaseCallback.h */, 10569 10576 5116D9750CF177BD00C2B84D /* DatabaseDetails.h */, 10570 10577 519611E90CAC749C0010A80C /* DatabaseTask.cpp */, … … 14652 14659 1432E8480C51493F00B1500F /* GCController.cpp */, 14653 14660 1432E8460C51493800B1500F /* GCController.h */, 14661 B5D3601E112F8BA80048DEA8 /* JSDatabaseCallback.cpp */, 14662 B5D3601C112F8BA00048DEA8 /* JSDatabaseCallback.h */, 14654 14663 93B70D4709EB0C7C009D8468 /* JSDOMBinding.cpp */, 14655 14664 93B70D4809EB0C7C009D8468 /* JSDOMBinding.h */, … … 18599 18608 E462A4A1113E71BE004A4220 /* IntPointHash.h in Headers */, 18600 18609 CE172E011136E8CE0062A533 /* ZoomMode.h in Headers */, 18610 B5D3601A112F8B560048DEA8 /* DatabaseCallback.h in Headers */, 18611 B5D3601D112F8BA00048DEA8 /* JSDatabaseCallback.h in Headers */, 18601 18612 ); 18602 18613 runOnlyForDeploymentPostprocessing = 0; … … 20788 20799 596229781133EFD700DC4CBB /* GeolocationPositionCache.cpp in Sources */, 20789 20800 0BC2C7771134A8FC000B2F61 /* CanvasSurface.cpp in Sources */, 20801 B5D3601F112F8BA80048DEA8 /* JSDatabaseCallback.cpp in Sources */, 20790 20802 ); 20791 20803 runOnlyForDeploymentPostprocessing = 0; -
trunk/WebCore/bindings/js/JSDOMWindowCustom.cpp
r55401 r55474 24 24 #include "Base64.h" 25 25 #include "Chrome.h" 26 #include "Database.h" 26 27 #include "DOMWindow.h" 27 28 #include "Document.h" … … 37 38 #include "History.h" 38 39 #include "JSAudioConstructor.h" 40 #include "JSDatabase.h" 41 #include "JSDatabaseCallback.h" 39 42 #include "JSDOMWindowShell.h" 40 43 #include "JSEvent.h" … … 1018 1021 } 1019 1022 1023 JSValue JSDOMWindow::openDatabase(ExecState* exec, const ArgList& args) 1024 { 1025 if (!allowsAccessFrom(exec) || (args.size() < 4)) 1026 return jsUndefined(); 1027 ExceptionCode ec = 0; 1028 const UString& name = args.at(0).toString(exec); 1029 const UString& version = args.at(1).toString(exec); 1030 const UString& displayName = args.at(2).toString(exec); 1031 unsigned long estimatedSize = args.at(3).toInt32(exec); 1032 RefPtr<DatabaseCallback> creationCallback; 1033 if ((args.size() >= 5) && args.at(4).isObject()) 1034 creationCallback = JSDatabaseCallback::create(asObject(args.at(4)), globalObject()); 1035 1036 JSValue result = toJS(exec, globalObject(), WTF::getPtr(impl()->openDatabase(name, version, displayName, estimatedSize, creationCallback.release(), ec))); 1037 setDOMException(exec, ec); 1038 return result; 1039 } 1040 1020 1041 DOMWindow* toDOMWindow(JSValue value) 1021 1042 { -
trunk/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
r55424 r55474 56 56 #include "V8BindingState.h" 57 57 #include "V8CustomEventListener.h" 58 #include "V8Database.h" 59 #include "V8DatabaseCallback.h" 58 60 #include "V8GCForContextDispose.h" 59 61 #include "V8HTMLCollection.h" … … 807 809 } 808 810 811 v8::Handle<v8::Value> V8DOMWindow::openDatabaseCallback(const v8::Arguments& args) 812 { 813 INC_STATS("DOM.DOMWindow.openDatabase"); 814 if (args.Length() < 4) 815 return v8::Undefined(); 816 817 DOMWindow* imp = V8DOMWindow::toNative(args.Holder()); 818 if (!V8BindingSecurity::canAccessFrame(V8BindingState::Only(), imp->frame(), true)) 819 return v8::Undefined(); 820 821 ExceptionCode ec = 0; 822 String name = toWebCoreString(args[0]); 823 String version = toWebCoreString(args[1]); 824 String displayName = toWebCoreString(args[2]); 825 unsigned long estimatedSize = args[3]->IntegerValue(); 826 RefPtr<DatabaseCallback> creationCallback; 827 if ((args.Length() >= 5) && args[4]->IsObject()) 828 creationCallback = V8DatabaseCallback::create(args[4], imp->frame()); 829 830 v8::Handle<v8::Value> result = toV8(imp->openDatabase(name, version, displayName, estimatedSize, creationCallback.release(), ec)); 831 V8Proxy::setDOMException(ec); 832 return result; 833 } 834 809 835 bool V8DOMWindow::namedSecurityCheck(v8::Local<v8::Object> host, v8::Local<v8::Value> key, v8::AccessType type, v8::Local<v8::Value> data) 810 836 { -
trunk/WebCore/dom/Document.cpp
r54992 r55474 4731 4731 void Document::postTask(PassOwnPtr<Task> task) 4732 4732 { 4733 if (isMainThread()) { 4734 ScriptExecutionContextTaskTimer* timer = new ScriptExecutionContextTaskTimer(static_cast<Document*>(this), task); 4735 timer->startOneShot(0); 4736 } else { 4737 callOnMainThread(performTask, new PerformTaskContext(m_weakReference, task)); 4738 } 4733 callOnMainThread(performTask, new PerformTaskContext(m_weakReference, task)); 4739 4734 } 4740 4735 -
trunk/WebCore/page/DOMWindow.cpp
r55452 r55474 36 36 #include "Console.h" 37 37 #include "Database.h" 38 #include "DatabaseCallback.h" 38 39 #include "DOMApplicationCache.h" 39 40 #include "DOMSelection.h" … … 1126 1127 1127 1128 #if ENABLE(DATABASE) 1128 PassRefPtr<Database> DOMWindow::openDatabase(const String& name, const String& version, const String& displayName, unsigned long estimatedSize, ExceptionCode& ec)1129 PassRefPtr<Database> DOMWindow::openDatabase(const String& name, const String& version, const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback, ExceptionCode& ec) 1129 1130 { 1130 1131 if (!m_frame) … … 1138 1139 return 0; 1139 1140 1140 return Database::openDatabase(document, name, version, displayName, estimatedSize, ec);1141 return Database::openDatabase(document, name, version, displayName, estimatedSize, creationCallback, ec); 1141 1142 } 1142 1143 #endif -
trunk/WebCore/page/DOMWindow.h
r54835 r55474 46 46 class DOMSelection; 47 47 class Database; 48 class DatabaseCallback; 48 49 class Document; 49 50 class Element; … … 199 200 #if ENABLE(DATABASE) 200 201 // HTML 5 client-side database 201 PassRefPtr<Database> openDatabase(const String& name, const String& version, const String& displayName, unsigned long estimatedSize, ExceptionCode&);202 PassRefPtr<Database> openDatabase(const String& name, const String& version, const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback, ExceptionCode&); 202 203 #endif 203 204 -
trunk/WebCore/page/DOMWindow.idl
r55419 r55474 161 161 #endif 162 162 #if defined(ENABLE_DATABASE) && ENABLE_DATABASE 163 [EnabledAtRuntime ] Database openDatabase(in DOMString name, in DOMString version, in DOMString displayName, in unsigned long estimatedSize)163 [EnabledAtRuntime, Custom] Database openDatabase(in DOMString name, in DOMString version, in DOMString displayName, in unsigned long estimatedSize, in DatabaseCallback creationCallback) 164 164 raises(DOMException); 165 165 #endif -
trunk/WebCore/storage/Database.cpp
r55140 r55474 133 133 static int guidForOriginAndName(const String& origin, const String& name); 134 134 135 PassRefPtr<Database> Database::openDatabase(ScriptExecutionContext* context, const String& name, const String& expectedVersion, const String& displayName, unsigned long estimatedSize, ExceptionCode& e) 135 class DatabaseCreationCallbackTask : public ScriptExecutionContext::Task { 136 public: 137 static PassOwnPtr<DatabaseCreationCallbackTask> create(PassRefPtr<Database> database) 138 { 139 return new DatabaseCreationCallbackTask(database); 140 } 141 142 virtual void performTask(ScriptExecutionContext*) 143 { 144 m_database->performCreationCallback(); 145 } 146 147 private: 148 DatabaseCreationCallbackTask(PassRefPtr<Database> database) 149 : m_database(database) 150 { 151 } 152 153 RefPtr<Database> m_database; 154 }; 155 156 PassRefPtr<Database> Database::openDatabase(ScriptExecutionContext* context, const String& name, 157 const String& expectedVersion, const String& displayName, 158 unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback, 159 ExceptionCode& e) 136 160 { 137 161 if (!DatabaseTracker::tracker().canEstablishDatabase(context, name, displayName, estimatedSize)) { … … 141 165 } 142 166 143 RefPtr<Database> database = adoptRef(new Database(context, name, expectedVersion, displayName, estimatedSize ));167 RefPtr<Database> database = adoptRef(new Database(context, name, expectedVersion, displayName, estimatedSize, creationCallback)); 144 168 145 169 if (!database->openAndVerifyVersion(e)) { … … 161 185 #endif 162 186 187 // If it's a new database and a creation callback was provided, reset the expected 188 // version to "" and schedule the creation callback. Because of some subtle String 189 // implementation issues, we have to reset m_expectedVersion here instead of doing 190 // it inside performOpenAndVerify() which is run on the DB thread. 191 if (database->isNew() && database->m_creationCallback.get()) { 192 database->m_expectedVersion = ""; 193 LOG(StorageAPI, "Scheduling DatabaseCreationCallbackTask for database %p\n", database.get()); 194 database->m_scriptExecutionContext->postTask(DatabaseCreationCallbackTask::create(database)); 195 } 196 163 197 return database; 164 198 } 165 199 166 Database::Database(ScriptExecutionContext* context, const String& name, const String& expectedVersion, const String& displayName, unsigned long estimatedSize )200 Database::Database(ScriptExecutionContext* context, const String& name, const String& expectedVersion, const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback) 167 201 : m_transactionInProgress(false) 168 202 , m_isTransactionQueueEnabled(true) … … 176 210 , m_stopped(false) 177 211 , m_opened(false) 212 , m_new(false) 213 , m_creationCallback(creationCallback) 178 214 { 179 215 ASSERT(m_scriptExecutionContext.get()); … … 521 557 522 558 if (!m_sqliteDatabase.tableExists(databaseInfoTableName())) { 559 m_new = true; 560 523 561 if (!m_sqliteDatabase.executeCommand("CREATE TABLE " + databaseInfoTableName() + " (key TEXT NOT NULL ON CONFLICT FAIL UNIQUE ON CONFLICT REPLACE,value TEXT NOT NULL ON CONFLICT FAIL);")) { 524 562 LOG_ERROR("Unable to create table %s in database %s", databaseInfoTableName().ascii().data(), databaseDebugName().ascii().data()); … … 539 577 if (currentVersion.length()) { 540 578 LOG(StorageAPI, "Retrieved current version %s from database %s", currentVersion.ascii().data(), databaseDebugName().ascii().data()); 541 } else {579 } else if (!m_new || !m_creationCallback) { 542 580 LOG(StorageAPI, "Setting version %s in database %s that was just created", m_expectedVersion.ascii().data(), databaseDebugName().ascii().data()); 543 581 if (!setVersionInDatabase(m_expectedVersion)) { … … 562 600 // If the expected version isn't the empty string, ensure that the current database version we have matches that version. Otherwise, set an exception. 563 601 // If the expected version is the empty string, then we always return with whatever version of the database we have. 564 if ( m_expectedVersion.length() && m_expectedVersion != currentVersion) {602 if ((!m_new || !m_creationCallback) && m_expectedVersion.length() && m_expectedVersion != currentVersion) { 565 603 LOG(StorageAPI, "page expects version %s from database %s, which actually has version name %s - openDatabase() call will fail", m_expectedVersion.ascii().data(), 566 604 databaseDebugName().ascii().data(), currentVersion.ascii().data()); … … 686 724 } 687 725 726 void Database::performCreationCallback() 727 { 728 m_creationCallback->handleEvent(m_scriptExecutionContext.get(), this); 729 } 730 688 731 SQLTransactionClient* Database::transactionClient() const 689 732 { -
trunk/WebCore/storage/Database.h
r53595 r55474 31 31 32 32 #if ENABLE(DATABASE) 33 #include "DatabaseCallback.h" 33 34 #include "PlatformString.h" 34 35 #include "SecurityOrigin.h" … … 52 53 53 54 class DatabaseAuthorizer; 55 class DatabaseCallback; 54 56 class DatabaseThread; 55 57 class ScriptExecutionContext; … … 74 76 75 77 // Direct support for the DOM API 76 static PassRefPtr<Database> openDatabase(ScriptExecutionContext* context, const String& name, const String& expectedVersion, const String& displayName, unsigned long estimatedSize, ExceptionCode&); 78 static PassRefPtr<Database> openDatabase(ScriptExecutionContext* context, const String& name, 79 const String& expectedVersion, const String& displayName, 80 unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback, 81 ExceptionCode&); 77 82 String version() const; 78 83 void changeVersion(const String& oldVersion, const String& newVersion, … … 112 117 bool stopped() const { return m_stopped; } 113 118 119 bool isNew() const { return m_new; } 120 114 121 unsigned long long databaseSize() const; 115 122 unsigned long long maximumSize() const; … … 122 129 123 130 Vector<String> performGetTableNames(); 131 void performCreationCallback(); 124 132 125 133 SQLTransactionClient* transactionClient() const; … … 129 137 Database(ScriptExecutionContext* context, const String& name, 130 138 const String& expectedVersion, const String& displayName, 131 unsigned long estimatedSize );139 unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback); 132 140 133 141 bool openAndVerifyVersion(ExceptionCode&); … … 160 168 bool m_opened; 161 169 170 bool m_new; 171 162 172 SQLiteDatabase m_sqliteDatabase; 163 173 RefPtr<DatabaseAuthorizer> m_databaseAuthorizer; 174 175 RefPtr<DatabaseCallback> m_creationCallback; 164 176 165 177 #ifndef NDEBUG -
trunk/WebCore/workers/WorkerContext.cpp
r53595 r55474 257 257 258 258 #if ENABLE(DATABASE) 259 PassRefPtr<Database> WorkerContext::openDatabase(const String& name, const String& version, const String& displayName, unsigned long estimatedSize, ExceptionCode& ec)259 PassRefPtr<Database> WorkerContext::openDatabase(const String& name, const String& version, const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback, ExceptionCode& ec) 260 260 { 261 261 if (!securityOrigin()->canAccessDatabase()) { … … 268 268 return 0; 269 269 270 return Database::openDatabase(this, name, version, displayName, estimatedSize, ec);270 return Database::openDatabase(this, name, version, displayName, estimatedSize, creationCallback, ec); 271 271 } 272 272 #endif -
trunk/WebCore/workers/WorkerContext.h
r53595 r55474 32 32 #include "AtomicStringHash.h" 33 33 #include "Database.h" 34 #include "DatabaseCallback.h" 34 35 #include "EventListener.h" 35 36 #include "EventNames.h" … … 107 108 #if ENABLE(DATABASE) 108 109 // HTML 5 client-side database 109 PassRefPtr<Database> openDatabase(const String& name, const String& version, const String& displayName, unsigned long estimatedSize, ExceptionCode&);110 PassRefPtr<Database> openDatabase(const String& name, const String& version, const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback, ExceptionCode&); 110 111 // Not implemented yet. 111 112 virtual bool isDatabaseReadOnly() const { return false; }
Note: See TracChangeset
for help on using the changeset viewer.