1. 21 Nov, 2013 1 commit
    • commit-queue@webkit.org's avatar
      Remove ENABLE_WORKERS · f0eff209
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=105784
      
      .:
      
      Patch by Peter Molnar <pmolnar.u-szeged@partner.samsung.com> on 2013-11-21
      Reviewed by Darin Adler.
      
      * Source/autotools/SetupWebKitFeatures.m4:
      * Source/cmake/WebKitFeatures.cmake:
      * Source/cmakeconfig.h.cmake:
      
      Source/WebCore:
      
      Patch by Peter Molnar <pmolnar.u-szeged@partner.samsung.com> on 2013-11-21
      Reviewed by Darin Adler.
      
      Source/WebKit:
      
      Patch by Peter Molnar <pmolnar.u-szeged@partner.samsung.com> on 2013-11-21
      Reviewed by Darin Adler.
      
      * WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in:
      
      Source/WebKit/efl:
      
      Patch by Peter Molnar <pmolnar.u-szeged@partner.samsung.com> on 2013-11-21
      Reviewed by Darin Adler.
      
      * ewk/ewk_settings.cpp:
      (ewk_settings_memory_cache_clear):
      
      Source/WebKit/win:
      
      Patch by Peter Molnar <pmolnar.u-szeged@partner.samsung.com> on 2013-11-21
      Reviewed by Darin Adler.
      
      * WebWorkersPrivate.cpp:
      (WebWorkersPrivate::workerThreadCount):
      
      Source/WTF:
      
      Patch by Peter Molnar <pmolnar.u-szeged@partner.samsung.com> on 2013-11-21
      Reviewed by Darin Adler.
      
      * wtf/FeatureDefines.h:
      * wtf/nix/FeatureDefinesNix.h:
      
      Tools:
      
      Patch by Peter Molnar <pmolnar.u-szeged@partner.samsung.com> on 2013-11-21
      Reviewed by Darin Adler.
      
      * Scripts/webkitperl/FeatureList.pm:
      
      WebKitLibraries:
      
      Patch by Peter Molnar <pmolnar.u-szeged@partner.samsung.com> on 2013-11-21
      Reviewed by Darin Adler.
      
      * win/tools/vsprops/FeatureDefines.props:
      * win/tools/vsprops/FeatureDefinesCairo.props:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159679 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f0eff209
  2. 28 Oct, 2013 1 commit
    • beidson@apple.com's avatar
      Refactor IDB factory creation. · 3c2faae5
      beidson@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=123347
      
      Reviewed by Andreas Kling.
      
      - Rework how database directory location is passed around.
      - Make (some) SecurityOrigin arguments be references instead of pointers.
      - Add two SecurityOrigin arguments to opening databases for future use.
      
      Source/WebCore:
      
      * Modules/indexeddb/IDBFactory.cpp:
      (WebCore::IDBFactory::openInternal):
      
      * Modules/indexeddb/IDBFactoryBackendInterface.cpp:
      (WebCore::IDBFactoryBackendInterface::create):
      * Modules/indexeddb/IDBFactoryBackendInterface.h:
      
      * Modules/indexeddb/PageGroupIndexedDatabase.cpp:
      (WebCore::PageGroupIndexedDatabase::PageGroupIndexedDatabase):
      (WebCore::PageGroupIndexedDatabase::from):
      (WebCore::PageGroupIndexedDatabase::factoryBackend):
      * Modules/indexeddb/PageGroupIndexedDatabase.h:
      
      * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp:
      (WebCore::WorkerGlobalScopeIndexedDatabase::WorkerGlobalScopeIndexedDatabase):
      (WebCore::WorkerGlobalScopeIndexedDatabase::from):
      (WebCore::WorkerGlobalScopeIndexedDatabase::indexedDB):
      * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.h:
      
      * Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.cpp:
      (WebCore::IDBBackingStoreLevelDB::open):
      (WebCore::IDBBackingStoreLevelDB::openInMemory):
      * Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.h:
      
      * Modules/indexeddb/leveldb/IDBFactoryBackendLevelDB.cpp:
      (WebCore::computeFileIdentifier):
      (WebCore::computeUniqueIdentifier):
      (WebCore::IDBFactoryBackendLevelDB::IDBFactoryBackendLevelDB):
      (WebCore::IDBFactoryBackendLevelDB::getDatabaseNames):
      (WebCore::IDBFactoryBackendLevelDB::deleteDatabase):
      (WebCore::IDBFactoryBackendLevelDB::openBackingStore):
      (WebCore::IDBFactoryBackendLevelDB::open):
      * Modules/indexeddb/leveldb/IDBFactoryBackendLevelDB.h:
      (WebCore::IDBFactoryBackendLevelDB::create):
      
      * WebCore.exp.in:
      
      * platform/DatabaseStrategy.cpp:
      (WebCore::DatabaseStrategy::createIDBFactoryBackend):
      * platform/DatabaseStrategy.h:
      
      Source/WebKit2:
      
      * Shared/Databases/IndexedDB/IDBUtilities.cpp:
      (WebKit::uniqueDatabaseIdentifier):
      * Shared/Databases/IndexedDB/IDBUtilities.h:
      
      * WebProcess/Databases/IndexedDB/WebIDBFactoryBackend.cpp:
      (WebKit::WebIDBFactoryBackend::WebIDBFactoryBackend):
      (WebKit::WebIDBFactoryBackend::open):
      * WebProcess/Databases/IndexedDB/WebIDBFactoryBackend.h:
      (WebKit::WebIDBFactoryBackend::create):
      
      * WebProcess/Databases/IndexedDB/WebProcessIDBDatabaseBackend.cpp:
      (WebKit::WebProcessIDBDatabaseBackend::WebProcessIDBDatabaseBackend):
      * WebProcess/Databases/IndexedDB/WebProcessIDBDatabaseBackend.h:
      
      * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
      (WebKit::WebPlatformStrategies::createIDBFactoryBackend):
      * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158170 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3c2faae5
  3. 30 Sep, 2013 1 commit
    • beidson@apple.com's avatar
      Remove IDBTracing.h. · 1367e453
      beidson@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=122118
      
      Reviewed by Alexey Proskuryakov.
      
      Global replace of "IDB_TRACE" with "LOG(StorageAPI)", and remove all notions of this header.
      
      * GNUmakefile.list.am:
      
      * Modules/indexeddb/IDBCursor.cpp:
      * Modules/indexeddb/IDBDatabase.cpp:
      * Modules/indexeddb/IDBDatabaseBackendInterface.h:
      * Modules/indexeddb/IDBFactory.cpp:
      * Modules/indexeddb/IDBIndex.cpp:
      * Modules/indexeddb/IDBObjectStore.cpp:
      * Modules/indexeddb/IDBOpenDBRequest.cpp:
      * Modules/indexeddb/IDBRequest.cpp:
      * Modules/indexeddb/IDBTracing.h: Removed.
      * Modules/indexeddb/IDBTransaction.cpp:
      * Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.cpp:
      * Modules/indexeddb/leveldb/IDBCursorBackendLevelDB.cpp:
      * Modules/indexeddb/leveldb/IDBDatabaseBackendLevelDB.cpp:
      * Modules/indexeddb/leveldb/IDBFactoryBackendLevelDB.cpp:
      * Modules/indexeddb/leveldb/IDBObjectStoreBackendLevelDB.cpp:
      * Modules/indexeddb/leveldb/IDBTransactionBackendLevelDB.cpp:
      * WebCore.xcodeproj/project.pbxproj:
      * bindings/js/IDBBindingUtilities.cpp:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156676 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1367e453
  4. 27 Sep, 2013 1 commit
    • beidson@apple.com's avatar
      IndexedDB IDL Refactoring. · 77a081cf
      beidson@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=121996
      
      Reviewed by Alexey Proskuryakov.
      
      This includes:
      1 - Leveraging EventTarget.idl inheritance
      2 - Removing comments
      3 - Reordering to match the spec's IDLs
      4 - Removing nonstandard, WebKit-specific methods
      5 - Updating interfaces to match the spec (versions are only uint64_t's now...)
      6 - Updating implementation code as needed (versions are only uint64_t's now...)
      
      IDL changes:
      * Modules/indexeddb/IDBCursor.idl:
      * Modules/indexeddb/IDBDatabase.idl:
      * Modules/indexeddb/IDBFactory.idl:
      * Modules/indexeddb/IDBIndex.idl:
      * Modules/indexeddb/IDBKeyRange.idl:
      * Modules/indexeddb/IDBObjectStore.idl:
      * Modules/indexeddb/IDBRequest.idl:
      * Modules/indexeddb/IDBTransaction.idl:
      * Modules/indexeddb/IDBVersionChangeEvent.idl:
      
      * Modules/indexeddb/IndexedDB.h: Add new enum to represent version nullness.
      
      Adapt to new IDLs, and also refactor representation of initial, null versioning:
      * Modules/indexeddb/IDBCallbacks.h:
      (WebCore::IDBCallbacks::onBlocked):
      (WebCore::IDBCallbacks::onUpgradeNeeded):
      
      * Modules/indexeddb/IDBDatabase.cpp:
      (WebCore::IDBDatabase::version):
      (WebCore::IDBDatabase::onVersionChange):
      * Modules/indexeddb/IDBDatabase.h:
      
      * Modules/indexeddb/IDBDatabaseCallbacks.h:
      * Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp:
      (WebCore::IDBDatabaseCallbacksImpl::onVersionChange):
      * Modules/indexeddb/IDBDatabaseCallbacksImpl.h:
      
      * Modules/indexeddb/IDBFactory.cpp:
      (WebCore::IDBFactory::open):
      (WebCore::IDBFactory::openInternal):
      (WebCore::IDBFactory::deleteDatabase):
      * Modules/indexeddb/IDBFactory.h:
      
      * Modules/indexeddb/IDBMetadata.h:
      (WebCore::IDBDatabaseMetadata::IDBDatabaseMetadata):
      
      * Modules/indexeddb/IDBOpenDBRequest.cpp:
      (WebCore::IDBOpenDBRequest::create):
      (WebCore::IDBOpenDBRequest::IDBOpenDBRequest):
      (WebCore::IDBOpenDBRequest::onBlocked):
      (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
      * Modules/indexeddb/IDBOpenDBRequest.h:
      
      * Modules/indexeddb/IDBRequest.cpp:
      * Modules/indexeddb/IDBRequest.h:
      
      * Modules/indexeddb/IDBTransaction.cpp:
      * Modules/indexeddb/IDBTransaction.h:
      
      * Modules/indexeddb/IDBVersionChangeEvent.cpp:
      (WebCore::IDBVersionChangeEvent::IDBVersionChangeEvent):
      * Modules/indexeddb/IDBVersionChangeEvent.h:
      (WebCore::IDBVersionChangeEvent::create):
      (WebCore::IDBVersionChangeEvent::oldVersion):
      (WebCore::IDBVersionChangeEvent::newVersion):
      
      Keep leveldb building with minimal adaptations to the new IDLs,
      but note that the LevelDB implementation is now incompatible with the spec:
      * Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.cpp:
      (WebCore::IDBBackingStore::getIDBDatabaseMetaData):
      (WebCore::objectStoreCursorOptions):
      (WebCore::indexCursorOptions):
      
      * Modules/indexeddb/leveldb/IDBDatabaseBackendLevelDB.cpp:
      (WebCore::IDBDatabaseBackendLevelDB::IDBDatabaseBackendLevelDB):
      (WebCore::IDBDatabaseBackendLevelDB::openInternal):
      (WebCore::IDBDatabaseBackendLevelDB::VersionChangeOperation::perform):
      (WebCore::IDBDatabaseBackendLevelDB::processPendingCalls):
      (WebCore::IDBDatabaseBackendLevelDB::openConnection):
      (WebCore::IDBDatabaseBackendLevelDB::runIntVersionChangeTransaction):
      (WebCore::IDBDatabaseBackendLevelDB::deleteDatabase):
      (WebCore::IDBDatabaseBackendLevelDB::deleteDatabaseFinal):
      (WebCore::IDBDatabaseBackendLevelDB::VersionChangeAbortOperation::perform):
      
      * Modules/indexeddb/leveldb/IDBLevelDBCoding.cpp:
      (WebCore::IDBLevelDBCoding::compareEncodedIDBKeys):
      
      * inspector/InspectorIndexedDBAgent.cpp: Update for metadata change.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156590 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      77a081cf
  5. 26 Aug, 2013 1 commit
    • psolanki@apple.com's avatar
      PageGroup::groupSettings() should return a reference · 95fe3e51
      psolanki@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=120319
      
      Reviewed by Andreas Kling.
      
      PageGroup::m_groupSettings is never NULL so we can just return a reference from groupSettings().
      
      Source/WebCore:
      
      * Modules/indexeddb/IDBFactory.cpp:
      * page/PageGroup.h:
      (WebCore::PageGroup::groupSettings):
      * storage/StorageNamespaceImpl.cpp:
      (WebCore::StorageNamespaceImpl::localStorageNamespace):
      * workers/DefaultSharedWorkerRepository.cpp:
      (WebCore::SharedWorkerProxy::groupSettings):
      * workers/WorkerMessagingProxy.cpp:
      (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
      
      Source/WebKit/blackberry:
      
      * Api/WebPage.cpp:
      (BlackBerry::WebKit::WebPagePrivate::didChangeSettings):
      
      Source/WebKit/gtk:
      
      * webkit/webkitwebdatabase.cpp:
      (webkit_set_web_database_directory_path):
      
      Source/WebKit2:
      
      * WebProcess/Storage/StorageNamespaceImpl.cpp:
      (WebKit::StorageNamespaceImpl::createLocalStorageNamespace):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154618 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      95fe3e51
  6. 27 Jun, 2013 1 commit
    • ch.dumez@sisa.samsung.com's avatar
      Rename WorkerContext to WorkerGlobalScope · 14792a6b
      ch.dumez@sisa.samsung.com authored
      https://bugs.webkit.org/show_bug.cgi?id=118059
      
      Reviewed by Kentaro Hara.
      
      Source/WebCore:
      
      Rename WorkerContext / SharedWorkerContext / DedicatedWorkerContext to
      WorkerGlobalScope / SharedWorkerGlobalScope / DedicatedWorkerGlobalScope
      to match the latest specification:
      http://www.whatwg.org/specs/web-apps/current-work/multipage/workers.html#workerglobalscope
      
      Those interfaces have [NoInterfaceObject] IDL extended attribute so the
      name did not matter much so far. However, the specification was updated
      and [NoInterfaceObject] was removed. We should therefore rename those
      interfaces as a preparation for this change.
      
      No new tests, no behavior change as these interfaces are not exposed to
      JavaScript yet.
      
      * CMakeLists.txt:
      * DerivedSources.cpp:
      * DerivedSources.make:
      * DerivedSources.pri:
      * GNUmakefile.am:
      * GNUmakefile.list.am:
      * Modules/filesystem/WorkerGlobalScopeFileSystem.cpp: Renamed from Source/WebCore/Modules/filesystem/WorkerContextFileSystem.cpp.
      (WebCore::WorkerGlobalScopeFileSystem::webkitRequestFileSystem):
      (WebCore::WorkerGlobalScopeFileSystem::webkitRequestFileSystemSync):
      (WebCore::WorkerGlobalScopeFileSystem::webkitResolveLocalFileSystemURL):
      (WebCore::WorkerGlobalScopeFileSystem::webkitResolveLocalFileSystemSyncURL):
      * Modules/filesystem/WorkerGlobalScopeFileSystem.h: Renamed from Source/WebCore/Modules/filesystem/WorkerContextFileSystem.h.
      * Modules/filesystem/WorkerGlobalScopeFileSystem.idl: Renamed from Source/WebCore/Modules/filesystem/WorkerContextFileSystem.idl.
      * Modules/indexeddb/IDBFactory.cpp:
      * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp: Renamed from Source/WebCore/Modules/indexeddb/WorkerContextIndexedDatabase.cpp.
      (WebCore::WorkerGlobalScopeIndexedDatabase::WorkerGlobalScopeIndexedDatabase):
      (WebCore::WorkerGlobalScopeIndexedDatabase::~WorkerGlobalScopeIndexedDatabase):
      (WebCore::WorkerGlobalScopeIndexedDatabase::supplementName):
      (WebCore::WorkerGlobalScopeIndexedDatabase::from):
      (WebCore::WorkerGlobalScopeIndexedDatabase::indexedDB):
      * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.h: Renamed from Source/WebCore/Modules/indexeddb/WorkerContextIndexedDatabase.h.
      * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl: Renamed from Source/WebCore/Modules/indexeddb/WorkerContextIndexedDatabase.idl.
      * Modules/notifications/Notification.cpp:
      * Modules/notifications/NotificationCenter.cpp:
      * Modules/notifications/WorkerGlobalScopeNotifications.cpp: Renamed from Source/WebCore/Modules/notifications/WorkerContextNotifications.cpp.
      (WebCore::WorkerGlobalScopeNotifications::WorkerGlobalScopeNotifications):
      (WebCore::WorkerGlobalScopeNotifications::~WorkerGlobalScopeNotifications):
      (WebCore::WorkerGlobalScopeNotifications::supplementName):
      (WebCore::WorkerGlobalScopeNotifications::from):
      (WebCore::WorkerGlobalScopeNotifications::webkitNotifications):
      * Modules/notifications/WorkerGlobalScopeNotifications.h: Renamed from Source/WebCore/Modules/notifications/WorkerContextNotifications.h.
      * Modules/notifications/WorkerGlobalScopeNotifications.idl: Renamed from Source/WebCore/Modules/notifications/WorkerContextNotifications.idl.
      * Modules/webdatabase/DatabaseContext.cpp:
      (WebCore::DatabaseContext::allowDatabaseAccess):
      (WebCore::DatabaseContext::databaseExceededQuota):
      * Modules/webdatabase/WorkerGlobalScopeWebDatabase.cpp: Renamed from Source/WebCore/Modules/webdatabase/WorkerContextWebDatabase.cpp.
      (WebCore::WorkerGlobalScopeWebDatabase::openDatabase):
      (WebCore::WorkerGlobalScopeWebDatabase::openDatabaseSync):
      * Modules/webdatabase/WorkerGlobalScopeWebDatabase.h: Renamed from Source/WebCore/Modules/webdatabase/WorkerContextWebDatabase.h.
      (WebCore::WorkerGlobalScopeWebDatabase::WorkerGlobalScopeWebDatabase):
      (WebCore::WorkerGlobalScopeWebDatabase::~WorkerGlobalScopeWebDatabase):
      * Modules/webdatabase/WorkerGlobalScopeWebDatabase.idl: Renamed from Source/WebCore/Modules/webdatabase/WorkerContextWebDatabase.idl.
      * Modules/websockets/ThreadableWebSocketChannel.cpp:
      (WebCore::ThreadableWebSocketChannel::create):
      * Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp:
      (WebCore::ThreadableWebSocketChannelClientWrapper::processPendingTasksCallback):
      * Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
      (WebCore::WorkerThreadableWebSocketChannel::WorkerThreadableWebSocketChannel):
      (WebCore::workerGlobalScopeDidSend):
      (WebCore::WorkerThreadableWebSocketChannel::Peer::send):
      (WebCore::workerGlobalScopeDidGetBufferedAmount):
      (WebCore::WorkerThreadableWebSocketChannel::Peer::bufferedAmount):
      (WebCore::workerGlobalScopeDidConnect):
      (WebCore::WorkerThreadableWebSocketChannel::Peer::didConnect):
      (WebCore::workerGlobalScopeDidReceiveMessage):
      (WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveMessage):
      (WebCore::workerGlobalScopeDidReceiveBinaryData):
      (WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveBinaryData):
      (WebCore::workerGlobalScopeDidUpdateBufferedAmount):
      (WebCore::WorkerThreadableWebSocketChannel::Peer::didUpdateBufferedAmount):
      (WebCore::workerGlobalScopeDidStartClosingHandshake):
      (WebCore::WorkerThreadableWebSocketChannel::Peer::didStartClosingHandshake):
      (WebCore::workerGlobalScopeDidClose):
      (WebCore::WorkerThreadableWebSocketChannel::Peer::didClose):
      (WebCore::workerGlobalScopeDidReceiveMessageError):
      (WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveMessageError):
      (WebCore::WorkerThreadableWebSocketChannel::Bridge::Bridge):
      (WebCore::WorkerThreadableWebSocketChannel::WorkerGlobalScopeDidInitializeTask::create):
      (WebCore::WorkerThreadableWebSocketChannel::WorkerGlobalScopeDidInitializeTask::~WorkerGlobalScopeDidInitializeTask):
      (WebCore::WorkerThreadableWebSocketChannel::WorkerGlobalScopeDidInitializeTask::WorkerGlobalScopeDidInitializeTask):
      (WebCore::WorkerThreadableWebSocketChannel::Bridge::mainThreadInitialize):
      (WebCore::WorkerThreadableWebSocketChannel::Bridge::disconnect):
      (WebCore::WorkerThreadableWebSocketChannel::Bridge::waitForMethodCompletion):
      * Modules/websockets/WorkerThreadableWebSocketChannel.h:
      (WebCore::WorkerThreadableWebSocketChannel::create):
      (WebCore::WorkerThreadableWebSocketChannel::Bridge::create):
      * Target.pri:
      * UseJSC.cmake:
      * WebCore.order:
      * WebCore.vcxproj/WebCore.vcxproj:
      * WebCore.vcxproj/WebCore.vcxproj.filters:
      * WebCore.xcodeproj/project.pbxproj:
      * bindings/cpp/WebDOMEventTarget.cpp:
      (toWebKit):
      * bindings/cpp/WebDOMEventTarget.h:
      * bindings/generic/ActiveDOMCallback.cpp:
      * bindings/js/DOMRequestState.h:
      (WebCore::DOMRequestState::DOMRequestState):
      * bindings/js/JSBindingsAllInOne.cpp:
      * bindings/js/JSDOMBinding.h:
      * bindings/js/JSDOMGlobalObject.cpp:
      (WebCore::JSDOMGlobalObject::scriptExecutionContext):
      (WebCore::toJSDOMGlobalObject):
      * bindings/js/JSDedicatedWorkerGlobalScopeCustom.cpp: Renamed from Source/WebCore/bindings/js/JSDedicatedWorkerContextCustom.cpp.
      (WebCore::JSDedicatedWorkerGlobalScope::postMessage):
      * bindings/js/JSEventListener.cpp:
      (WebCore::JSEventListener::handleEvent):
      * bindings/js/JSEventTargetCustom.cpp:
      (WebCore::toJS):
      * bindings/js/JSWorkerGlobalScopeBase.cpp: Renamed from Source/WebCore/bindings/js/JSWorkerContextBase.cpp.
      (WebCore::JSWorkerGlobalScopeBase::JSWorkerGlobalScopeBase):
      (WebCore::JSWorkerGlobalScopeBase::finishCreation):
      (WebCore::JSWorkerGlobalScopeBase::destroy):
      (WebCore::JSWorkerGlobalScopeBase::scriptExecutionContext):
      (WebCore::toJS):
      (WebCore::toJSDedicatedWorkerGlobalScope):
      (WebCore::toJSSharedWorkerGlobalScope):
      (WebCore::toJSWorkerGlobalScope):
      * bindings/js/JSWorkerGlobalScopeBase.h: Renamed from Source/WebCore/bindings/js/JSWorkerContextBase.h.
      (WebCore::JSWorkerGlobalScopeBase::impl):
      (WebCore::JSWorkerGlobalScopeBase::createStructure):
      * bindings/js/JSWorkerGlobalScopeCustom.cpp: Renamed from Source/WebCore/bindings/js/JSWorkerContextCustom.cpp.
      (WebCore::JSWorkerGlobalScope::visitChildren):
      (WebCore::JSWorkerGlobalScope::getOwnPropertySlotDelegate):
      (WebCore::JSWorkerGlobalScope::getOwnPropertyDescriptorDelegate):
      (WebCore::JSWorkerGlobalScope::importScripts):
      (WebCore::JSWorkerGlobalScope::setTimeout):
      (WebCore::JSWorkerGlobalScope::setInterval):
      * bindings/js/ScheduledAction.cpp:
      (WebCore::ScheduledAction::execute):
      * bindings/js/ScheduledAction.h:
      * bindings/js/ScriptProfiler.cpp:
      (WebCore::ScriptProfiler::startForWorkerGlobalScope):
      (WebCore::ScriptProfiler::stopForWorkerGlobalScope):
      * bindings/js/ScriptProfiler.h:
      * bindings/js/ScriptState.cpp:
      (WebCore::scriptStateFromWorkerGlobalScope):
      * bindings/js/ScriptState.h:
      * bindings/js/WorkerScriptController.cpp:
      (WebCore::WorkerScriptController::WorkerScriptController):
      (WebCore::WorkerScriptController::~WorkerScriptController):
      (WebCore::WorkerScriptController::initScript):
      (WebCore::WorkerScriptController::evaluate):
      (WebCore::WorkerScriptController::setException):
      (WebCore::WorkerScriptController::forbidExecution):
      (WebCore::WorkerScriptController::isExecutionForbidden):
      (WebCore::WorkerScriptController::disableEval):
      (WebCore::WorkerScriptController::attachDebugger):
      (WebCore::WorkerScriptController::detachDebugger):
      * bindings/js/WorkerScriptController.h:
      (WebCore::WorkerScriptController::workerGlobalScopeWrapper):
      (WebCore::WorkerScriptController::initScriptIfNeeded):
      * bindings/js/WorkerScriptDebugServer.cpp:
      (WebCore::WorkerScriptDebugServer::WorkerScriptDebugServer):
      (WebCore::WorkerScriptDebugServer::addListener):
      (WebCore::WorkerScriptDebugServer::recompileAllJSFunctions):
      (WebCore::WorkerScriptDebugServer::removeListener):
      (WebCore::WorkerScriptDebugServer::runEventLoopWhilePaused):
      * bindings/js/WorkerScriptDebugServer.h:
      * bindings/scripts/CodeGeneratorJS.pm:
      (GenerateHeader):
      (GenerateImplementation):
      * bindings/scripts/IDLAttributes.txt:
      * bindings/scripts/preprocess-idls.pl:
      * dom/ActiveDOMObject.cpp:
      * dom/EventTarget.h:
      * dom/EventTargetFactory.in:
      * dom/MessagePort.cpp:
      (WebCore::MessagePort::dispatchMessages):
      * dom/ScriptExecutionContext.cpp:
      (WebCore::ScriptExecutionContext::createdMessagePort):
      (WebCore::ScriptExecutionContext::destroyedMessagePort):
      (WebCore::ScriptExecutionContext::vm):
      * dom/ScriptExecutionContext.h:
      (WebCore::ScriptExecutionContext::isWorkerGlobalScope):
      * inspector/InjectedScriptManager.cpp:
      (WebCore::InjectedScriptManager::createForWorker):
      (WebCore::InjectedScriptManager::canAccessInspectedWorkerGlobalScope):
      * inspector/InjectedScriptManager.h:
      * inspector/InspectorConsoleInstrumentation.h:
      (WebCore::InspectorInstrumentation::addMessageToConsole):
      * inspector/InspectorInstrumentation.cpp:
      (WebCore::InspectorInstrumentation::didStartWorkerGlobalScopeImpl):
      (WebCore::InspectorInstrumentation::willEvaluateWorkerScript):
      (WebCore::InspectorInstrumentation::workerGlobalScopeTerminatedImpl):
      (WebCore::InspectorInstrumentation::instrumentingAgentsForWorkerGlobalScope):
      (WebCore::InspectorInstrumentation::instrumentingAgentsForNonDocumentContext):
      * inspector/InspectorInstrumentation.h:
      (WebCore::InspectorInstrumentation::didStartWorkerGlobalScope):
      (WebCore::InspectorInstrumentation::workerGlobalScopeTerminated):
      * inspector/InspectorProfilerAgent.cpp:
      (WebCore::WorkerProfilerAgent::WorkerProfilerAgent):
      (WebCore::WorkerProfilerAgent::startProfiling):
      (WebCore::WorkerProfilerAgent::stopProfiling):
      (WebCore::InspectorProfilerAgent::create):
      * inspector/InspectorProfilerAgent.h:
      * inspector/InspectorRuntimeAgent.h:
      * inspector/InspectorWorkerAgent.cpp:
      (WebCore::InspectorWorkerAgent::WorkerFrontendChannel::WorkerFrontendChannel):
      (WebCore::InspectorWorkerAgent::WorkerFrontendChannel::~WorkerFrontendChannel):
      (WebCore::InspectorWorkerAgent::WorkerFrontendChannel::proxy):
      (WebCore::InspectorWorkerAgent::WorkerFrontendChannel::connectToWorkerGlobalScope):
      (WebCore::InspectorWorkerAgent::WorkerFrontendChannel::disconnectFromWorkerGlobalScope):
      (WebCore::InspectorWorkerAgent::connectToWorker):
      (WebCore::InspectorWorkerAgent::disconnectFromWorker):
      (WebCore::InspectorWorkerAgent::didStartWorkerGlobalScope):
      (WebCore::InspectorWorkerAgent::workerGlobalScopeTerminated):
      (WebCore::InspectorWorkerAgent::destroyWorkerFrontendChannels):
      (WebCore::InspectorWorkerAgent::createWorkerFrontendChannel):
      * inspector/InspectorWorkerAgent.h:
      * inspector/InstrumentingAgents.cpp:
      (WebCore::instrumentationForWorkerGlobalScope):
      * inspector/InstrumentingAgents.h:
      * inspector/WorkerDebuggerAgent.cpp:
      (WebCore::WorkerDebuggerAgent::create):
      (WebCore::WorkerDebuggerAgent::WorkerDebuggerAgent):
      (WebCore::WorkerDebuggerAgent::~WorkerDebuggerAgent):
      (WebCore::WorkerDebuggerAgent::interruptAndDispatchInspectorCommands):
      (WebCore::WorkerDebuggerAgent::injectedScriptForEval):
      * inspector/WorkerDebuggerAgent.h:
      * inspector/WorkerInspectorController.cpp:
      (WebCore::WorkerInspectorController::WorkerInspectorController):
      (WebCore::WorkerInspectorController::connectFrontend):
      * inspector/WorkerInspectorController.h:
      * inspector/WorkerRuntimeAgent.cpp:
      (WebCore::WorkerRuntimeAgent::WorkerRuntimeAgent):
      (WebCore::WorkerRuntimeAgent::injectedScriptForEval):
      (WebCore::WorkerRuntimeAgent::pauseWorkerGlobalScope):
      * inspector/WorkerRuntimeAgent.h:
      (WebCore::WorkerRuntimeAgent::create):
      * loader/ThreadableLoader.cpp:
      (WebCore::ThreadableLoader::create):
      (WebCore::ThreadableLoader::loadResourceSynchronously):
      * loader/WorkerThreadableLoader.cpp:
      (WebCore::WorkerThreadableLoader::WorkerThreadableLoader):
      (WebCore::WorkerThreadableLoader::loadResourceSynchronously):
      (WebCore::workerGlobalScopeDidSendData):
      (WebCore::WorkerThreadableLoader::MainThreadBridge::didSendData):
      (WebCore::workerGlobalScopeDidReceiveResponse):
      (WebCore::WorkerThreadableLoader::MainThreadBridge::didReceiveResponse):
      (WebCore::workerGlobalScopeDidReceiveData):
      (WebCore::WorkerThreadableLoader::MainThreadBridge::didReceiveData):
      (WebCore::workerGlobalScopeDidFinishLoading):
      (WebCore::WorkerThreadableLoader::MainThreadBridge::didFinishLoading):
      (WebCore::workerGlobalScopeDidFail):
      (WebCore::WorkerThreadableLoader::MainThreadBridge::didFail):
      (WebCore::workerGlobalScopeDidFailAccessControlCheck):
      (WebCore::WorkerThreadableLoader::MainThreadBridge::didFailAccessControlCheck):
      (WebCore::workerGlobalScopeDidFailRedirectCheck):
      (WebCore::WorkerThreadableLoader::MainThreadBridge::didFailRedirectCheck):
      * loader/WorkerThreadableLoader.h:
      (WebCore::WorkerThreadableLoader::create):
      * loader/cache/MemoryCache.cpp:
      (WebCore::MemoryCache::removeRequestFromCache):
      * platform/blackberry/LocalFileSystemBlackBerry.cpp:
      (WebCore::openFileSystem):
      (WebCore::LocalFileSystem::deleteFileSystem):
      * platform/blackberry/WorkerAsyncFileSystemBlackBerry.cpp:
      (WebCore::WorkerAsyncFileSystemBlackBerry::WorkerAsyncFileSystemBlackBerry):
      (WebCore::WorkerAsyncFileSystemBlackBerry::openFileSystem):
      (WebCore::WorkerAsyncFileSystemBlackBerry::deleteFileSystem):
      * platform/blackberry/WorkerAsyncFileSystemBlackBerry.h:
      (WebCore::WorkerAsyncFileSystemBlackBerry::create):
      * platform/blackberry/WorkerAsyncFileWriterBlackBerry.h:
      * platform/blackberry/WorkerPlatformAsyncFileSystemCallbacks.cpp:
      (WebCore::WorkerPlatformAsyncFileSystemCallbacks::postTaskToWorkerThread):
      * platform/blackberry/WorkerPlatformAsyncFileSystemCallbacks.h:
      * platform/blackberry/WorkerPlatformFileWriterClient.cpp:
      (WebCore::WorkerPlatformFileWriterClient::postTaskToWorkerThreadIfNeeded):
      * platform/blackberry/WorkerPlatformFileWriterClient.h:
      * workers/DedicatedWorkerGlobalScope.cpp: Renamed from Source/WebCore/workers/DedicatedWorkerContext.cpp.
      (WebCore::DedicatedWorkerGlobalScope::create):
      (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
      (WebCore::DedicatedWorkerGlobalScope::~DedicatedWorkerGlobalScope):
      (WebCore::DedicatedWorkerGlobalScope::interfaceName):
      (WebCore::DedicatedWorkerGlobalScope::postMessage):
      (WebCore::DedicatedWorkerGlobalScope::importScripts):
      (WebCore::DedicatedWorkerGlobalScope::thread):
      * workers/DedicatedWorkerGlobalScope.h: Renamed from Source/WebCore/workers/DedicatedWorkerContext.h.
      * workers/DedicatedWorkerGlobalScope.idl: Renamed from Source/WebCore/workers/DedicatedWorkerContext.idl.
      * workers/DedicatedWorkerThread.cpp:
      (WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
      (WebCore::DedicatedWorkerThread::runEventLoop):
      * workers/DedicatedWorkerThread.h:
      * workers/DefaultSharedWorkerRepository.cpp:
      (WebCore::SharedWorkerProxy::postTaskForModeToWorkerGlobalScope):
      (WebCore::SharedWorkerProxy::workerGlobalScopeClosed):
      (WebCore::SharedWorkerProxy::workerGlobalScopeDestroyed):
      (WebCore::SharedWorkerConnectTask::performTask):
      (WebCore::SharedWorkerScriptLoader::notifyFinished):
      (WebCore::DefaultSharedWorkerRepository::workerScriptLoaded):
      * workers/SharedWorkerGlobalScope.cpp: Renamed from Source/WebCore/workers/SharedWorkerContext.cpp.
      (WebCore::createConnectEvent):
      (WebCore::SharedWorkerGlobalScope::create):
      (WebCore::SharedWorkerGlobalScope::SharedWorkerGlobalScope):
      (WebCore::SharedWorkerGlobalScope::~SharedWorkerGlobalScope):
      (WebCore::SharedWorkerGlobalScope::interfaceName):
      (WebCore::SharedWorkerGlobalScope::thread):
      (WebCore::SharedWorkerGlobalScope::logExceptionToConsole):
      * workers/SharedWorkerGlobalScope.h: Renamed from Source/WebCore/workers/SharedWorkerContext.h.
      (WebCore::SharedWorkerGlobalScope::name):
      * workers/SharedWorkerGlobalScope.idl: Renamed from Source/WebCore/workers/SharedWorkerContext.idl.
      * workers/SharedWorkerThread.cpp:
      (WebCore::SharedWorkerThread::createWorkerGlobalScope):
      * workers/SharedWorkerThread.h:
      * workers/Worker.cpp:
      (WebCore::Worker::Worker):
      (WebCore::Worker::postMessage):
      (WebCore::Worker::terminate):
      (WebCore::Worker::notifyFinished):
      * workers/Worker.h:
      * workers/WorkerGlobalScope.cpp: Renamed from Source/WebCore/workers/WorkerContext.cpp.
      (WebCore::CloseWorkerGlobalScopeTask::create):
      (WebCore::CloseWorkerGlobalScopeTask::performTask):
      (WebCore::CloseWorkerGlobalScopeTask::isCleanupTask):
      (WebCore::WorkerGlobalScope::WorkerGlobalScope):
      (WebCore::WorkerGlobalScope::~WorkerGlobalScope):
      (WebCore::WorkerGlobalScope::applyContentSecurityPolicyFromString):
      (WebCore::WorkerGlobalScope::scriptExecutionContext):
      (WebCore::WorkerGlobalScope::virtualURL):
      (WebCore::WorkerGlobalScope::virtualCompleteURL):
      (WebCore::WorkerGlobalScope::completeURL):
      (WebCore::WorkerGlobalScope::userAgent):
      (WebCore::WorkerGlobalScope::disableEval):
      (WebCore::WorkerGlobalScope::location):
      (WebCore::WorkerGlobalScope::close):
      (WebCore::WorkerGlobalScope::navigator):
      (WebCore::WorkerGlobalScope::hasPendingActivity):
      (WebCore::WorkerGlobalScope::postTask):
      (WebCore::WorkerGlobalScope::setTimeout):
      (WebCore::WorkerGlobalScope::clearTimeout):
      (WebCore::WorkerGlobalScope::clearInspector):
      (WebCore::WorkerGlobalScope::setInterval):
      (WebCore::WorkerGlobalScope::clearInterval):
      (WebCore::WorkerGlobalScope::importScripts):
      (WebCore::WorkerGlobalScope::errorEventTarget):
      (WebCore::WorkerGlobalScope::logExceptionToConsole):
      (WebCore::WorkerGlobalScope::addConsoleMessage):
      (WebCore::WorkerGlobalScope::addMessage):
      (WebCore::WorkerGlobalScope::addMessageToWorkerConsole):
      (WebCore::WorkerGlobalScope::isContextThread):
      (WebCore::WorkerGlobalScope::isJSExecutionForbidden):
      (WebCore::WorkerGlobalScope::eventTargetData):
      (WebCore::WorkerGlobalScope::ensureEventTargetData):
      (WebCore::WorkerGlobalScope::Observer::Observer):
      (WebCore::WorkerGlobalScope::Observer::~Observer):
      (WebCore::WorkerGlobalScope::Observer::stopObserving):
      (WebCore::WorkerGlobalScope::registerObserver):
      (WebCore::WorkerGlobalScope::unregisterObserver):
      (WebCore::WorkerGlobalScope::notifyObserversOfStop):
      (WebCore::WorkerGlobalScope::eventQueue):
      * workers/WorkerGlobalScope.h: Renamed from Source/WebCore/workers/WorkerContext.h.
      (WebCore::WorkerGlobalScope::isSharedWorkerGlobalScope):
      (WebCore::WorkerGlobalScope::isDedicatedWorkerGlobalScope):
      (WebCore::WorkerGlobalScope::url):
      (WebCore::WorkerGlobalScope::groupSettings):
      (WebCore::WorkerGlobalScope::script):
      (WebCore::WorkerGlobalScope::clearScript):
      (WebCore::WorkerGlobalScope::thread):
      (WebCore::WorkerGlobalScope::self):
      (WebCore::WorkerGlobalScope::workerInspectorController):
      (WebCore::WorkerGlobalScope::optionalNavigator):
      (WebCore::WorkerGlobalScope::optionalLocation):
      (WebCore::WorkerGlobalScope::isClosing):
      * workers/WorkerGlobalScope.idl: Renamed from Source/WebCore/workers/WorkerContext.idl.
      * workers/WorkerGlobalScopeProxy.h: Renamed from Source/WebCore/workers/WorkerContextProxy.h.
      (WebCore::WorkerGlobalScopeProxy::~WorkerGlobalScopeProxy):
      (WebCore::WorkerGlobalScopeProxy::PageInspector::~PageInspector):
      (WebCore::WorkerGlobalScopeProxy::connectToInspector):
      (WebCore::WorkerGlobalScopeProxy::disconnectFromInspector):
      (WebCore::WorkerGlobalScopeProxy::sendMessageToInspector):
      * workers/WorkerLoaderProxy.h:
      * workers/WorkerMessagingProxy.cpp:
      (WebCore::MessageWorkerGlobalScopeTask::create):
      (WebCore::MessageWorkerGlobalScopeTask::MessageWorkerGlobalScopeTask):
      (WebCore::MessageWorkerGlobalScopeTask::performTask):
      (WebCore::WorkerGlobalScopeDestroyedTask::create):
      (WebCore::WorkerGlobalScopeDestroyedTask::WorkerGlobalScopeDestroyedTask):
      (WebCore::WorkerGlobalScopeDestroyedTask::performTask):
      (WebCore::WorkerTerminateTask::performTask):
      (WebCore::PostMessageToPageInspectorTask::performTask):
      (WebCore::WorkerGlobalScopeProxy::create):
      (WebCore::WorkerMessagingProxy::WorkerMessagingProxy):
      (WebCore::WorkerMessagingProxy::~WorkerMessagingProxy):
      (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
      (WebCore::WorkerMessagingProxy::postMessageToWorkerGlobalScope):
      (WebCore::WorkerMessagingProxy::postTaskForModeToWorkerGlobalScope):
      (WebCore::WorkerMessagingProxy::workerObjectDestroyedInternal):
      (WebCore::connectToWorkerGlobalScopeInspectorTask):
      (WebCore::WorkerMessagingProxy::connectToInspector):
      (WebCore::disconnectFromWorkerGlobalScopeInspectorTask):
      (WebCore::WorkerMessagingProxy::disconnectFromInspector):
      (WebCore::dispatchOnInspectorBackendTask):
      (WebCore::WorkerMessagingProxy::workerGlobalScopeDestroyed):
      (WebCore::WorkerMessagingProxy::workerGlobalScopeClosed):
      (WebCore::WorkerMessagingProxy::workerGlobalScopeDestroyedInternal):
      (WebCore::WorkerMessagingProxy::terminateWorkerGlobalScope):
      * workers/WorkerMessagingProxy.h:
      * workers/WorkerObjectProxy.h:
      * workers/WorkerReportingProxy.h:
      * workers/WorkerRunLoop.cpp:
      (WebCore::WorkerRunLoop::run):
      (WebCore::WorkerRunLoop::runInMode):
      (WebCore::WorkerRunLoop::runCleanupTasks):
      (WebCore::WorkerRunLoop::Task::performTask):
      * workers/WorkerRunLoop.h:
      * workers/WorkerScriptLoader.cpp:
      (WebCore::WorkerScriptLoader::loadSynchronously):
      * workers/WorkerThread.cpp:
      (WebCore::WorkerThread::workerThread):
      (WebCore::WorkerThread::runEventLoop):
      (WebCore::WorkerThreadShutdownFinishTask::performTask):
      (WebCore::WorkerThreadShutdownStartTask::performTask):
      (WebCore::WorkerThread::stop):
      * workers/WorkerThread.h:
      (WebCore::WorkerThread::workerGlobalScope):
      * xml/XMLHttpRequest.cpp:
      (WebCore::XMLHttpRequest::usesDashboardBackwardCompatibilityMode):
      (WebCore::XMLHttpRequest::responseXML):
      
      Source/WebKit/qt:
      
      Update calls to ScriptExecutionContext::isWorkerContext() as it was
      renamed to ScriptExecutionContext::isWorkerGlobalScope().
      
      * WebCoreSupport/NotificationPresenterClientQt.cpp:
      (WebCore::NotificationPresenterClientQt::show):
      (WebCore::NotificationPresenterClientQt::toPage):
      (WebCore::NotificationPresenterClientQt::toFrame):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152080 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      14792a6b
  7. 21 Mar, 2013 1 commit
    • jsbell@chromium.org's avatar
      IndexedDB: Ensure all API methods have IDB_TRACE macros · 49ac829d
      jsbell@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=112963
      
      Reviewed by Tony Chang.
      
      Anntotate methods and callbacks that weren't already annotated
      with IDB_TRACE macros to assist in debugging, e.g. when using
      the chromium port's chrome://tracing visualization.
      
      No new tests - just harmless diagnostic sprinkles.
      
      * Modules/indexeddb/IDBDatabase.cpp:
      (WebCore::IDBDatabase::createObjectStore): Added IDB_TRACE macro call here.
      (WebCore::IDBDatabase::deleteObjectStore): ...and here.
      (WebCore::IDBDatabase::transaction): ...etc.
      (WebCore::IDBDatabase::close):
      (WebCore::IDBDatabase::onVersionChange):
      * Modules/indexeddb/IDBFactory.cpp:
      (WebCore::IDBFactory::getDatabaseNames):
      (WebCore::IDBFactory::open):
      (WebCore::IDBFactory::deleteDatabase):
      * Modules/indexeddb/IDBFactoryBackendImpl.cpp:
      (WebCore::IDBFactoryBackendImpl::getDatabaseNames):
      (WebCore::IDBFactoryBackendImpl::deleteDatabase):
      (WebCore::IDBFactoryBackendImpl::open):
      * Modules/indexeddb/IDBOpenDBRequest.cpp:
      (WebCore::IDBOpenDBRequest::onBlocked):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146527 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      49ac829d
  8. 15 Mar, 2013 1 commit
    • jsbell@chromium.org's avatar
      [V8] Binding: Implement EnforceRange IDL Attribute for long long conversions · 131803a3
      jsbell@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=96798
      
      Reviewed by Kentaro Hara.
      
      Source/WebCore:
      
      Implement [EnforceRange] attribute for V8 bindings, which specifies throwing behavior
      on conversions outside int/uint 32/64 ranges and edge cases like NaNs and Infinities.
      Conversely, conversions without this attribute should *not* throw.
      
      Tests: fast/js/webidl-type-mapping.html:
             fast/dom/non-numeric-values-numeric-parameters.html
             fast/js/script-tests/select-options-add.html
             storage/indexeddb/intversion-bad-parameters.html
      
      * Modules/indexeddb/IDBCursor.cpp: Remove custom range enforcement for advance()
      * Modules/indexeddb/IDBCursor.h: Adjust type to match WebIDL.
      * Modules/indexeddb/IDBCursor.idl: Specify [EnforceRange] and type matches spec WebIDL.
      * Modules/indexeddb/IDBFactory.cpp: Remove custom range enforcement for open()
      * Modules/indexeddb/IDBFactory.h: Adjust type to match WebIDL.
      * Modules/indexeddb/IDBFactory.idl: Specify [EnforceRange] and type matches spec WebIDL.
      * bindings/scripts/CodeGeneratorJS.pm:
      (JSValueToNative): Add FIXME to support [EnforceRange]
      * bindings/scripts/CodeGeneratorV8.pm:
      (GenerateNormalAttrSetter): Handle [EnforceRange] in attribute setters
      (GenerateParametersCheck): Handle [EnforceRange] in parameters.
      (JSValueToNative): Pass EnforceRange to toInt() functions as appropriate.
      * bindings/scripts/IDLAttributes.txt:
      * bindings/scripts/test/TestObj.idl: Tests w/ [EnforceRange]
      * bindings/scripts/test/V8/V8TestObj.cpp: Updated expectations
      * bindings/scripts/test/V8/V8TestTypedefs.cpp: Updated expectations.
      * bindings/v8/V8Binding.cpp: Overloads for toInt() variants that handle constraints.
      (WebCore::toInt32):
      (WebCore::toUInt32):
      (WebCore::toInt64):
      (WebCore::toUInt64):
      * bindings/v8/V8Binding.h: Ditto, plus helpers for callers not expecting errors.
      (WebCore::toInt32):
      (WebCore::toUInt32):
      (WebCore::toInt64):
      (WebCore::toUInt64):
      * bindings/v8/V8BindingMacros.h: Helper macros for type conversions that may throw.
      * testing/TypeConversions.h: Added new members with EnforceRange constraint.
      * testing/TypeConversions.idl: Ditto.
      
      LayoutTests:
      
      Some of the tests for HTMLOptionsCollection.add() assumed it should throw for
      Infinities and NaNs, but this is not what the DOM+WebIDL specs say. (Firefox doesn't throw
      so this does not appear to be a web-compat issue.) This updates the tests/expectations so
      that V8 passes. JSC expectations are FAIL in a few places since it still incorrectly throws
      on Infinity/NaN -> int32 conversion (existing tests) and does not implement EnforceRange
      (new tests).
      
      Tne non-numeric-values-numeric-parameters test was also broken for NaN testing, reporting
      incorrect results which hid some of this behavior.
      
      * fast/dom/non-numeric-values-numeric-parameters-expected.txt: Failing behavior for JSC.
      * fast/dom/script-tests/non-numeric-values-numeric-parameters.js: HTMLOptionsCollection.add()
      should not throw on NaNs/Infinities.
      * fast/js/script-tests/select-options-add.js: Ditto.
      * fast/js/select-options-add-expected.txt: Failing behavior for JSC.
      * fast/js/webidl-type-mapping-expected.txt: Ditto.
      * fast/js/webidl-type-mapping.html: Added test cases for [EnforceRange]
      * platform/chromium/fast/dom/non-numeric-values-numeric-parameters-expected.txt: Added - passing behavior for V8.
      * platform/chromium/fast/js/select-options-add-expected.txt: Ditto.
      * platform/chromium/fast/js/webidl-type-mapping-expected.txt: Added.
      * storage/indexeddb/intversion-bad-parameters-expected.txt: Added non-finite test cases.
      * storage/indexeddb/resources/intversion-bad-parameters.js: Ditto.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145929 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      131803a3
  9. 13 Mar, 2013 1 commit
  10. 03 Feb, 2013 1 commit
    • commit-queue@webkit.org's avatar
      Adds usage instrumentation for indexedDB · 73a2ffee
      commit-queue@webkit.org authored
      Includes new header file in project files
      
      https://bugs.webkit.org/show_bug.cgi?id=107772
      
      Patch by Kassy Coan <kassycoan@chromium.org> on 2013-02-03
      Reviewed by Tony Chang.
      
      Currently untestable. Has zero effect apart from histogramming.
      
      * GNUmakefile.list.am:
      * Modules/indexeddb/IDBDatabase.cpp:
      (WebCore::IDBDatabase::createObjectStore):
      (WebCore::IDBDatabase::deleteObjectStore):
      (WebCore::IDBDatabase::transaction):
      * Modules/indexeddb/IDBFactory.cpp:
      (WebCore::IDBFactory::openInternal):
      (WebCore::IDBFactory::deleteDatabase):
      * Modules/indexeddb/IDBHistograms.h: Added.
      (WebCore):
      * Target.pri:
      * WebCore.gypi:
      * WebCore.vcproj/WebCore.vcproj:
      * WebCore.xcodeproj/project.pbxproj:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141735 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      73a2ffee
  11. 31 Jan, 2013 1 commit
    • mkwst@chromium.org's avatar
      Allow blocking of IndexedDB in third-party contexts · 8d2090c9
      mkwst@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=94171
      
      Reviewed by Jochen Eisinger.
      
      Source/WebCore:
      
      This patch ensures that the origin of the top window is passed into
      SecurityOrigin::canAccessDatabase when working with IndexedDB. Giving
      SecurityOrigin access to this data means that it can properly check
      whether the database is being opened in a third-party context, and
      therefore properly enforce the third-party access checks that were
      added in http://trac.webkit.org/changeset/125736.
      
      Third-party checks are added to IDBFactory::open,
      IDBFactory::deleteDatabase, and IDBFactory::getDatabaseNames; each will
      now throw a SECURITY_ERR exception when access in a third-party context
      if third-party access checks are enabled.
      
      To make this process slightly more clear, and avoid some ugly casting
      logic, this patch adds a 'topOrigin'  method to ScriptExecutionContext,
      and implements it on both WorkerContext and Document.
      
      Tests: http/tests/security/cross-origin-indexeddb-allowed.html
             http/tests/security/cross-origin-indexeddb.html
             http/tests/security/cross-origin-worker-indexeddb-allowed.html
             http/tests/security/cross-origin-worker-indexeddb.html
      
      * Modules/indexeddb/IDBFactory.cpp:
      (WebCore::IDBFactory::getDatabaseNames):
      (WebCore::IDBFactory::openInternal):
      (WebCore::IDBFactory::deleteDatabase):
          Grab the SecurityOrigin of the current context's top-level origin,
          and pass it to SecurityOrigin::canAccessDatabase to ensure that
          access checks are properly applied to these three methods.
      * dom/Document.cpp:
      (WebCore::Document::topOrigin):
      (WebCore):
      * dom/Document.h:
      (Document):
      * dom/ScriptExecutionContext.h:
      (ScriptExecutionContext):
          Add a topOrigin() method to ScriptExecutionContext, and implement it
          on Document in order to give callers access to the top document's
          SecurityOrigin without casting ScriptExecutionContext.
      * workers/WorkerContext.h:
          Change the existing topOrigin() method to override the new method
          on ScriptExecutionContext.
      
      LayoutTests:
      
      Add tests to ensure that IndexedDB can be blocked in a third-party
      context in both normal documents and in workers. These tests are
      modeled after the existing cross-origin-websql* tests; it might be
      possible to reuse some code in the future.
      
      * http/tests/security/cross-origin-indexeddb-allowed-expected.txt: Added.
      * http/tests/security/cross-origin-indexeddb-allowed.html: Added.
      * http/tests/security/cross-origin-indexeddb-expected.txt: Added.
      * http/tests/security/cross-origin-indexeddb.html: Added.
      * http/tests/security/cross-origin-worker-indexeddb-allowed-expected.txt: Added.
      * http/tests/security/cross-origin-worker-indexeddb-allowed.html: Added.
      * http/tests/security/cross-origin-worker-indexeddb-expected.txt: Added.
      * http/tests/security/cross-origin-worker-indexeddb.html: Added.
      * http/tests/security/resources/cross-origin-iframe-for-indexeddb.html: Added.
      * http/tests/security/resources/cross-origin-iframe-for-worker-indexeddb.html: Added.
      * http/tests/security/resources/document-for-cross-origin-worker-indexeddb.html: Added.
      * http/tests/security/resources/worker-for-indexeddb.js: Added.
      (self.onmessage):
          Add exciting new tests, with more boilerplate than I expected!
      * platform/efl/TestExpectations:
      * platform/mac-snowleopard/TestExpectations:
      * platform/mac/TestExpectations:
      * platform/qt/TestExpectations:
      * platform/win/TestExpectations:
      * platform/wincairo/TestExpectations:
          Skip these IndexedDB tests on platforms where the feature isn't
          enabled.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141418 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      8d2090c9
  12. 29 Jan, 2013 1 commit
    • mkwst@chromium.org's avatar
      IDBFactory::webkitGetDatabaseNames should raise DOMExceptions. · 4697cbba
      mkwst@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=108154
      
      Reviewed by Jochen Eisinger.
      
      In order to properly support blocking third-party IndexedDB usage,
      open(), getDatabaseNames(), and deleteDatabase() should all throw
      SECURITY_ERR when used in a blocked third-party context. That's possible
      now for open() and deleteDatabase(), but getDatabaseNames() can't
      currently raise exceptions.
      
      This patch adjusts the IDL file and implementation. No exceptions are
      currently thrown, but that will change as soon as wkbug.com/94171 lands.
      
      * Modules/indexeddb/IDBFactory.cpp:
      (WebCore::IDBFactory::getDatabaseNames):
      * Modules/indexeddb/IDBFactory.h:
      (IDBFactory):
      * Modules/indexeddb/IDBFactory.idl:
          Add "raises (DOMException)" to getDatabaseNames, and adjust the
          implementation to match.
      * inspector/InspectorIndexedDBAgent.cpp:
      (WebCore::InspectorIndexedDBAgent::requestDatabaseNamesForFrame):
          Pass in an ExceptionCode when calling getDatabaseNames, and handle
          possible exceptions.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141090 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      4697cbba
  13. 28 Jan, 2013 1 commit
    • commit-queue@webkit.org's avatar
      Unreviewed, rolling out r140934, r140935, and r140937. · 1b629091
      commit-queue@webkit.org authored
      http://trac.webkit.org/changeset/140934
      http://trac.webkit.org/changeset/140935
      http://trac.webkit.org/changeset/140937
      https://bugs.webkit.org/show_bug.cgi?id=108117
      
      Re-land some speculative rollouts - see wkbug.com/108048 for
      context (Requested by jsbell on #webkit).
      
      Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2013-01-28
      
      Source/WebCore:
      
      * CMakeLists.txt:
      * DerivedSources.make:
      * GNUmakefile.list.am:
      * Modules/indexeddb/IDBCallbacks.h:
      (IDBCallbacks):
      * Modules/indexeddb/IDBCursorBackendImpl.cpp:
      (WebCore::IDBCursorBackendImpl::IDBCursorBackendImpl):
      * Modules/indexeddb/IDBCursorBackendImpl.h:
      (WebCore::IDBCursorBackendImpl::create):
      (IDBCursorBackendImpl):
      * Modules/indexeddb/IDBDatabase.cpp:
      (WebCore::IDBDatabase::onVersionChange):
      * Modules/indexeddb/IDBDatabase.h:
      * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
      (WebCore::IDBDatabaseBackendImpl::setIndexesReady):
      (WebCore::OpenCursorOperation::perform):
      (WebCore::IDBDatabaseBackendImpl::deleteDatabase):
      * Modules/indexeddb/IDBFactory.cpp:
      (WebCore::IDBFactory::openInternal):
      (WebCore::IDBFactory::deleteDatabase):
      * Modules/indexeddb/IDBFactory.h:
      (WebCore):
      (IDBFactory):
      * Modules/indexeddb/IDBFactory.idl:
      * Modules/indexeddb/IDBObjectStore.cpp:
      (WebCore::IDBObjectStore::createIndex):
      (WebCore::IDBObjectStore::openCursor):
      * Modules/indexeddb/IDBObjectStore.h:
      (WebCore::IDBObjectStore::openCursor):
      (IDBObjectStore):
      * Modules/indexeddb/IDBOpenDBRequest.cpp:
      (WebCore::IDBOpenDBRequest::create):
      (WebCore::IDBOpenDBRequest::IDBOpenDBRequest):
      (WebCore::IDBOpenDBRequest::onBlocked):
      (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
      (WebCore::IDBOpenDBRequest::dispatchEvent):
      * Modules/indexeddb/IDBOpenDBRequest.h:
      (IDBOpenDBRequest):
      * Modules/indexeddb/IDBRequest.cpp:
      (WebCore::IDBRequest::create):
      (WebCore::IDBRequest::IDBRequest):
      * Modules/indexeddb/IDBRequest.h:
      (IDBRequest):
      (WebCore::IDBRequest::taskType):
      * Modules/indexeddb/IDBTransactionBackendImpl.cpp:
      (WebCore::IDBTransactionBackendImpl::scheduleTask):
      * Modules/indexeddb/IDBTransactionBackendImpl.h:
      (WebCore::IDBTransactionBackendImpl::scheduleTask):
      (IDBTransactionBackendImpl):
      * Modules/indexeddb/IDBTransactionBackendInterface.h:
      * Modules/indexeddb/IDBUpgradeNeededEvent.cpp: Removed.
      * Modules/indexeddb/IDBUpgradeNeededEvent.h: Removed.
      * Modules/indexeddb/IDBUpgradeNeededEvent.idl: Removed.
      * Modules/indexeddb/IDBVersionChangeEvent.cpp:
      (WebCore::IDBVersionChangeEvent::create):
      (WebCore::IDBVersionChangeEvent::IDBVersionChangeEvent):
      * Modules/indexeddb/IDBVersionChangeEvent.h:
      (IDBVersionChangeEvent):
      (WebCore::IDBVersionChangeEvent::oldVersion):
      (WebCore::IDBVersionChangeEvent::newVersion):
      * Modules/indexeddb/IDBVersionChangeEvent.idl:
      * Modules/indexeddb/IDBVersionChangeRequest.cpp: Removed.
      * Modules/indexeddb/IDBVersionChangeRequest.h: Removed.
      * Modules/indexeddb/IDBVersionChangeRequest.idl: Removed.
      * WebCore.gypi:
      * WebCore.xcodeproj/project.pbxproj:
      * dom/EventNames.in:
      * dom/EventTarget.h:
      (WebCore):
      * dom/EventTargetFactory.in:
      
      Source/WebKit/chromium:
      
      * public/WebIDBCallbacks.h:
      (WebIDBCallbacks):
      * src/AssertMatchingEnums.cpp:
      * src/IDBCallbacksProxy.cpp:
      * src/IDBCallbacksProxy.h:
      (IDBCallbacksProxy):
      * src/WebIDBCallbacksImpl.cpp:
      * src/WebIDBCallbacksImpl.h:
      (WebIDBCallbacksImpl):
      * tests/IDBAbortOnCorruptTest.cpp:
      * tests/IDBDatabaseBackendTest.cpp:
      
      LayoutTests:
      
      * storage/indexeddb/delete-in-upgradeneeded-close-in-open-success-expected.txt:
      * storage/indexeddb/delete-in-upgradeneeded-close-in-versionchange-expected.txt:
      * storage/indexeddb/deletedatabase-blocked-expected.txt:
      * storage/indexeddb/deletedatabase-delayed-by-open-and-versionchange-expected.txt:
      * storage/indexeddb/deletedatabase-delayed-by-open-and-versionchange-workers-expected.txt:
      * storage/indexeddb/deletedatabase-delayed-by-versionchange-expected.txt:
      * storage/indexeddb/deletedatabase-not-blocked-expected.txt:
      * storage/indexeddb/events-expected.txt: Added.
      * storage/indexeddb/events.html: Added.
      * storage/indexeddb/intversion-gated-on-delete-expected.txt:
      * storage/indexeddb/intversion-long-queue-expected.txt:
      * storage/indexeddb/intversion-upgrades-expected.txt:
      * storage/indexeddb/removed-expected.txt:
      * storage/indexeddb/resources/delete-in-upgradeneeded-close-in-open-success.js:
      (versionChangeCallback):
      * storage/indexeddb/resources/delete-in-upgradeneeded-close-in-versionchange.js:
      (versionChangeCallback):
      * storage/indexeddb/resources/deletedatabase-blocked.js:
      (test.request.onsuccess.openOnSuccess.h.onversionchange):
      * storage/indexeddb/resources/deletedatabase-delayed-by-open-and-versionchange.js:
      (prepareDatabase.h.onversionchange):
      * storage/indexeddb/resources/deletedatabase-delayed-by-versionchange.js:
      (h1OpenSuccess.h1.onversionchange.h1OnVersionChange.h1.onversionchange):
      (h1OpenSuccess.h1.onversionchange):
      (h1OpenSuccess.request.onsuccess.h2OpenSuccess.h2.onversionchange):
      * storage/indexeddb/resources/deletedatabase-not-blocked.js:
      (test.request.onsuccess.openOnSuccess.h.onversionchange):
      * storage/indexeddb/resources/events.js: Added.
      (test):
      * storage/indexeddb/resources/intversion-gated-on-delete.js:
      (firstSuccessCallback):
      (connection1VersionChangeCallback):
      * storage/indexeddb/resources/intversion-long-queue.js:
      (connection1VersionChangeCallback):
      (deleteDatabaseBlockedCallback):
      (deleteDatabaseSuccessCallback):
      (connection2VersionChangeEvent):
      * storage/indexeddb/resources/removed.js:
      (test):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141013 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1b629091
  14. 27 Jan, 2013 2 commits
    • commit-queue@webkit.org's avatar
      Unreviewed, rolling out r140602. · 6935ae64
      commit-queue@webkit.org authored
      http://trac.webkit.org/changeset/140602
      https://bugs.webkit.org/show_bug.cgi?id=108045
      
      Caused 8 indexed tests to crash. (Requested by keishi on
      #webkit).
      
      Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2013-01-27
      
      Source/WebCore:
      
      * CMakeLists.txt:
      * DerivedSources.make:
      * GNUmakefile.list.am:
      * Modules/indexeddb/IDBCallbacks.h:
      (WebCore::IDBCallbacks::onBlocked):
      * Modules/indexeddb/IDBDatabase.cpp:
      * Modules/indexeddb/IDBDatabase.h:
      (WebCore):
      * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
      (WebCore::IDBDatabaseBackendImpl::deleteDatabase):
      * Modules/indexeddb/IDBFactory.cpp:
      (WebCore::IDBFactory::openInternal):
      (WebCore::IDBFactory::deleteDatabase):
      * Modules/indexeddb/IDBFactory.h:
      (WebCore):
      (IDBFactory):
      * Modules/indexeddb/IDBFactory.idl:
      * Modules/indexeddb/IDBOpenDBRequest.cpp:
      (WebCore::IDBOpenDBRequest::create):
      (WebCore::IDBOpenDBRequest::IDBOpenDBRequest):
      (WebCore::IDBOpenDBRequest::dispatchEvent):
      * Modules/indexeddb/IDBOpenDBRequest.h:
      (IDBOpenDBRequest):
      * Modules/indexeddb/IDBVersionChangeRequest.cpp: Copied from Source/WebKit/chromium/src/WebIDBCallbacksImpl.h.
      (WebCore):
      (WebCore::IDBVersionChangeRequest::create):
      (WebCore::IDBVersionChangeRequest::IDBVersionChangeRequest):
      (WebCore::IDBVersionChangeRequest::~IDBVersionChangeRequest):
      (WebCore::IDBVersionChangeRequest::interfaceName):
      (WebCore::IDBVersionChangeRequest::onBlocked):
      * Modules/indexeddb/IDBVersionChangeRequest.h: Copied from Source/WebCore/Modules/indexeddb/IDBFactory.idl.
      (WebCore):
      (IDBVersionChangeRequest):
      * Modules/indexeddb/IDBVersionChangeRequest.idl: Copied from Source/WebCore/Modules/indexeddb/IDBFactory.idl.
      * WebCore.gypi:
      * WebCore.xcodeproj/project.pbxproj:
      * dom/EventTarget.h:
      (WebCore):
      * dom/EventTargetFactory.in:
      
      Source/WebKit/chromium:
      
      * public/WebIDBCallbacks.h:
      * src/IDBCallbacksProxy.cpp:
      (WebKit::IDBCallbacksProxy::onBlocked):
      (WebKit):
      * src/IDBCallbacksProxy.h:
      (IDBCallbacksProxy):
      * src/WebIDBCallbacksImpl.cpp:
      (WebKit::WebIDBCallbacksImpl::onBlocked):
      (WebKit):
      * src/WebIDBCallbacksImpl.h:
      (WebIDBCallbacksImpl):
      * tests/IDBAbortOnCorruptTest.cpp:
      (WebCore::MockIDBCallbacks::onBlocked):
      * tests/IDBDatabaseBackendTest.cpp:
      
      LayoutTests:
      
      * storage/indexeddb/intversion-long-queue-expected.txt:
      * storage/indexeddb/intversion-upgrades-expected.txt:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140937 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      6935ae64
    • commit-queue@webkit.org's avatar
      Unreviewed, rolling out r140741. · 946db2c5
      commit-queue@webkit.org authored
      http://trac.webkit.org/changeset/140741
      https://bugs.webkit.org/show_bug.cgi?id=108044
      
      Caused 8 indexed tests to fail on Mac and Win. (Requested by
      keishi on #webkit).
      
      Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2013-01-27
      
      Source/WebCore:
      
      * CMakeLists.txt:
      * GNUmakefile.list.am:
      * Modules/indexeddb/IDBDatabase.cpp:
      (WebCore::IDBDatabase::onVersionChange):
      * Modules/indexeddb/IDBFactory.cpp:
      (WebCore::IDBFactory::deleteDatabase):
      * Modules/indexeddb/IDBOpenDBRequest.cpp:
      (WebCore::IDBOpenDBRequest::onBlocked):
      (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
      * Modules/indexeddb/IDBUpgradeNeededEvent.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.cpp.
      (WebCore):
      (WebCore::IDBUpgradeNeededEvent::create):
      (WebCore::IDBUpgradeNeededEvent::IDBUpgradeNeededEvent):
      (WebCore::IDBUpgradeNeededEvent::~IDBUpgradeNeededEvent):
      (WebCore::IDBUpgradeNeededEvent::oldVersion):
      (WebCore::IDBUpgradeNeededEvent::newVersion):
      (WebCore::IDBUpgradeNeededEvent::interfaceName):
      * Modules/indexeddb/IDBUpgradeNeededEvent.h: Copied from Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.h.
      (WebCore):
      (IDBUpgradeNeededEvent):
      * Modules/indexeddb/IDBUpgradeNeededEvent.idl: Copied from Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.idl.
      * Modules/indexeddb/IDBVersionChangeEvent.cpp:
      (WebCore::IDBVersionChangeEvent::create):
      (WebCore::IDBVersionChangeEvent::IDBVersionChangeEvent):
      (WebCore::IDBVersionChangeEvent::version):
      (WebCore):
      * Modules/indexeddb/IDBVersionChangeEvent.h:
      (WebCore):
      (IDBVersionChangeEvent):
      * Modules/indexeddb/IDBVersionChangeEvent.idl:
      * WebCore.gypi:
      * dom/EventNames.in:
      
      LayoutTests:
      
      * storage/indexeddb/delete-in-upgradeneeded-close-in-open-success-expected.txt:
      * storage/indexeddb/delete-in-upgradeneeded-close-in-versionchange-expected.txt:
      * storage/indexeddb/deletedatabase-blocked-expected.txt:
      * storage/indexeddb/deletedatabase-delayed-by-open-and-versionchange-expected.txt:
      * storage/indexeddb/deletedatabase-delayed-by-open-and-versionchange-workers-expected.txt:
      * storage/indexeddb/deletedatabase-delayed-by-versionchange-expected.txt:
      * storage/indexeddb/deletedatabase-not-blocked-expected.txt:
      * storage/indexeddb/events-expected.txt: Removed.
      * storage/indexeddb/events.html: Removed.
      * storage/indexeddb/intversion-gated-on-delete-expected.txt:
      * storage/indexeddb/intversion-long-queue-expected.txt:
      * storage/indexeddb/removed-expected.txt:
      * storage/indexeddb/resources/delete-in-upgradeneeded-close-in-open-success.js:
      (versionChangeCallback):
      * storage/indexeddb/resources/delete-in-upgradeneeded-close-in-versionchange.js:
      (versionChangeCallback):
      * storage/indexeddb/resources/deletedatabase-blocked.js:
      (test.request.onsuccess.openOnSuccess.h.onversionchange):
      * storage/indexeddb/resources/deletedatabase-delayed-by-open-and-versionchange.js:
      (prepareDatabase.h.onversionchange):
      * storage/indexeddb/resources/deletedatabase-delayed-by-versionchange.js:
      (h1OpenSuccess.h1.onversionchange):
      (h1OpenSuccess.request.onsuccess.h2OpenSuccess.h2.onversionchange):
      * storage/indexeddb/resources/deletedatabase-not-blocked.js:
      (test.request.onsuccess.openOnSuccess.h.onversionchange):
      * storage/indexeddb/resources/events.js: Removed.
      * storage/indexeddb/resources/intversion-gated-on-delete.js:
      (firstSuccessCallback):
      (connection1VersionChangeCallback):
      * storage/indexeddb/resources/intversion-long-queue.js:
      (connection1VersionChangeCallback):
      (deleteDatabaseBlockedCallback):
      (deleteDatabaseSuccessCallback):
      (connection2VersionChangeEvent):
      * storage/indexeddb/resources/removed.js:
      (test):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140934 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      946db2c5
  15. 24 Jan, 2013 1 commit
    • jsbell@chromium.org's avatar
      IndexedDB: Remove IDBUpgradeNeededEvent, merge with IDBVersionChangeEvent · cd4af9db
      jsbell@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=107754
      
      Reviewed by Tony Chang.
      
      Source/WebCore:
      
      The IndexedDB spec calls deleteDatabase() to fire a "blocked" event with the
      IDBVersionChangeEvent interface which we were doing, but with an older interface - just
      a "version" property. We were already firing an event on "versionchange" with the new
      "oldVersion" and "newVersion" properties, but with an IDBUpgradeNeededEvent interface that
      doesn't exist in the spec. This patch merges the event types to match the spec, including
      that the newVersion property is null when deleting.
      
      Test: storage/indexeddb/events.html
            storage/indexeddb/deletedatabase-*.html
      
      * CMakeLists.txt: Remove references to deleted files.
      * GNUmakefile.list.am: Ditto.
      * Modules/indexeddb/IDBDatabase.cpp:
      (WebCore::IDBDatabase::onVersionChange): Generate IDBVersionChangeEvent.
      * Modules/indexeddb/IDBOpenDBRequest.cpp:
      (WebCore::IDBOpenDBRequest::onBlocked): Ditto.
      (WebCore::IDBOpenDBRequest::onUpgradeNeeded): Ditto.
      * Modules/indexeddb/IDBUpgradeNeededEvent.cpp: Removed.
      * Modules/indexeddb/IDBUpgradeNeededEvent.h: Removed.
      * Modules/indexeddb/IDBUpgradeNeededEvent.idl: Removed.
      * Modules/indexeddb/IDBVersionChangeEvent.cpp:
      (WebCore::IDBVersionChangeEvent::create): Take IDBAny's as old/new versions
      may be integers, strings (for legacy databases), or null (when deleting).
      (WebCore::IDBVersionChangeEvent::IDBVersionChangeEvent):
      * Modules/indexeddb/IDBVersionChangeEvent.h:
      (IDBVersionChangeEvent): Remove version property.
      (WebCore::IDBVersionChangeEvent::oldVersion): Added new property.
      (WebCore::IDBVersionChangeEvent::newVersion): Added new property.
      * Modules/indexeddb/IDBVersionChangeEvent.idl: Updated properties.
      * WebCore.gypi: Remove references to deleted files.
      * dom/EventNames.in: Ditto.
      
      LayoutTests:
      
      Updated expectations, and new test file. In most cases, just switch test from
      looking at event.target.version and event.version to event.oldVersion and event.newVersion,
      in some cases verifying the old properties as well as a sanity check.
      
      * storage/indexeddb/delete-in-upgradeneeded-close-in-open-success-expected.txt:
      * storage/indexeddb/delete-in-upgradeneeded-close-in-versionchange-expected.txt:
      * storage/indexeddb/deletedatabase-blocked-expected.txt:
      * storage/indexeddb/deletedatabase-delayed-by-open-and-versionchange-expected.txt:
      * storage/indexeddb/deletedatabase-delayed-by-open-and-versionchange-workers-expected.txt:
      * storage/indexeddb/deletedatabase-delayed-by-versionchange-expected.txt:
      * storage/indexeddb/deletedatabase-not-blocked-expected.txt:
      * storage/indexeddb/events-expected.txt: Added.
      * storage/indexeddb/events.html: Added.
      * storage/indexeddb/intversion-gated-on-delete-expected.txt:
      * storage/indexeddb/intversion-long-queue-expected.txt:
      * storage/indexeddb/removed-expected.txt:
      * storage/indexeddb/resources/delete-in-upgradeneeded-close-in-open-success.js:
      * storage/indexeddb/resources/deletedatabase-blocked.js:
      * storage/indexeddb/resources/deletedatabase-delayed-by-open-and-versionchange.js:
      * storage/indexeddb/resources/deletedatabase-delayed-by-versionchange.js:
      * storage/indexeddb/resources/deletedatabase-not-blocked.js:
      * storage/indexeddb/resources/events.js: Added.
      * storage/indexeddb/resources/intversion-gated-on-delete.js:
      * storage/indexeddb/resources/intversion-long-queue.js:
      * storage/indexeddb/resources/removed.js: Verify that old Event type and property are gone.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140741 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      cd4af9db
  16. 23 Jan, 2013 1 commit
    • jsbell@chromium.org's avatar
      IndexedDB: Remove IDBVersionChangeRequest · d57bce8b
      jsbell@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=107711
      
      Reviewed by Tony Chang.
      
      Source/WebCore:
      
      When the setVersion() API was removed from the Indexed DB spec the IDBVersionChangeRequest
      interface was replaced with IDBOpenDBRequest. We switched over for open(), this completes
      the work by switching over for deleteDatabase() and removing the old code. (On the Event
      side we still need to combine IDBVersionChangeEvent and IDBUpgradeNeededEvent.)
      
      Test: storage/indexeddb/intversion-long-queue.html
            storage/indexeddb/intversion-upgrades.html
      
      * CMakeLists.txt: Remove references to deleted code.
      * DerivedSources.make: Ditto.
      * GNUmakefile.list.am: Ditto.
      * Modules/indexeddb/IDBCallbacks.h: Remove unused onBlocked() overload.
      * Modules/indexeddb/IDBDatabase.cpp: Remove references to deleted code.
      * Modules/indexeddb/IDBDatabase.h: Ditto.
      * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
      (WebCore::IDBDatabaseBackendImpl::deleteDatabase): Fire onBlocked with current version.
      * Modules/indexeddb/IDBFactory.cpp:
      (WebCore::IDBFactory::openInternal): Don't need to specify source.
      (WebCore::IDBFactory::deleteDatabase): Use an IDBOpenDBRequest.
      * Modules/indexeddb/IDBFactory.h: Change return type of deleteDatabase()
      * Modules/indexeddb/IDBFactory.idl: Ditto.
      * Modules/indexeddb/IDBOpenDBRequest.cpp:
      (WebCore::IDBOpenDBRequest::create): Always use a null source.
      (WebCore::IDBOpenDBRequest::IDBOpenDBRequest): Pass null source to base class.
      (WebCore::IDBOpenDBRequest::dispatchEvent): Don't assume result is a database in existing
      special case.
      * Modules/indexeddb/IDBOpenDBRequest.h: Don't need a source argument (always null).
      * Modules/indexeddb/IDBVersionChangeRequest.cpp: Removed.
      * Modules/indexeddb/IDBVersionChangeRequest.h: Removed.
      * Modules/indexeddb/IDBVersionChangeRequest.idl: Removed.
      * WebCore.gypi: Remove references to deleted code.
      * WebCore.xcodeproj/project.pbxproj: Remove references to deleted code.
      * dom/EventTarget.h: Remove references to deleted code.
      * dom/EventTargetFactory.in: Ditto.
      
      Source/WebKit/chromium:
      
      * public/WebIDBCallbacks.h: Note to delete onBlocked() once Chromium is cleaned up.
      * src/IDBCallbacksProxy.cpp: Remove unused onBlocked() overload.
      * src/IDBCallbacksProxy.h: Ditto.
      * src/WebIDBCallbacksImpl.cpp: Ditto.
      * src/WebIDBCallbacksImpl.h: Ditto.
      * tests/IDBAbortOnCorruptTest.cpp: Ditto.
      * tests/IDBDatabaseBackendTest.cpp: Ditto.
      
      LayoutTests:
      
      Update expectations - change a handful of FAIL to PASS because past-us were awesome.
      
      * storage/indexeddb/intversion-long-queue-expected.txt:
      * storage/indexeddb/intversion-upgrades-expected.txt:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140602 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d57bce8b
  17. 22 Jan, 2013 1 commit
    • jsbell@chromium.org's avatar
      IndexedDB: Remove dependency on IDBKey type from IDLs · 174edbc1
      jsbell@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=106912
      
      Reviewed by Kentaro Hara.
      
      This is a preamble to wkbug.com/97375 "Remove IDBKey from WebKitIDL"; IDBKey is
      not a concept from the Indexed DB spec but a convenient internal type. It was
      exposed in the IDL with custom binding code and special cases in the generator
      to map from script values to the WebCore type. To remove those special cases
      and match the WebIDL in the spec, the IDLs are changed to use "any" and the
      implementations now take ScriptValues. This does mean that each call site must
      call into IDBBindingUtilities to map from ScriptValue to IDBKey.
      
      No new tests - just a refactor.
      
      * Modules/indexeddb/IDBAny.cpp: Remove IDBKey as a variant type - just use ScriptValue.
      * Modules/indexeddb/IDBAny.h:
      (WebCore):
      (IDBAny):
      * Modules/indexeddb/IDBCursor.cpp:
      (WebCore::IDBCursor::continueFunction): Now takes any/ScriptValue.
      (WebCore):
      * Modules/indexeddb/IDBCursor.h:
      (WebCore::IDBCursor::continueFunction):
      (IDBCursor):
      * Modules/indexeddb/IDBCursor.idl:
      * Modules/indexeddb/IDBCursorBackendImpl.cpp:
      (WebCore::IDBCursorBackendImpl::deleteFunction):
      * Modules/indexeddb/IDBFactory.cpp:
      (WebCore::IDBFactory::cmp): Now takes any/ScriptValue.
      * Modules/indexeddb/IDBFactory.h:
      (IDBFactory):
      * Modules/indexeddb/IDBFactory.idl:
      * Modules/indexeddb/IDBIndex.cpp:
      (WebCore::IDBIndex::openCursor): Now takes any/ScriptValue.
      (WebCore::IDBIndex::count): Now takes any/ScriptValue.
      (WebCore::IDBIndex::openKeyCursor): Now takes any/ScriptValue.
      (WebCore::IDBIndex::get): Now takes any/ScriptValue.
      (WebCore::IDBIndex::getKey): Now takes any/ScriptValue.
      * Modules/indexeddb/IDBIndex.h:
      (WebCore::IDBIndex::openCursor):
      (IDBIndex):
      (WebCore::IDBIndex::openKeyCursor):
      * Modules/indexeddb/IDBIndex.idl:
      * Modules/indexeddb/IDBKeyRange.cpp:
      (WebCore::IDBKeyRange::create): Add helper for back-end creation of single-key ranges.
      (WebCore):
      (WebCore::IDBKeyRange::lowerValue): Impl. of new "any" type accessor exposed to script.
      (WebCore::IDBKeyRange::upperValue): Ditto.
      (WebCore::IDBKeyRange::only): Now takes any/ScriptValue.
      (WebCore::IDBKeyRange::lowerBound): Now takes any/ScriptValue.
      (WebCore::IDBKeyRange::upperBound): Now takes any/ScriptValue.
      (WebCore::IDBKeyRange::bound): Now takes any/ScriptValue.
      * Modules/indexeddb/IDBKeyRange.h:
      (IDBKeyRange):
      (WebCore::IDBKeyRange::lowerBound):
      (WebCore::IDBKeyRange::upperBound):
      (WebCore::IDBKeyRange::bound):
      * Modules/indexeddb/IDBKeyRange.idl:
      * Modules/indexeddb/IDBObjectStore.cpp:
      (WebCore::IDBObjectStore::get): Now takes any/ScriptValue.
      (WebCore::IDBObjectStore::add): Now takes any/ScriptValue.
      (WebCore):
      (WebCore::IDBObjectStore::put): Now takes any/ScriptValue.
      (WebCore::IDBObjectStore::deleteFunction): Now takes any/ScriptValue.
      (WebCore::IDBObjectStore::openCursor): Now takes any/ScriptValue.
      (WebCore::IDBObjectStore::count): Now takes any/ScriptValue.
      * Modules/indexeddb/IDBObjectStore.h:
      (IDBObjectStore):
      (WebCore::IDBObjectStore::openCursor):
      * Modules/indexeddb/IDBObjectStore.idl:
      * Modules/indexeddb/IDBRequest.cpp: Result IDBAny type is now ScriptValue.
      (WebCore::IDBRequest::onSuccess):
      * bindings/js/IDBBindingUtilities.cpp:
      (WebCore::scriptValueToIDBKey): The inverse of idbKeyToScriptValue().
      (WebCore):
      * bindings/js/IDBBindingUtilities.h:
      (WebCore):
      * bindings/js/JSIDBAnyCustom.cpp:
      (WebCore::toJS):
      * bindings/v8/IDBBindingUtilities.cpp:
      (WebCore::scriptValueToIDBKey): Ditto.
      (WebCore):
      * bindings/v8/IDBBindingUtilities.h:
      (WebCore):
      * bindings/v8/custom/V8IDBAnyCustom.cpp:
      (WebCore::toV8): Remove IDBKey variant type.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140457 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      174edbc1
  18. 07 Dec, 2012 2 commits
    • alecflett@chromium.org's avatar
      IndexedDB: propagate transaction_ids through open/upgradeneeded · 7210eac4
      alecflett@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=103922
      
      Reviewed by Tony Chang.
      
      Source/WebCore:
      
      Make sure front-end is always generating the transaction id,
      so that it can be relied upon as an alternative to the
      to-be-deprecated IDBTransactionBackendInterface pointer.
      
      No new tests, this is one stage in a larger refactor.
      
      * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
      (WebCore::IDBDatabaseBackendImpl::VersionChangeOperation::create):
      (WebCore::IDBDatabaseBackendImpl::VersionChangeOperation::VersionChangeOperation):
      (IDBDatabaseBackendImpl::VersionChangeOperation):
      (WebCore::IDBDatabaseBackendImpl::PendingOpenCall::create):
      (WebCore::IDBDatabaseBackendImpl::PendingOpenCall::transactionId):
      (WebCore::IDBDatabaseBackendImpl::PendingOpenCall::PendingOpenCall):
      (IDBDatabaseBackendImpl::PendingOpenCall):
      (WebCore::IDBDatabaseBackendImpl::PendingOpenWithVersionCall::create):
      (WebCore::IDBDatabaseBackendImpl::PendingOpenWithVersionCall::transactionId):
      (WebCore::IDBDatabaseBackendImpl::PendingOpenWithVersionCall::PendingOpenWithVersionCall):
      (IDBDatabaseBackendImpl::PendingOpenWithVersionCall):
      (WebCore::IDBDatabaseBackendImpl::VersionChangeOperation::perform):
      (WebCore::IDBDatabaseBackendImpl::processPendingCalls):
      (WebCore::IDBDatabaseBackendImpl::createTransaction):
      (WebCore::IDBDatabaseBackendImpl::openConnection):
      (WebCore::IDBDatabaseBackendImpl::runIntVersionChangeTransaction):
      (WebCore::IDBDatabaseBackendImpl::openConnectionWithVersion):
      * Modules/indexeddb/IDBDatabaseBackendImpl.h:
      (IDBDatabaseBackendImpl):
      * Modules/indexeddb/IDBFactory.cpp:
      (WebCore::IDBFactory::openInternal):
      * Modules/indexeddb/IDBFactoryBackendImpl.cpp:
      (WebCore::IDBFactoryBackendImpl::open):
      
      Source/WebKit/chromium:
      
      Update test to account for pre-generated transaction ids.
      
      * tests/IDBDatabaseBackendTest.cpp:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136992 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      7210eac4
    • commit-queue@webkit.org's avatar
      IndexedDB: Replace int64 with int64_t · b8401e52
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=104338
      
      Patch by Michael Pruett <michael@68k.org> on 2012-12-06
      Reviewed by Kentaro Hara.
      
      Cleaning up coding inconsistencies, no change in behavior.
      
      Tests: storage/indexeddb/*
      
      * Modules/indexeddb/IDBFactory.cpp:
      (WebCore::IDBFactory::openInternal):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136923 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b8401e52
  19. 05 Dec, 2012 1 commit
    • alecflett@chromium.org's avatar
      IndexedDB: Stub out transaction-backend methods · d653faa0
      alecflett@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=103921
      
      Reviewed by Dimitri Glazkov.
      
      Source/WebCore:
      
      In preparation for a refactoring. Legacy methods
      will be removed in https://bugs.webkit.org/show_bug.cgi?id=103923.
      
      No new tests, just adding unused methods for refactoring.
      
      * Modules/indexeddb/IDBCallbacks.h:
      (WebCore::IDBCallbacks::onUpgradeNeeded):
      * Modules/indexeddb/IDBDatabase.cpp:
      (WebCore::IDBDatabase::onAbort):
      (WebCore):
      (WebCore::IDBDatabase::onComplete):
      * Modules/indexeddb/IDBDatabase.h:
      (IDBDatabase):
      * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
      (WebCore::IDBDatabaseBackendImpl::createTransaction):
      (WebCore):
      * Modules/indexeddb/IDBDatabaseBackendImpl.h:
      (IDBDatabaseBackendImpl):
      (WebCore::IDBDatabaseBackendImpl::commit):
      (WebCore::IDBDatabaseBackendImpl::abort):
      * Modules/indexeddb/IDBDatabaseBackendInterface.h:
      (IDBDatabaseBackendInterface):
      * Modules/indexeddb/IDBDatabaseCallbacks.h:
      (IDBDatabaseCallbacks):
      * Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp:
      (WebCore::IDBDatabaseCallbacksImpl::onAbort):
      (WebCore):
      (WebCore::IDBDatabaseCallbacksImpl::onComplete):
      * Modules/indexeddb/IDBDatabaseCallbacksImpl.h:
      (IDBDatabaseCallbacksImpl):
      * Modules/indexeddb/IDBFactoryBackendImpl.cpp:
      (WebCore::IDBFactoryBackendImpl::open):
      * Modules/indexeddb/IDBFactoryBackendImpl.h:
      (WebCore::IDBFactoryBackendImpl::open):
      (IDBFactoryBackendImpl):
      * Modules/indexeddb/IDBFactoryBackendInterface.h:
      (IDBFactoryBackendInterface):
      * Modules/indexeddb/IDBOpenDBRequest.cpp:
      (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
      (WebCore):
      * Modules/indexeddb/IDBOpenDBRequest.h:
      (IDBOpenDBRequest):
      * Modules/indexeddb/IDBTransactionBackendInterface.h:
      (WebCore):
      * Modules/indexeddb/IDBTransactionCoordinator.h:
      
      Source/WebKit/chromium:
      
      Add new signatures for refactoring, to allow
      transaction_ids to make is through the open/onUpgradeNeeded
      loop.
      
      * public/WebIDBCallbacks.h:
      (WebKit::WebIDBCallbacks::onUpgradeNeeded):
      * public/WebIDBDatabase.h:
      (WebKit::WebIDBDatabase::createTransaction):
      (WebKit::WebIDBDatabase::abort):
      (WebKit::WebIDBDatabase::commit):
      (WebIDBDatabase):
      * public/WebIDBDatabaseCallbacks.h:
      (WebIDBDatabaseCallbacks):
      (WebKit::WebIDBDatabaseCallbacks::onAbort):
      (WebKit::WebIDBDatabaseCallbacks::onComplete):
      * public/WebIDBFactory.h:
      (WebKit::WebIDBFactory::open):
      * src/IDBCallbacksProxy.cpp:
      (WebKit::IDBCallbacksProxy::onUpgradeNeeded):
      (WebKit):
      * src/IDBCallbacksProxy.h:
      (IDBCallbacksProxy):
      * src/IDBDatabaseBackendProxy.cpp:
      (WebKit::IDBDatabaseBackendProxy::createTransaction):
      (WebKit):
      (WebKit::IDBDatabaseBackendProxy::commit):
      (WebKit::IDBDatabaseBackendProxy::abort):
      * src/IDBDatabaseBackendProxy.h:
      (IDBDatabaseBackendProxy):
      * src/IDBDatabaseCallbacksProxy.cpp:
      (WebKit::IDBDatabaseCallbacksProxy::onAbort):
      (WebKit):
      (WebKit::IDBDatabaseCallbacksProxy::onComplete):
      * src/IDBDatabaseCallbacksProxy.h:
      (IDBDatabaseCallbacksProxy):
      * src/IDBFactoryBackendProxy.cpp:
      (WebKit::IDBFactoryBackendProxy::open):
      (WebKit):
      * src/IDBFactoryBackendProxy.h:
      (IDBFactoryBackendProxy):
      * src/WebIDBCallbacksImpl.cpp:
      (WebKit::WebIDBCallbacksImpl::onUpgradeNeeded):
      (WebKit):
      * src/WebIDBCallbacksImpl.h:
      (WebIDBCallbacksImpl):
      * src/WebIDBDatabaseCallbacksImpl.cpp:
      (WebKit::WebIDBDatabaseCallbacksImpl::onAbort):
      (WebKit):
      (WebKit::WebIDBDatabaseCallbacksImpl::onComplete):
      * src/WebIDBDatabaseCallbacksImpl.h:
      (WebIDBDatabaseCallbacksImpl):
      * src/WebIDBDatabaseImpl.cpp:
      (WebKit::WebIDBDatabaseImpl::createTransaction):
      (WebKit):
      (WebKit::WebIDBDatabaseImpl::abort):
      (WebKit::WebIDBDatabaseImpl::commit):
      * src/WebIDBDatabaseImpl.h:
      (WebIDBDatabaseImpl):
      * src/WebIDBFactoryImpl.cpp:
      (WebKit::WebIDBFactoryImpl::open):
      (WebKit):
      * src/WebIDBFactoryImpl.h:
      (WebIDBFactoryImpl):
      * tests/IDBAbortOnCorruptTest.cpp:
      * tests/IDBDatabaseBackendTest.cpp:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136714 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d653faa0
  20. 03 Dec, 2012 1 commit
    • jsbell@chromium.org's avatar
      IndexedDB: Rename exception enum members from UGLY_ERR to PrettyError · e9e60209
      jsbell@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=103759
      
      Reviewed by Darin Fisher.
      
      Source/WebCore:
      
      Now that IDBDatabaseException isn't exposed to script with constants, the exception types
      can be renamed to match the much friendlier names used in newer iterations of the spec. Also
      remove the legacy/unused types.
      
      No new tests, just constant renames.
      
      * Modules/indexeddb/IDBCursor.cpp:
      (WebCore::IDBCursor::update):
      (WebCore::IDBCursor::advance):
      (WebCore::IDBCursor::continueFunction):
      (WebCore::IDBCursor::deleteFunction):
      * Modules/indexeddb/IDBCursorBackendImpl.cpp:
      (WebCore::IDBCursorBackendImpl::continueFunction):
      (WebCore::IDBCursorBackendImpl::advance):
      (WebCore::IDBCursorBackendImpl::prefetchContinue):
      * Modules/indexeddb/IDBDatabase.cpp:
      (WebCore::IDBDatabase::createObjectStore):
      (WebCore::IDBDatabase::deleteObjectStore):
      (WebCore::IDBDatabase::transaction):
      * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
      (WebCore::IDBDatabaseBackendImpl::createObjectStore):
      (WebCore::IDBDatabaseBackendImpl::deleteObjectStore):
      (WebCore::IDBDatabaseBackendImpl::VersionChangeOperation::perform):
      (WebCore::IDBDatabaseBackendImpl::transactionFinishedAndAbortFired):
      (WebCore::IDBDatabaseBackendImpl::openConnection):
      (WebCore::IDBDatabaseBackendImpl::openConnectionWithVersion):
      (WebCore::IDBDatabaseBackendImpl::deleteDatabase):
      (WebCore::IDBDatabaseBackendImpl::close):
      * Modules/indexeddb/IDBDatabaseException.cpp: Tidying and renaming.
      (WebCore):
      (WebCore::getErrorEntry):
      * Modules/indexeddb/IDBDatabaseException.h:
      * Modules/indexeddb/IDBFactory.cpp:
      (WebCore::IDBFactory::cmp):
      * Modules/indexeddb/IDBFactoryBackendImpl.cpp:
      (WebCore::IDBFactoryBackendImpl::getDatabaseNames):
      (WebCore::IDBFactoryBackendImpl::deleteDatabase):
      (WebCore::IDBFactoryBackendImpl::open):
      * Modules/indexeddb/IDBIndex.cpp:
      (WebCore::IDBIndex::openCursor):
      (WebCore::IDBIndex::count):
      (WebCore::IDBIndex::openKeyCursor):
      (WebCore::IDBIndex::get):
      (WebCore::IDBIndex::getKey):
      * Modules/indexeddb/IDBIndexBackendImpl.cpp:
      (WebCore::IDBIndexBackendImpl::openCursor):
      (WebCore::IDBIndexBackendImpl::openKeyCursor):
      (WebCore::IDBIndexBackendImpl::count):
      (WebCore::IDBIndexBackendImpl::get):
      (WebCore::IDBIndexBackendImpl::getKey):
      * Modules/indexeddb/IDBKeyRange.cpp:
      (WebCore::IDBKeyRange::only):
      (WebCore::IDBKeyRange::lowerBound):
      (WebCore::IDBKeyRange::upperBound):
      (WebCore::IDBKeyRange::bound):
      * Modules/indexeddb/IDBObjectStore.cpp:
      (WebCore::IDBObjectStore::get):
      (WebCore::IDBObjectStore::put):
      (WebCore::IDBObjectStore::deleteFunction):
      (WebCore::IDBObjectStore::clear):
      (WebCore):
      (WebCore::IDBObjectStore::createIndex):
      (WebCore::IDBObjectStore::index):
      (WebCore::IDBObjectStore::deleteIndex):
      (WebCore::IDBObjectStore::openCursor):
      (WebCore::IDBObjectStore::count):
      * Modules/indexeddb/IDBObjectStoreBackendImpl.cpp:
      (WebCore::IDBObjectStoreBackendImpl::get):
      (WebCore::IDBObjectStoreBackendImpl::put):
      (WebCore):
      (WebCore::IDBObjectStoreBackendImpl::setIndexKeys):
      (WebCore::IDBObjectStoreBackendImpl::ObjectStoreStorageOperation::perform):
      (WebCore::IDBObjectStoreBackendImpl::deleteFunction):
      (WebCore::IDBObjectStoreBackendImpl::clear):
      (WebCore::IDBObjectStoreBackendImpl::createIndex):
      (WebCore::IDBObjectStoreBackendImpl::deleteIndex):
      (WebCore::IDBObjectStoreBackendImpl::openCursor):
      (WebCore::IDBObjectStoreBackendImpl::count):
      * Modules/indexeddb/IDBOpenDBRequest.cpp:
      (WebCore::IDBOpenDBRequest::dispatchEvent):
      * Modules/indexeddb/IDBRequest.cpp:
      (WebCore::IDBRequest::result):
      (WebCore::IDBRequest::error):
      (WebCore::IDBRequest::errorCode):
      (WebCore::IDBRequest::webkitErrorMessage):
      (WebCore::IDBRequest::abort):
      (WebCore::IDBRequest::dispatchEvent):
      (WebCore::IDBRequest::uncaughtExceptionInEventHandler):
      * Modules/indexeddb/IDBTransaction.cpp:
      (WebCore::IDBTransaction::objectStore):
      (WebCore::IDBTransaction::abort):
      * Modules/indexeddb/IDBTransactionBackendImpl.cpp:
      (WebCore::IDBTransactionBackendImpl::objectStore):
      (WebCore::IDBTransactionBackendImpl::abort):
      (WebCore::IDBTransactionBackendImpl::commit):
      
      Source/WebKit/chromium:
      
      Update IDBDatabaseException enum names/values to match WebCore.
      
      * public/WebIDBDatabaseException.h:
      * src/AssertMatchingEnums.cpp:
      * src/IDBFactoryBackendProxy.cpp:
      (WebKit::IDBFactoryBackendProxy::allowIndexedDB):
      * tests/IDBRequestTest.cpp:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136417 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e9e60209
  21. 14 Nov, 2012 1 commit
    • jsbell@chromium.org's avatar
      Rename NATIVE_TYPE_ERR to TypeError · 00c51d8c
      jsbell@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=102114
      
      Reviewed by Kentaro Hara.
      
      Defines names (mostly) matching WebIDL exception types for use by dom (etc) code.
      V8 binding code had colliding enum members, which required prefixing.
      
      No new tests - just internal renames.
      
      * Modules/indexeddb/IDBCursor.cpp: s/NATIVE_TYPE_ERR/TypeError/g
      (WebCore::IDBCursor::advance):
      (WebCore::IDBCursor::stringToDirection):
      (WebCore::IDBCursor::directionToString):
      * Modules/indexeddb/IDBDatabase.cpp: Ditto.
      (WebCore::IDBDatabase::setVersion):
      * Modules/indexeddb/IDBFactory.cpp: Ditto.
      (WebCore::IDBFactory::open):
      (WebCore::IDBFactory::openInternal):
      (WebCore::IDBFactory::deleteDatabase):
      * Modules/indexeddb/IDBObjectStore.cpp: Ditto.
      (WebCore::IDBObjectStore::createIndex):
      * Modules/indexeddb/IDBTransaction.cpp: Ditto.
      (WebCore::IDBTransaction::stringToMode):
      (WebCore::IDBTransaction::modeToString):
      * bindings/js/JSDOMBinding.cpp: Ditto.
      (WebCore::setDOMException):
      * bindings/v8/DateExtension.cpp: Prefix ErrorType enum/members w/ V8/v8.
      (WebCore::DateExtension::OnSleepDetected):
      * bindings/v8/NPV8Object.cpp: Ditto.
      (_NPN_SetException):
      * bindings/v8/V8Binding.cpp: Ditto.
      (WebCore::throwError):
      (WebCore::handleMaxRecursionDepthExceeded):
      * bindings/v8/V8Binding.h: Ditto.
      (WebCore):
      * bindings/v8/V8NPObject.cpp: Ditto.
      (WebCore::npObjectInvokeImpl):
      (WebCore::npObjectGetProperty):
      (WebCore::npObjectSetProperty):
      (WebCore::npObjectPropertyEnumerator):
      * bindings/v8/V8ThrowException.cpp: Rename ALL the errors!
      (WebCore::V8ThrowException::setDOMException):
      (WebCore::V8ThrowException::throwError):
      (WebCore::V8ThrowException::throwTypeError):
      (WebCore::V8ThrowException::throwNotEnoughArgumentsError):
      * bindings/v8/V8ThrowException.h:
      (V8ThrowException):
      * bindings/v8/WorkerContextExecutionProxy.cpp: Prefixing (continued)
      (WebCore::WorkerContextExecutionProxy::evaluate):
      * bindings/v8/custom/V8ArrayBufferCustom.cpp: Ditto.
      (WebCore::V8ArrayBuffer::constructorCallback):
      * bindings/v8/custom/V8ArrayBufferViewCustom.h: Ditto.
      (WebCore::constructWebGLArrayWithArrayBufferArgument):
      (WebCore::constructWebGLArray):
      (WebCore::setWebGLArrayHelper):
      * bindings/v8/custom/V8AudioContextCustom.cpp: Ditto.
      (WebCore::V8AudioContext::constructorCallback):
      * bindings/v8/custom/V8BlobCustom.cpp: Ditto.
      (WebCore::V8Blob::constructorCallback):
      * bindings/v8/custom/V8ClipboardCustom.cpp: Ditto.
      (WebCore::V8Clipboard::clearDataCallback):
      (WebCore::V8Clipboard::setDragImageCallback):
      * bindings/v8/custom/V8DOMFormDataCustom.cpp: Ditto.
      (WebCore::V8DOMFormData::appendCallback):
      * bindings/v8/custom/V8SQLResultSetRowListCustom.cpp: Ditto.
      (WebCore::V8SQLResultSetRowList::itemCallback):
      * dom/ExceptionCode.h: Add WebIDL exception types.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134646 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      00c51d8c
  22. 01 Nov, 2012 1 commit
    • alecflett@chromium.org's avatar
      IndexedDB: add methods to support id-based backend APIs · e33cc6bd
      alecflett@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=100425
      
      Reviewed by Tony Chang.
      
      Source/WebCore:
      
      First half of refactor involves adding a number of methods that
      are int64_t-based rather than String-based. As a part of this, the
      IDB*Metadata structs and the backend objectStore/index maps all
      use int64_t as keys, rather than String.
      
      In addition, there were a number of cleanups that came out of the
      refactor:
      
      - The list of object stores active in a transaction is now
        maintained by the frontend IDBTransaction rather than the backend
        IDBTransactionBackendImpl. This also had a simplifying rippling
        effect through other call signatures.
      
      - I was able to remove an apparently old FIXME from
        IDBTransactionBackendImpl::objectStore and replace it with an ASSERT.
      
      - IDBObjectStoreBackendImpl's IndexWriter class got a little
        simpler since the id is now easily available in the
        IDBIndexMetadata.
      
      - A number of methods got simpler in their int64_t versions,
        specifically dropping a number of ExceptionCodes.
      
      There is also some glue code
      (getIndexId/getIndexIds/getObjectStoreId) that will go away with
      the 2nd half of this: https://bugs.webkit.org/show_bug.cgi?id=100425
      
      No new tests, no new functionality as this is just a refactor.
      
      * Modules/indexeddb/IDBDatabase.cpp:
      (WebCore::IDBDatabase::objectStoreNames):
      (WebCore::IDBDatabase::createObjectStore):
      (WebCore::IDBDatabase::deleteObjectStore):
      (WebCore::IDBDatabase::transaction):
      * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
      (WebCore::IDBDatabaseBackendImpl::metadata):
      (WebCore::IDBDatabaseBackendImpl::createObjectStore):
      (WebCore::IDBDatabaseBackendImpl::objectStore):
      (WebCore::IDBDatabaseBackendImpl::getObjectStoreId):
      (WebCore):
      (WebCore::IDBDatabaseBackendImpl::deleteObjectStore):
      (WebCore::IDBDatabaseBackendImpl::transaction):
      (WebCore::IDBDatabaseBackendImpl::loadObjectStores):
      (WebCore::IDBDatabaseBackendImpl::removeObjectStoreFromMap):
      (WebCore::IDBDatabaseBackendImpl::addObjectStoreToMap):
      * Modules/indexeddb/IDBDatabaseBackendImpl.h:
      (WebCore::IDBDatabaseBackendImpl::deleteObjectStore):
      (IDBDatabaseBackendImpl):
      * Modules/indexeddb/IDBDatabaseBackendInterface.h:
      (IDBDatabaseBackendInterface):
      * Modules/indexeddb/IDBIndex.h:
      (WebCore::IDBIndex::id):
      (WebCore::IDBIndex::openKeyCursor):
      * Modules/indexeddb/IDBIndexBackendInterface.h:
      * Modules/indexeddb/IDBMetadata.h:
      (WebCore::IDBIndexMetadata::IDBIndexMetadata):
      (IDBIndexMetadata):
      (IDBObjectStoreMetadata):
      (WebCore::IDBObjectStoreMetadata::containsIndex):
      (IDBDatabaseMetadata):
      (WebCore::IDBDatabaseMetadata::IDBDatabaseMetadata):
      (WebCore::IDBDatabaseMetadata::containsObjectStore):
      * Modules/indexeddb/IDBObjectStore.cpp:
      (WebCore::IDBObjectStore::indexNames):
      (WebCore::IDBObjectStore::put):
      (WebCore::IDBObjectStore::createIndex):
      (WebCore::IDBObjectStore::index):
      (WebCore::IDBObjectStore::deleteIndex):
      * Modules/indexeddb/IDBObjectStoreBackendImpl.cpp:
      (WebCore::IDBObjectStoreBackendImpl::put):
      (WebCore::IDBObjectStoreBackendImpl::putWithIndexKeys):
      (WebCore):
      (WebCore::makeIndexWriters):
      (WebCore::IDBObjectStoreBackendImpl::setIndexKeys):
      (WebCore::IDBObjectStoreBackendImpl::setIndexesReady):
      (WebCore::IDBObjectStoreBackendImpl::setIndexesReadyInternal):
      (WebCore::IDBObjectStoreBackendImpl::putInternal):
      (WebCore::IDBObjectStoreBackendImpl::deleteInternal):
      (WebCore::IDBObjectStoreBackendImpl::createIndex):
      (WebCore::IDBObjectStoreBackendImpl::index):
      (WebCore::IDBObjectStoreBackendImpl::getIndexId):
      (WebCore::IDBObjectStoreBackendImpl::getIndexIds):
      (WebCore::IDBObjectStoreBackendImpl::deleteIndex):
      (WebCore::IDBObjectStoreBackendImpl::loadIndexes):
      (WebCore::IDBObjectStoreBackendImpl::removeIndexFromMap):
      (WebCore::IDBObjectStoreBackendImpl::addIndexToMap):
      * Modules/indexeddb/IDBObjectStoreBackendImpl.h:
      (IDBObjectStoreBackendImpl):
      * Modules/indexeddb/IDBObjectStoreBackendInterface.h:
      * Modules/indexeddb/IDBOpenDBRequest.cpp:
      (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
      * Modules/indexeddb/IDBRequest.cpp:
      (WebCore::IDBRequest::onSuccess):
      (WebCore::IDBRequest::uncaughtExceptionInEventHandler):
      * Modules/indexeddb/IDBTransaction.cpp:
      (WebCore::IDBTransaction::create):
      (WebCore::IDBTransaction::IDBTransaction):
      (WebCore::IDBTransaction::objectStore):
      * Modules/indexeddb/IDBTransaction.h:
      (IDBTransaction):
      * Modules/indexeddb/IDBTransactionBackendImpl.cpp:
      (WebCore::IDBTransactionBackendImpl::create):
      (WebCore::IDBTransactionBackendImpl::IDBTransactionBackendImpl):
      (WebCore::IDBTransactionBackendImpl::objectStore):
      (WebCore):
      (WebCore::IDBTransactionBackendImpl::scheduleTask):
      * Modules/indexeddb/IDBTransactionBackendImpl.h:
      (IDBTransactionBackendImpl):
      * Modules/indexeddb/IDBTransactionBackendInterface.h:
      
      Source/WebKit/chromium:
      
      Chromium Proxy and WebIDB* support for new int64_t-based methods.
      
      * public/WebIDBDatabase.h:
      (WebKit::WebIDBDatabase::deleteObjectStore):
      (WebKit::WebIDBDatabase::transaction):
      * public/WebIDBObjectStore.h:
      (WebKit::WebIDBObjectStore::put):
      (WebKit::WebIDBObjectStore::setIndexKeys):
      (WebKit::WebIDBObjectStore::setIndexesReady):
      (WebKit::WebIDBObjectStore::index):
      (WebKit::WebIDBObjectStore::deleteIndex):
      * public/WebIDBTransaction.h:
      (WebKit::WebIDBTransaction::objectStore):
      * src/IDBDatabaseBackendProxy.cpp:
      (WebKit::IDBDatabaseBackendProxy::deleteObjectStore):
      (WebKit):
      (WebKit::IDBDatabaseBackendProxy::transaction):
      * src/IDBDatabaseBackendProxy.h:
      (IDBDatabaseBackendProxy):
      * src/IDBObjectStoreBackendProxy.cpp:
      (WebKit::IDBObjectStoreBackendProxy::put):
      (WebKit):
      (WebKit::IDBObjectStoreBackendProxy::setIndexKeys):
      (WebKit::IDBObjectStoreBackendProxy::setIndexesReady):
      (WebKit::IDBObjectStoreBackendProxy::index):
      (WebKit::IDBObjectStoreBackendProxy::deleteIndex):
      * src/IDBObjectStoreBackendProxy.h:
      (IDBObjectStoreBackendProxy):
      * src/IDBTransactionBackendProxy.cpp:
      (WebKit::IDBTransactionBackendProxy::objectStore):
      * src/IDBTransactionBackendProxy.h:
      (IDBTransactionBackendProxy):
      * src/WebIDBMetadata.cpp:
      (WebKit::WebIDBMetadata::WebIDBMetadata):
      (WebKit::WebIDBMetadata::operator IDBDatabaseMetadata):
      * src/WebIDBTransactionImpl.cpp:
      (WebKit::WebIDBTransactionImpl::objectStore):
      (WebKit):
      * src/WebIDBTransactionImpl.h:
      * tests/IDBDatabaseBackendTest.cpp:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133195 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e33cc6bd
  23. 31 Oct, 2012 2 commits
    • senorblanco@chromium.org's avatar
      Unreviewed, rolling out r133107. · cde58494
      senorblanco@chromium.org authored
      http://trac.webkit.org/changeset/133107
      https://bugs.webkit.org/show_bug.cgi?id=100425
      
      Source/WebCore:
      
      Broke compile on Chromium Win.
      
      * Modules/indexeddb/IDBCallbacks.h:
      (IDBCallbacks):
      * Modules/indexeddb/IDBDatabase.cpp:
      (WebCore::IDBDatabase::objectStoreNames):
      (WebCore::IDBDatabase::createObjectStore):
      (WebCore::IDBDatabase::deleteObjectStore):
      (WebCore::IDBDatabase::transaction):
      * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
      (WebCore::IDBDatabaseBackendImpl::metadata):
      (WebCore::IDBDatabaseBackendImpl::createObjectStore):
      (WebCore::IDBDatabaseBackendImpl::objectStore):
      (WebCore::IDBDatabaseBackendImpl::deleteObjectStore):
      (WebCore::IDBDatabaseBackendImpl::transaction):
      (WebCore::IDBDatabaseBackendImpl::loadObjectStores):
      (WebCore::IDBDatabaseBackendImpl::removeObjectStoreFromMap):
      (WebCore::IDBDatabaseBackendImpl::addObjectStoreToMap):
      * Modules/indexeddb/IDBDatabaseBackendImpl.h:
      (IDBDatabaseBackendImpl):
      * Modules/indexeddb/IDBDatabaseBackendInterface.h:
      (IDBDatabaseBackendInterface):
      * Modules/indexeddb/IDBFactory.cpp:
      * Modules/indexeddb/IDBFactory.h:
      * Modules/indexeddb/IDBIndex.h:
      (WebCore::IDBIndex::openKeyCursor):
      * Modules/indexeddb/IDBIndexBackendInterface.h:
      * Modules/indexeddb/IDBKeyPath.cpp:
      * Modules/indexeddb/IDBMetadata.h:
      (WebCore):
      (IDBDatabaseMetadata):
      (WebCore::IDBDatabaseMetadata::IDBDatabaseMetadata):
      (IDBObjectStoreMetadata):
      (WebCore::IDBIndexMetadata::IDBIndexMetadata):
      (IDBIndexMetadata):
      * Modules/indexeddb/IDBObjectStore.cpp:
      (WebCore::IDBObjectStore::indexNames):
      (WebCore::IDBObjectStore::put):
      (WebCore::IDBObjectStore::createIndex):
      (WebCore::IDBObjectStore::index):
      (WebCore::IDBObjectStore::deleteIndex):
      * Modules/indexeddb/IDBObjectStoreBackendImpl.cpp:
      (WebCore::IDBObjectStoreBackendImpl::putWithIndexKeys):
      (WebCore):
      (WebCore::makeIndexWriters):
      (WebCore::IDBObjectStoreBackendImpl::setIndexKeys):
      (WebCore::IDBObjectStoreBackendImpl::setIndexesReady):
      (WebCore::IDBObjectStoreBackendImpl::setIndexesReadyInternal):
      (WebCore::IDBObjectStoreBackendImpl::putInternal):
      (WebCore::IDBObjectStoreBackendImpl::deleteInternal):
      (WebCore::IDBObjectStoreBackendImpl::createIndex):
      (WebCore::IDBObjectStoreBackendImpl::index):
      (WebCore::IDBObjectStoreBackendImpl::deleteIndex):
      (WebCore::IDBObjectStoreBackendImpl::loadIndexes):
      (WebCore::IDBObjectStoreBackendImpl::removeIndexFromMap):
      (WebCore::IDBObjectStoreBackendImpl::addIndexToMap):
      * Modules/indexeddb/IDBObjectStoreBackendImpl.h:
      (IDBObjectStoreBackendImpl):
      * Modules/indexeddb/IDBObjectStoreBackendInterface.h:
      * Modules/indexeddb/IDBOpenDBRequest.cpp:
      (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
      * Modules/indexeddb/IDBRequest.cpp:
      (WebCore::IDBRequest::onSuccess):
      (WebCore::IDBRequest::uncaughtExceptionInEventHandler):
      * Modules/indexeddb/IDBTransaction.cpp:
      (WebCore::IDBTransaction::create):
      (WebCore::IDBTransaction::IDBTransaction):
      (WebCore::IDBTransaction::objectStore):
      * Modules/indexeddb/IDBTransaction.h:
      (IDBTransaction):
      * Modules/indexeddb/IDBTransactionBackendImpl.cpp:
      (WebCore::IDBTransactionBackendImpl::create):
      (WebCore::IDBTransactionBackendImpl::IDBTransactionBackendImpl):
      (WebCore::IDBTransactionBackendImpl::objectStore):
      (WebCore::IDBTransactionBackendImpl::scheduleTask):
      * Modules/indexeddb/IDBTransactionBackendImpl.h:
      (IDBTransactionBackendImpl):
      * Modules/indexeddb/IDBTransactionBackendInterface.h:
      * Modules/indexeddb/IDBTransactionCoordinator.h:
      
      Source/WebKit/chromium:
      
      Broke compile on Chromium Win
      
      * public/WebIDBDatabase.h:
      (WebKit::WebIDBDatabase::transaction):
      * public/WebIDBObjectStore.h:
      (WebKit::WebIDBObjectStore::index):
      * public/WebIDBTransaction.h:
      (WebKit::WebIDBTransaction::objectStore):
      * src/IDBDatabaseBackendProxy.cpp:
      * src/IDBDatabaseBackendProxy.h:
      (IDBDatabaseBackendProxy):
      * src/IDBObjectStoreBackendProxy.cpp:
      (WebKit::IDBObjectStoreBackendProxy::setIndexesReady):
      * src/IDBObjectStoreBackendProxy.h:
      (IDBObjectStoreBackendProxy):
      * src/IDBTransactionBackendProxy.cpp:
      * src/IDBTransactionBackendProxy.h:
      (IDBTransactionBackendProxy):
      * src/WebIDBCallbacksImpl.cpp:
      * src/WebIDBDatabaseImpl.cpp:
      * src/WebIDBDatabaseImpl.h:
      (WebIDBDatabaseImpl):
      * src/WebIDBMetadata.cpp:
      (WebKit::WebIDBMetadata::WebIDBMetadata):
      (WebKit::WebIDBMetadata::operator IDBDatabaseMetadata):
      * src/WebIDBObjectStoreImpl.cpp:
      * src/WebIDBObjectStoreImpl.h:
      (WebIDBObjectStoreImpl):
      * src/WebIDBTransactionImpl.cpp:
      * src/WebIDBTransactionImpl.h:
      * tests/IDBDatabaseBackendTest.cpp:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133112 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      cde58494
    • alecflett@chromium.org's avatar
      IndexedDB: add methods to support id-based backend APIs · 2d73ecdb
      alecflett@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=100425
      
      Reviewed by Tony Chang.
      
      Source/WebCore:
      
      First half of refactor involves adding a number of methods that
      are int64_t-based rather than String-based. As a part of this, the
      IDB*Metadata structs and the backend objectStore/index maps all
      use int64_t as keys, rather than String.
      
      In addition, there were a number of cleanups that came out of the
      refactor:
      
      - The list of object stores active in a transaction is now
        maintained by the frontend IDBTransaction rather than the backend
        IDBTransactionBackendImpl. This also had a simplifying rippling
        effect through other call signatures.
      
      - I was able to remove an apparently old FIXME from
        IDBTransactionBackendImpl::objectStore and replace it with an ASSERT.
      
      - IDBObjectStoreBackendImpl's IndexWriter class got a little
        simpler since the id is now easily available in the
        IDBIndexMetadata.
      
      - A number of methods got simpler in their int64_t versions,
        specifically dropping a number of ExceptionCodes.
      
      There is also some glue code
      (getIndexId/getIndexIds/getObjectStoreId) that will go away with
      the 2nd half of this: https://bugs.webkit.org/show_bug.cgi?id=100425
      
      No new tests, no new functionality as this is just a refactor.
      
      * Modules/indexeddb/IDBDatabase.cpp:
      (WebCore::IDBDatabase::objectStoreNames):
      (WebCore::IDBDatabase::createObjectStore):
      (WebCore::IDBDatabase::deleteObjectStore):
      (WebCore::IDBDatabase::transaction):
      * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
      (WebCore::IDBDatabaseBackendImpl::metadata):
      (WebCore::IDBDatabaseBackendImpl::createObjectStore):
      (WebCore::IDBDatabaseBackendImpl::objectStore):
      (WebCore::IDBDatabaseBackendImpl::getObjectStoreId):
      (WebCore):
      (WebCore::IDBDatabaseBackendImpl::deleteObjectStore):
      (WebCore::IDBDatabaseBackendImpl::transaction):
      (WebCore::IDBDatabaseBackendImpl::loadObjectStores):
      (WebCore::IDBDatabaseBackendImpl::removeObjectStoreFromMap):
      (WebCore::IDBDatabaseBackendImpl::addObjectStoreToMap):
      * Modules/indexeddb/IDBDatabaseBackendImpl.h:
      (WebCore::IDBDatabaseBackendImpl::deleteObjectStore):
      (IDBDatabaseBackendImpl):
      * Modules/indexeddb/IDBDatabaseBackendInterface.h:
      (IDBDatabaseBackendInterface):
      * Modules/indexeddb/IDBIndex.h:
      (WebCore::IDBIndex::id):
      (WebCore::IDBIndex::openKeyCursor):
      * Modules/indexeddb/IDBIndexBackendInterface.h:
      * Modules/indexeddb/IDBMetadata.h:
      (WebCore::IDBIndexMetadata::IDBIndexMetadata):
      (IDBIndexMetadata):
      (IDBObjectStoreMetadata):
      (WebCore::IDBObjectStoreMetadata::containsIndex):
      (IDBDatabaseMetadata):
      (WebCore::IDBDatabaseMetadata::IDBDatabaseMetadata):
      (WebCore::IDBDatabaseMetadata::containsObjectStore):
      * Modules/indexeddb/IDBObjectStore.cpp:
      (WebCore::IDBObjectStore::indexNames):
      (WebCore::IDBObjectStore::put):
      (WebCore::IDBObjectStore::createIndex):
      (WebCore::IDBObjectStore::index):
      (WebCore::IDBObjectStore::deleteIndex):
      * Modules/indexeddb/IDBObjectStoreBackendImpl.cpp:
      (WebCore::IDBObjectStoreBackendImpl::put):
      (WebCore::IDBObjectStoreBackendImpl::putWithIndexKeys):
      (WebCore):
      (WebCore::makeIndexWriters):
      (WebCore::IDBObjectStoreBackendImpl::setIndexKeys):
      (WebCore::IDBObjectStoreBackendImpl::setIndexesReady):
      (WebCore::IDBObjectStoreBackendImpl::setIndexesReadyInternal):
      (WebCore::IDBObjectStoreBackendImpl::putInternal):
      (WebCore::IDBObjectStoreBackendImpl::deleteInternal):
      (WebCore::IDBObjectStoreBackendImpl::createIndex):
      (WebCore::IDBObjectStoreBackendImpl::index):
      (WebCore::IDBObjectStoreBackendImpl::getIndexId):
      (WebCore::IDBObjectStoreBackendImpl::getIndexIds):
      (WebCore::IDBObjectStoreBackendImpl::deleteIndex):
      (WebCore::IDBObjectStoreBackendImpl::loadIndexes):
      (WebCore::IDBObjectStoreBackendImpl::removeIndexFromMap):
      (WebCore::IDBObjectStoreBackendImpl::addIndexToMap):
      * Modules/indexeddb/IDBObjectStoreBackendImpl.h:
      (IDBObjectStoreBackendImpl):
      * Modules/indexeddb/IDBObjectStoreBackendInterface.h:
      * Modules/indexeddb/IDBOpenDBRequest.cpp:
      (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
      * Modules/indexeddb/IDBRequest.cpp:
      (WebCore::IDBRequest::onSuccess):
      (WebCore::IDBRequest::uncaughtExceptionInEventHandler):
      * Modules/indexeddb/IDBTransaction.cpp:
      (WebCore::IDBTransaction::create):
      (WebCore::IDBTransaction::IDBTransaction):
      (WebCore::IDBTransaction::objectStore):
      * Modules/indexeddb/IDBTransaction.h:
      (IDBTransaction):
      * Modules/indexeddb/IDBTransactionBackendImpl.cpp:
      (WebCore::IDBTransactionBackendImpl::create):
      (WebCore::IDBTransactionBackendImpl::IDBTransactionBackendImpl):
      (WebCore::IDBTransactionBackendImpl::objectStore):
      (WebCore):
      (WebCore::IDBTransactionBackendImpl::scheduleTask):
      * Modules/indexeddb/IDBTransactionBackendImpl.h:
      (IDBTransactionBackendImpl):
      * Modules/indexeddb/IDBTransactionBackendInterface.h:
      
      Source/WebKit/chromium:
      
      Chromium Proxy and WebIDB* support for new int64_t-based methods.
      
      * public/WebIDBDatabase.h:
      (WebKit::WebIDBDatabase::deleteObjectStore):
      (WebKit::WebIDBDatabase::transaction):
      * public/WebIDBObjectStore.h:
      (WebKit::WebIDBObjectStore::put):
      (WebKit::WebIDBObjectStore::setIndexKeys):
      (WebKit::WebIDBObjectStore::setIndexesReady):
      (WebKit::WebIDBObjectStore::index):
      (WebKit::WebIDBObjectStore::deleteIndex):
      * public/WebIDBTransaction.h:
      (WebKit::WebIDBTransaction::objectStore):
      * src/IDBDatabaseBackendProxy.cpp:
      (WebKit::IDBDatabaseBackendProxy::deleteObjectStore):
      (WebKit):
      (WebKit::IDBDatabaseBackendProxy::transaction):
      * src/IDBDatabaseBackendProxy.h:
      (IDBDatabaseBackendProxy):
      * src/IDBObjectStoreBackendProxy.cpp:
      (WebKit::IDBObjectStoreBackendProxy::put):
      (WebKit):
      (WebKit::IDBObjectStoreBackendProxy::setIndexKeys):
      (WebKit::IDBObjectStoreBackendProxy::setIndexesReady):
      (WebKit::IDBObjectStoreBackendProxy::index):
      (WebKit::IDBObjectStoreBackendProxy::deleteIndex):
      * src/IDBObjectStoreBackendProxy.h:
      (IDBObjectStoreBackendProxy):
      * src/IDBTransactionBackendProxy.cpp:
      (WebKit::IDBTransactionBackendProxy::objectStore):
      * src/IDBTransactionBackendProxy.h:
      (IDBTransactionBackendProxy):
      * src/WebIDBMetadata.cpp:
      (WebKit::WebIDBMetadata::WebIDBMetadata):
      (WebKit::WebIDBMetadata::operator IDBDatabaseMetadata):
      * src/WebIDBTransactionImpl.cpp:
      (WebKit::WebIDBTransactionImpl::objectStore):
      (WebKit):
      * src/WebIDBTransactionImpl.h:
      * tests/IDBDatabaseBackendTest.cpp:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133107 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      2d73ecdb
  24. 17 Oct, 2012 1 commit
    • jsbell@chromium.org's avatar
      IndexedDB: Enforce unsigned long/unsigned long long ranges · 9a777932
      jsbell@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=99637
      
      Reviewed by Tony Chang.
      
      Source/WebCore:
      
      The IndexedDB spec has [EnforceRange] specified on unsigned long and unsigned long long
      arguments, which requires the implementation to throw TypeError for negative values or
      values that exceed 2^53-1 (maximum JS number that behaves like an integer) - and 0 is
      specifically forbidden by the APIs as well.
      
      A more correct fix in the binding layer is in webkit.org/b/96798 but we can temporarily
      address this in the implementation.
      
      Also refactor to prevent IDBFactory.open(name, -1) from triggering an internal code path.
      
      Tests: storage/indexeddb/cursor-advance.html
             storage/indexeddb/intversion-bad-parameters.html
             storage/indexeddb/intversion-encoding.html
      
      * Modules/indexeddb/IDBCursor.cpp:
      (WebCore::IDBCursor::advance): Validate argument range.
      * Modules/indexeddb/IDBCursor.h:
      (IDBCursor):
      * Modules/indexeddb/IDBCursor.idl: Drop "unsigned" qualifier as the binding code is
      not yet doing the correct validation.
      * Modules/indexeddb/IDBFactory.cpp: Refactor to prevent open(name, -1)
      (WebCore):
      (WebCore::IDBFactory::open): Validate the int version here, then pass to...
      (WebCore::IDBFactory::openInternal): ... this method.
      * Modules/indexeddb/IDBFactory.h:
      (IDBFactory):
      * Modules/indexeddb/IDBFactory.idl: Drop "unsigned" qualifier; meaningless to binding
      code right now, can be re-added once webkit.org/b/96798 lands.
      
      LayoutTests:
      
      Additional edge case tests and updated expectations.
      
      * storage/indexeddb/cursor-advance-expected.txt:
      * storage/indexeddb/intversion-bad-parameters-expected.txt:
      * storage/indexeddb/intversion-encoding-expected.txt:
      * storage/indexeddb/resources/cursor-advance.js:
      (testBadAdvance.advanceBadly):
      (testBadAdvance):
      * storage/indexeddb/resources/intversion-bad-parameters.js:
      (deleteSuccess):
      * storage/indexeddb/resources/intversion-encoding.js:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131658 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      9a777932
  25. 13 Sep, 2012 3 commits
    • jsbell@chromium.org's avatar
      IndexedDB: Consolidate two-phase connection to avoid race conditions · cfcf5953
      jsbell@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=90411
      
      Reviewed by Tony Chang.
      
      Source/WebCore:
      
      Previously, IDB connections were opened by having the front-end (1) call through to
      a back-end open() method, eventually receive a success message with a back-end object
      handle, and (2) call into the back-end object to register front-end callbacks. This left
      the back-end's notion of an open connection in a limbo state between these two calls.
      In multi-process ports, a crash of the front-end process could leave the back-end wedged
      waiting for this second call (e.g. can't delete until all connections are closed).
      
      Simplify this by having the front-end pass through the callbacks into the back-end
      during the initial open() call, which eliminates the limbo state.
      
      No new tests - no functional changes. Chromium port's webkit_unit_tests updated.
      
      * Modules/indexeddb/IDBDatabase.cpp:
      (WebCore::IDBDatabase::create):
      (WebCore::IDBDatabase::IDBDatabase): Db-callbacks is available at creation time.
      (WebCore::IDBDatabase::~IDBDatabase):
      * Modules/indexeddb/IDBDatabase.h:
      (IDBDatabase):
      * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
      (WebCore::IDBDatabaseBackendImpl::PendingOpenCall::create): Need to track db-callbacks as well.
      (WebCore::IDBDatabaseBackendImpl::PendingOpenCall::databaseCallbacks):
      (WebCore::IDBDatabaseBackendImpl::PendingOpenCall::PendingOpenCall):
      (IDBDatabaseBackendImpl::PendingOpenCall):
      (WebCore::IDBDatabaseBackendImpl::PendingOpenWithVersionCall::create): Ditto.
      (WebCore::IDBDatabaseBackendImpl::PendingOpenWithVersionCall::databaseCallbacks):
      (WebCore::IDBDatabaseBackendImpl::PendingOpenWithVersionCall::PendingOpenWithVersionCall):
      (IDBDatabaseBackendImpl::PendingOpenWithVersionCall):
      (WebCore::IDBDatabaseBackendImpl::IDBDatabaseBackendImpl):
      (WebCore::IDBDatabaseBackendImpl::setVersion):
      (WebCore::IDBDatabaseBackendImpl::connectionCount): Don't need to count limbo connections any more.
      (WebCore::IDBDatabaseBackendImpl::processPendingCalls): Pass through db-callbacks.
      (WebCore::IDBDatabaseBackendImpl::openConnection): No more limbo connections (yay!).
      (WebCore::IDBDatabaseBackendImpl::runIntVersionChangeTransaction): Pass through db-callbacks.
      (WebCore::IDBDatabaseBackendImpl::openConnectionWithVersion): Ditto.
      (WebCore::IDBDatabaseBackendImpl::deleteDatabase): Style.
      (WebCore::IDBDatabaseBackendImpl::close): Resolve FIXME about connectionCount.
      * Modules/indexeddb/IDBDatabaseBackendImpl.h:
      (IDBDatabaseBackendImpl):
      * Modules/indexeddb/IDBDatabaseBackendInterface.h:
      (IDBDatabaseBackendInterface):
      * Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp:
      (WebCore::IDBDatabaseCallbacksImpl::create):
      (WebCore::IDBDatabaseCallbacksImpl::IDBDatabaseCallbacksImpl):
      (WebCore::IDBDatabaseCallbacksImpl::connect):
      * Modules/indexeddb/IDBDatabaseCallbacksImpl.h:
      (IDBDatabaseCallbacksImpl):
      * Modules/indexeddb/IDBFactory.cpp:
      (WebCore::IDBFactory::open): Mint the db-callbacks here...
      * Modules/indexeddb/IDBFactoryBackendImpl.cpp:
      (WebCore::IDBFactoryBackendImpl::open): ...passed through to here...
      * Modules/indexeddb/IDBFactoryBackendImpl.h:
      (IDBFactoryBackendImpl):
      * Modules/indexeddb/IDBFactoryBackendInterface.h:
      (IDBFactoryBackendInterface):
      * Modules/indexeddb/IDBOpenDBRequest.cpp:
      (WebCore::IDBOpenDBRequest::create): ...all the way to here...
      (WebCore::IDBOpenDBRequest::IDBOpenDBRequest):
      (WebCore::IDBOpenDBRequest::onUpgradeNeeded): ...and finally hooked up here.
      (WebCore::IDBOpenDBRequest::onSuccess): (or here, if no upgrade needed).
      * Modules/indexeddb/IDBOpenDBRequest.h:
      (WebCore):
      (IDBOpenDBRequest):
      * Modules/indexeddb/IDBTransaction.cpp:
      (WebCore::IDBTransaction::onAbort): Tweak event/notification ordering; the
      notifying the database that the transaction is finished may unblock closing,
      which fires more events, and the delivery matters. Previously the close would
      be blocked by the transaction which gave the desired order.
      (WebCore::IDBTransaction::onComplete): Ditto.
      * inspector/InspectorIndexedDBAgent.cpp: New hookup logic.
      (WebCore):
      
      Source/WebKit/chromium:
      
      API plumbing for simplified single-phase connection opening, and tests updated
      to exercise the new APIs.
      
      * public/WebIDBDatabase.h:
      (WebIDBDatabase): Just a FIXME to remove the old second-phase hookup API.
      * public/WebIDBFactory.h:
      (WebKit):
      (WebIDBFactory):
      (WebKit::WebIDBFactory::open): New overload that takes db-callbacks.
      * src/IDBCallbacksProxy.cpp: The db-callbacks plumbing is needed earlier.
      (WebKit::IDBCallbacksProxy::onSuccess):
      (WebKit::IDBCallbacksProxy::onUpgradeNeeded):
      (WebKit):
      (WebKit::IDBCallbacksProxy::setDatabaseCallbacks): Needs to hold on to
      the db-callbacks and hook it up when the onSuccess callback comes through.
      * src/IDBCallbacksProxy.h:
      (WebKit):
      (IDBCallbacksProxy):
      * src/IDBDatabaseBackendProxy.cpp:
      * src/IDBDatabaseBackendProxy.h:
      (IDBDatabaseBackendProxy):
      * src/IDBFactoryBackendProxy.cpp:
      (WebKit::IDBFactoryBackendProxy::open):
      * src/IDBFactoryBackendProxy.h:
      (IDBFactoryBackendProxy):
      * src/WebIDBDatabaseImpl.cpp:
      (WebKit::WebIDBDatabaseImpl::WebIDBDatabaseImpl):
      (WebKit::WebIDBDatabaseImpl::close):
      * src/WebIDBDatabaseImpl.h:
      (WebIDBDatabaseImpl):
      * src/WebIDBFactoryImpl.cpp:
      (WebKit::WebIDBFactoryImpl::open):
      * src/WebIDBFactoryImpl.h:
      (WebIDBFactoryImpl):
      * tests/IDBAbortOnCorruptTest.cpp:
      (FakeIDBDatabaseCallbacks):
      (WebCore::FakeIDBDatabaseCallbacks::create):
      (WebCore::FakeIDBDatabaseCallbacks::~FakeIDBDatabaseCallbacks):
      (WebCore::FakeIDBDatabaseCallbacks::FakeIDBDatabaseCallbacks):
      (WebCore):
      (WebCore::TEST): Updated connection sequence.
      * tests/IDBDatabaseBackendTest.cpp: Ditto.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128533 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      cfcf5953
    • commit-queue@webkit.org's avatar
      Unreviewed, rolling out r128489. · 2fe19b24
      commit-queue@webkit.org authored
      http://trac.webkit.org/changeset/128489
      https://bugs.webkit.org/show_bug.cgi?id=96686
      
      Does not compile on windows (Requested by jamesr on #webkit).
      
      Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-09-13
      
      Source/WebCore:
      
      * Modules/indexeddb/IDBDatabase.cpp:
      (WebCore::IDBDatabase::create):
      (WebCore::IDBDatabase::IDBDatabase):
      (WebCore::IDBDatabase::~IDBDatabase):
      (WebCore::IDBDatabase::registerFrontendCallbacks):
      (WebCore):
      * Modules/indexeddb/IDBDatabase.h:
      (IDBDatabase):
      * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
      (WebCore::IDBDatabaseBackendImpl::PendingOpenCall::create):
      (WebCore::IDBDatabaseBackendImpl::PendingOpenCall::PendingOpenCall):
      (IDBDatabaseBackendImpl::PendingOpenCall):
      (WebCore::IDBDatabaseBackendImpl::PendingOpenWithVersionCall::create):
      (WebCore::IDBDatabaseBackendImpl::PendingOpenWithVersionCall::PendingOpenWithVersionCall):
      (WebCore::IDBDatabaseBackendImpl::IDBDatabaseBackendImpl):
      (WebCore::IDBDatabaseBackendImpl::setVersion):
      (WebCore::IDBDatabaseBackendImpl::connectionCount):
      (WebCore::IDBDatabaseBackendImpl::processPendingCalls):
      (WebCore::IDBDatabaseBackendImpl::registerFrontendCallbacks):
      (WebCore):
      (WebCore::IDBDatabaseBackendImpl::openConnection):
      (WebCore::IDBDatabaseBackendImpl::runIntVersionChangeTransaction):
      (WebCore::IDBDatabaseBackendImpl::openConnectionWithVersion):
      (WebCore::IDBDatabaseBackendImpl::deleteDatabase):
      (WebCore::IDBDatabaseBackendImpl::close):
      * Modules/indexeddb/IDBDatabaseBackendImpl.h:
      (IDBDatabaseBackendImpl):
      * Modules/indexeddb/IDBDatabaseBackendInterface.h:
      (IDBDatabaseBackendInterface):
      * Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp:
      (WebCore::IDBDatabaseCallbacksImpl::create):
      (WebCore::IDBDatabaseCallbacksImpl::IDBDatabaseCallbacksImpl):
      (WebCore::IDBDatabaseCallbacksImpl::unregisterDatabase):
      * Modules/indexeddb/IDBDatabaseCallbacksImpl.h:
      (IDBDatabaseCallbacksImpl):
      * Modules/indexeddb/IDBFactory.cpp:
      (WebCore::IDBFactory::open):
      * Modules/indexeddb/IDBFactoryBackendImpl.cpp:
      (WebCore::IDBFactoryBackendImpl::open):
      * Modules/indexeddb/IDBFactoryBackendImpl.h:
      (IDBFactoryBackendImpl):
      * Modules/indexeddb/IDBFactoryBackendInterface.h:
      (IDBFactoryBackendInterface):
      * Modules/indexeddb/IDBOpenDBRequest.cpp:
      (WebCore::IDBOpenDBRequest::create):
      (WebCore::IDBOpenDBRequest::IDBOpenDBRequest):
      (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
      (WebCore::IDBOpenDBRequest::onSuccess):
      * Modules/indexeddb/IDBOpenDBRequest.h:
      (IDBOpenDBRequest):
      * Modules/indexeddb/IDBTransaction.cpp:
      (WebCore::IDBTransaction::onAbort):
      (WebCore::IDBTransaction::onComplete):
      * inspector/InspectorIndexedDBAgent.cpp:
      (WebCore):
      
      Source/WebKit/chromium:
      
      * public/WebIDBDatabase.h:
      * public/WebIDBFactory.h:
      (WebIDBFactory):
      * src/IDBCallbacksProxy.cpp:
      (WebKit::IDBCallbacksProxy::onSuccess):
      (WebKit::IDBCallbacksProxy::onUpgradeNeeded):
      * src/IDBCallbacksProxy.h:
      (WebKit):
      (IDBCallbacksProxy):
      * src/IDBDatabaseBackendProxy.cpp:
      (WebKit::IDBDatabaseBackendProxy::registerFrontendCallbacks):
      (WebKit):
      * src/IDBDatabaseBackendProxy.h:
      (IDBDatabaseBackendProxy):
      * src/IDBFactoryBackendProxy.cpp:
      (WebKit::IDBFactoryBackendProxy::open):
      * src/IDBFactoryBackendProxy.h:
      (IDBFactoryBackendProxy):
      * src/WebIDBDatabaseImpl.cpp:
      (WebKit::WebIDBDatabaseImpl::WebIDBDatabaseImpl):
      (WebKit::WebIDBDatabaseImpl::close):
      (WebKit::WebIDBDatabaseImpl::open):
      (WebKit):
      * src/WebIDBDatabaseImpl.h:
      (WebIDBDatabaseImpl):
      * src/WebIDBFactoryImpl.cpp:
      (WebKit::WebIDBFactoryImpl::open):
      * src/WebIDBFactoryImpl.h:
      (WebIDBFactoryImpl):
      * tests/IDBAbortOnCorruptTest.cpp:
      (WebCore::TEST):
      * tests/IDBDatabaseBackendTest.cpp:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128496 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      2fe19b24
    • jsbell@chromium.org's avatar
      IndexedDB: Consolidate two-phase connection to avoid race conditions · 6bbf86d1
      jsbell@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=90411
      
      Reviewed by Tony Chang.
      
      Source/WebCore:
      
      Previously, IDB connections were opened by having the front-end (1) call through to
      a back-end open() method, eventually receive a success message with a back-end object
      handle, and (2) call into the back-end object to register front-end callbacks. This left
      the back-end's notion of an open connection in a limbo state between these two calls.
      In multi-process ports, a crash of the front-end process could leave the back-end wedged
      waiting for this second call (e.g. can't delete until all connections are closed).
      
      Simplify this by having the front-end pass through the callbacks into the back-end
      during the initial open() call, which eliminates the limbo state.
      
      No new tests - no functional changes. Chromium port's webkit_unit_tests updated.
      
      * Modules/indexeddb/IDBDatabase.cpp:
      (WebCore::IDBDatabase::create):
      (WebCore::IDBDatabase::IDBDatabase): Db-callbacks is available at creation time.
      (WebCore::IDBDatabase::~IDBDatabase):
      * Modules/indexeddb/IDBDatabase.h:
      (IDBDatabase):
      * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
      (WebCore::IDBDatabaseBackendImpl::PendingOpenCall::create): Need to track db-callbacks as well.
      (WebCore::IDBDatabaseBackendImpl::PendingOpenCall::databaseCallbacks):
      (WebCore::IDBDatabaseBackendImpl::PendingOpenCall::PendingOpenCall):
      (IDBDatabaseBackendImpl::PendingOpenCall):
      (WebCore::IDBDatabaseBackendImpl::PendingOpenWithVersionCall::create): Ditto.
      (WebCore::IDBDatabaseBackendImpl::PendingOpenWithVersionCall::databaseCallbacks):
      (WebCore::IDBDatabaseBackendImpl::PendingOpenWithVersionCall::PendingOpenWithVersionCall):
      (IDBDatabaseBackendImpl::PendingOpenWithVersionCall):
      (WebCore::IDBDatabaseBackendImpl::IDBDatabaseBackendImpl):
      (WebCore::IDBDatabaseBackendImpl::setVersion):
      (WebCore::IDBDatabaseBackendImpl::connectionCount): Don't need to count limbo connections any more.
      (WebCore::IDBDatabaseBackendImpl::processPendingCalls): Pass through db-callbacks.
      (WebCore::IDBDatabaseBackendImpl::openConnection): No more limbo connections (yay!).
      (WebCore::IDBDatabaseBackendImpl::runIntVersionChangeTransaction): Pass through db-callbacks.
      (WebCore::IDBDatabaseBackendImpl::openConnectionWithVersion): Ditto.
      (WebCore::IDBDatabaseBackendImpl::deleteDatabase): Style.
      (WebCore::IDBDatabaseBackendImpl::close): Resolve FIXME about connectionCount.
      * Modules/indexeddb/IDBDatabaseBackendImpl.h:
      (IDBDatabaseBackendImpl):
      * Modules/indexeddb/IDBDatabaseBackendInterface.h:
      (IDBDatabaseBackendInterface):
      * Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp:
      (WebCore::IDBDatabaseCallbacksImpl::create):
      (WebCore::IDBDatabaseCallbacksImpl::IDBDatabaseCallbacksImpl):
      (WebCore::IDBDatabaseCallbacksImpl::connect):
      * Modules/indexeddb/IDBDatabaseCallbacksImpl.h:
      (IDBDatabaseCallbacksImpl):
      * Modules/indexeddb/IDBFactory.cpp:
      (WebCore::IDBFactory::open): Mint the db-callbacks here...
      * Modules/indexeddb/IDBFactoryBackendImpl.cpp:
      (WebCore::IDBFactoryBackendImpl::open): ...passed through to here...
      * Modules/indexeddb/IDBFactoryBackendImpl.h:
      (IDBFactoryBackendImpl):
      * Modules/indexeddb/IDBFactoryBackendInterface.h:
      (IDBFactoryBackendInterface):
      * Modules/indexeddb/IDBOpenDBRequest.cpp:
      (WebCore::IDBOpenDBRequest::create): ...all the way to here...
      (WebCore::IDBOpenDBRequest::IDBOpenDBRequest):
      (WebCore::IDBOpenDBRequest::onUpgradeNeeded): ...and finally hooked up here.
      (WebCore::IDBOpenDBRequest::onSuccess): (or here, if no upgrade needed).
      * Modules/indexeddb/IDBOpenDBRequest.h:
      (WebCore):
      (IDBOpenDBRequest):
      * Modules/indexeddb/IDBTransaction.cpp:
      (WebCore::IDBTransaction::onAbort): Tweak event/notification ordering; the
      notifying the database that the transaction is finished may unblock closing,
      which fires more events, and the delivery matters. Previously the close would
      be blocked by the transaction which gave the desired order.
      (WebCore::IDBTransaction::onComplete): Ditto.
      * inspector/InspectorIndexedDBAgent.cpp: New hookup logic.
      (WebCore):
      
      Source/WebKit/chromium:
      
      API plumbing for simplified single-phase connection opening, and tests updated
      to exercise the new APIs.
      
      * public/WebIDBDatabase.h:
      (WebIDBDatabase): Just a FIXME to remove the old second-phase hookup API.
      * public/WebIDBFactory.h:
      (WebKit):
      (WebIDBFactory):
      (WebKit::WebIDBFactory::open): New overload that takes db-callbacks.
      * src/IDBCallbacksProxy.cpp: The db-callbacks plumbing is needed earlier.
      (WebKit::IDBCallbacksProxy::onSuccess):
      (WebKit::IDBCallbacksProxy::onUpgradeNeeded):
      (WebKit):
      (WebKit::IDBCallbacksProxy::setDatabaseCallbacks): Needs to hold on to
      the db-callbacks and hook it up when the onSuccess callback comes through.
      * src/IDBCallbacksProxy.h:
      (WebKit):
      (IDBCallbacksProxy):
      * src/IDBDatabaseBackendProxy.cpp:
      * src/IDBDatabaseBackendProxy.h:
      (IDBDatabaseBackendProxy):
      * src/IDBFactoryBackendProxy.cpp:
      (WebKit::IDBFactoryBackendProxy::open):
      * src/IDBFactoryBackendProxy.h:
      (IDBFactoryBackendProxy):
      * src/WebIDBDatabaseImpl.cpp:
      (WebKit::WebIDBDatabaseImpl::WebIDBDatabaseImpl):
      (WebKit::WebIDBDatabaseImpl::close):
      * src/WebIDBDatabaseImpl.h:
      (WebIDBDatabaseImpl):
      * src/WebIDBFactoryImpl.cpp:
      (WebKit::WebIDBFactoryImpl::open):
      * src/WebIDBFactoryImpl.h:
      (WebIDBFactoryImpl):
      * tests/IDBAbortOnCorruptTest.cpp:
      (FakeIDBDatabaseCallbacks):
      (WebCore::FakeIDBDatabaseCallbacks::create):
      (WebCore::FakeIDBDatabaseCallbacks::~FakeIDBDatabaseCallbacks):
      (WebCore::FakeIDBDatabaseCallbacks::FakeIDBDatabaseCallbacks):
      (WebCore):
      (WebCore::TEST): Updated connection sequence.
      * tests/IDBDatabaseBackendTest.cpp: Ditto.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128489 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      6bbf86d1
  26. 12 Sep, 2012 1 commit
    • jsbell@chromium.org's avatar
      IndexedDB: The |source| property of IDBFactory.open() request should be null · 73d661ef
      jsbell@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=96551
      
      Reviewed by Tony Chang.
      
      Source/WebCore:
      
      Per the IDB spec, the source property of the IDBOpenDBRequest returned by IDBFactory.open()
      should be set to null. We were setting it to the IDBFactory object instead.
      
      Tests: storage/indexeddb/basics.html
             storage/indexeddb/basics-workers.html
             storage/indexeddb/mozilla/event-source.html
             storage/indexeddb/readonly.html
      
      * Modules/indexeddb/IDBFactory.cpp:
      (WebCore::IDBFactory::open):
      
      LayoutTests:
      
      Already tested for in several places, so just update expectations/assertions.
      
      * storage/indexeddb/basics-expected.txt:
      * storage/indexeddb/basics-workers-expected.txt:
      * storage/indexeddb/mozilla/event-source-expected.txt:
      * storage/indexeddb/mozilla/resources/event-source.js: Updated assertion.
      (openSuccess):
      * storage/indexeddb/readonly-expected.txt:
      * storage/indexeddb/resources/basics.js: Updated assertion.
      (test):
      (openCallback):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128370 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      73d661ef
  27. 29 Aug, 2012 1 commit
  28. 16 Aug, 2012 1 commit
    • dgrogan@chromium.org's avatar
      IndexedDB: Frontend and plumbing for integer versions · eb6721b2
      dgrogan@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=92897
      
      Source/WebCore:
      
      Reviewed by Tony Chang.
      
      This patch exposes integer versions and the upgradeneeded event to
      script.
      
      The events surrounding an IDBOpenDBRequest follow a new pattern
      compared to other idb requests. An open request can receive a blocked
      event, an upgradeneeded event, and then a success event. When
      dispatching the upgradeneeded and success events the request has its
      readyState set to DONE and its result property set to an IDBDatabase.
      We usually think of IDBRequests firing one event with one result,
      cursors being the big exception. There are some minor changes around
      enqueuing and dispatching events to support this.
      
      There's also some funkiness in
      IDBRequest::onSuccess(PassRefPtr<IDBDatabaseBackendInterface>) so that
      the IDBDatabase object delivered in upgradeneeded is reused for the
      success event.
      
      Tests - expectations are updated in this patch.
      
      * Modules/indexeddb/IDBDatabase.cpp:
      (WebCore::IDBDatabase::setVersion):
      (WebCore::IDBDatabase::onVersionChange):
      (WebCore):
      (WebCore::IDBDatabase::registerFrontendCallbacks):
      * Modules/indexeddb/IDBDatabase.h:
      (IDBDatabase):
      * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
      (WebCore::IDBDatabaseBackendImpl::runIntVersionChangeTransaction):
      * Modules/indexeddb/IDBDatabaseCallbacks.h:
      (IDBDatabaseCallbacks):
      * Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp:
      (WebCore::IDBDatabaseCallbacksImpl::onVersionChange):
      (WebCore):
      * Modules/indexeddb/IDBDatabaseCallbacksImpl.h:
      (IDBDatabaseCallbacksImpl):
      * Modules/indexeddb/IDBFactory.cpp:
      (WebCore::IDBFactory::open):
      (WebCore):
      * Modules/indexeddb/IDBFactory.h:
      (IDBFactory):
      * Modules/indexeddb/IDBFactory.idl:
      * Modules/indexeddb/IDBFactoryBackendImpl.cpp:
      (WebCore::IDBFactoryBackendImpl::open):
      * Modules/indexeddb/IDBFactoryBackendImpl.h:
      (IDBFactoryBackendImpl):
      * Modules/indexeddb/IDBFactoryBackendInterface.h:
      (IDBFactoryBackendInterface):
      * Modules/indexeddb/IDBOpenDBRequest.cpp: Added.
      (WebCore):
      (WebCore::IDBOpenDBRequest::create):
      (WebCore::IDBOpenDBRequest::IDBOpenDBRequest):
      (WebCore::IDBOpenDBRequest::~IDBOpenDBRequest):
      (WebCore::IDBOpenDBRequest::interfaceName):
      (WebCore::IDBOpenDBRequest::onBlocked):
      (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
      (WebCore::IDBOpenDBRequest::shouldEnqueueEvent):
      * Modules/indexeddb/IDBOpenDBRequest.h: Copied from Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacksImpl.h.
      (WebCore):
      (IDBOpenDBRequest):
      * Modules/indexeddb/IDBOpenDBRequest.idl: Copied from Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacks.h.
      * Modules/indexeddb/IDBRequest.cpp:
      (WebCore::IDBRequest::IDBRequest):
      (WebCore::IDBRequest::shouldEnqueueEvent):
      (WebCore::IDBRequest::onSuccess):
      This function works with WebIDBCallbacksImpl::onSuccess to reuse its
      IDBDatabaseBackendInterface that it got during
      IDBOpenDBRequest::onUpgradeNeeded.
      
      (WebCore::IDBRequest::dispatchEvent):
      (WebCore::IDBRequest::transactionDidDispatchCompleteOrAbort):
      (WebCore):
      (WebCore::IDBRequest::enqueueEvent):
      * Modules/indexeddb/IDBRequest.h:
      (WebCore::IDBRequest::onBlocked):
      (IDBRequest):
      * Modules/indexeddb/IDBTransaction.cpp:
      We now take a pointer to the openDBRequest if this is a version
      change transaction as a result of an open-with-version call so that we
      can clear the transaction property on the openDBRequest as soon as the
      upgradeneeded event is dispatched per the spec ("... set request's
      transaction property to null... ", currently 4.8.12).
      
      (WebCore::IDBTransaction::create):
      (WebCore):
      (WebCore::IDBTransaction::IDBTransaction):
      (WebCore::IDBTransaction::setActive):
      (WebCore::IDBTransaction::onComplete):
      (WebCore::IDBTransaction::dispatchEvent):
      * Modules/indexeddb/IDBTransaction.h:
      (WebCore):
      (IDBTransaction):
      * Modules/indexeddb/IDBTransactionBackendImpl.cpp:
      (WebCore::IDBTransactionBackendImpl::commit):
      * Modules/indexeddb/IDBUpgradeNeededEvent.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp.
      (WebCore):
      (WebCore::IDBUpgradeNeededEvent::create):
      (WebCore::IDBUpgradeNeededEvent::IDBUpgradeNeededEvent):
      (WebCore::IDBUpgradeNeededEvent::~IDBUpgradeNeededEvent):
      (WebCore::IDBUpgradeNeededEvent::oldVersion):
      (WebCore::IDBUpgradeNeededEvent::newVersion):
      (WebCore::IDBUpgradeNeededEvent::interfaceName):
      * Modules/indexeddb/IDBUpgradeNeededEvent.h: Copied from Source/WebKit/chromium/src/WebIDBDatabaseCallbacksImpl.h.
      (WebCore):
      (IDBUpgradeNeededEvent):
      * Modules/indexeddb/IDBUpgradeNeededEvent.idl: Copied from Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacks.h.
      * WebCore.gypi:
      * dom/EventNames.h:
      (WebCore):
      * dom/EventNames.in:
      * dom/EventTargetFactory.in:
      * inspector/InspectorIndexedDBAgent.cpp:
      (WebCore):
      
      Source/WebKit/chromium:
      
      Reviewed by Tony Chang.
      
      * src/IDBCallbacksProxy.cpp:
      (WebKit::IDBCallbacksProxy::onBlocked):
      (WebKit):
      (WebKit::IDBCallbacksProxy::onUpgradeNeeded):
      * src/IDBCallbacksProxy.h:
      (IDBCallbacksProxy):
      * src/IDBDatabaseBackendProxy.cpp:
      (WebKit::IDBDatabaseBackendProxy::setVersion):
      * src/IDBDatabaseCallbacksProxy.cpp:
      (WebKit::IDBDatabaseCallbacksProxy::onVersionChange):
      (WebKit):
      * src/IDBDatabaseCallbacksProxy.h:
      (IDBDatabaseCallbacksProxy):
      * src/IDBFactoryBackendProxy.cpp:
      (WebKit::IDBFactoryBackendProxy::open):
      * src/IDBFactoryBackendProxy.h:
      (IDBFactoryBackendProxy):
      * src/IDBTransactionCallbacksProxy.cpp:
      (WebKit::IDBTransactionCallbacksProxy::onComplete):
      * src/WebIDBCallbacksImpl.cpp:
      (WebKit::WebIDBCallbacksImpl::WebIDBCallbacksImpl):
      (WebKit::WebIDBCallbacksImpl::onSuccess):
      We don't want to create IDBDatabaseBackendProxy again if we've already
      created it during upgradeNeeded.  This makes
      IDBRequest::onSuccess(IDBDatabaseBackend) reuse its previous
      IDBDatabaseBackendInterface if it has one.
      
      (WebKit::WebIDBCallbacksImpl::onBlocked):
      (WebKit):
      (WebKit::WebIDBCallbacksImpl::onUpgradeNeeded):
      * src/WebIDBCallbacksImpl.h:
      (WebIDBCallbacksImpl):
      * src/WebIDBDatabaseCallbacksImpl.cpp:
      (WebKit::WebIDBDatabaseCallbacksImpl::onVersionChange):
      (WebKit):
      * src/WebIDBDatabaseCallbacksImpl.h:
      (WebIDBDatabaseCallbacksImpl):
      * src/WebIDBDatabaseImpl.cpp:
      (WebKit::WebIDBDatabaseImpl::WebIDBDatabaseImpl):
      (WebKit::WebIDBDatabaseImpl::close):
      (WebKit::WebIDBDatabaseImpl::open):
      * src/WebIDBDatabaseImpl.h:
      (WebIDBDatabaseImpl):
      * src/WebIDBFactoryImpl.cpp:
      (WebKit::WebIDBFactoryImpl::open):
      * src/WebIDBFactoryImpl.h:
      (WebIDBFactoryImpl):
      * src/WebIDBTransactionCallbacksImpl.cpp:
      (WebKit::WebIDBTransactionCallbacksImpl::onComplete):
      * tests/IDBAbortOnCorruptTest.cpp:
      (WebCore::TEST):
      * tests/IDBDatabaseBackendTest.cpp:
      
      LayoutTests:
      
      This patch exposes integer versions and the upgradeneeded event to
      script so upgradeneeded events are now fired mostly per expectations.
      This is the bulk of changes to the expected files, further intversion
      patches will change the behavior of a test or two, nothing wholesale.
      
      Reviewed by Tony Chang.
      
      * storage/indexeddb/intversion-abort-in-initial-upgradeneeded-expected.txt:
      * storage/indexeddb/intversion-and-setversion-expected.txt:
      * storage/indexeddb/intversion-blocked-expected.txt:
      * storage/indexeddb/intversion-close-between-events-expected.txt:
      * storage/indexeddb/intversion-close-in-oncomplete-expected.txt:
      * storage/indexeddb/intversion-close-in-upgradeneeded-expected.txt:
      * storage/indexeddb/intversion-gated-on-delete-expected.txt:
      * storage/indexeddb/intversion-invalid-setversion-has-no-side-effects-expected.txt:
      * storage/indexeddb/intversion-long-queue-expected.txt:
      * storage/indexeddb/intversion-open-with-version-expected.txt:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125850 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      eb6721b2
  29. 19 Jul, 2012 1 commit
    • jsbell@chromium.org's avatar
      IndexedDB: Throw native TypeErrors per spec · 818b83ed
      jsbell@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=91679
      
      Reviewed by Kentaro Hara.
      
      Source/WebCore:
      
      Per the IDB spec, the advance(), openCursor(), openKeyCursor() and transaction()
      methods supposed to throw true native JavaScript TypeError objects as exceptions
      rather than DOMException objects. Implement this by adding a special DOMException
      code that is tested for in the binding layer.
      
      Tests: storage/indexeddb/cursor-advance.html
             storage/indexeddb/index-basics.html
             storage/indexeddb/index-basics-workers.html
             storage/indexeddb/objectstore-cursor.html
             storage/indexeddb/transaction-basics.html
      
      * Modules/indexeddb/IDBCursor.cpp: Use the new DOMException code.
      (WebCore::IDBCursor::advance):
      (WebCore::IDBCursor::stringToDirection):
      (WebCore::IDBCursor::directionToString):
      * Modules/indexeddb/IDBDatabase.cpp: Ditto.
      (WebCore::IDBDatabase::setVersion):
      * Modules/indexeddb/IDBDatabaseException.cpp: Remove temporary cruft/mark as legacy.
      (WebCore):
      * Modules/indexeddb/IDBDatabaseException.h: Ditto.
      * Modules/indexeddb/IDBDatabaseException.idl: Ditto.
      * Modules/indexeddb/IDBFactory.cpp: Use the new DOMException code.
      (WebCore::IDBFactory::open):
      (WebCore::IDBFactory::deleteDatabase):
      * Modules/indexeddb/IDBObjectStore.cpp:
      (WebCore::IDBObjectStore::createIndex): Use the new DOMException code.
      * Modules/indexeddb/IDBTransaction.cpp: Use the new DOMException code.
      (WebCore::IDBTransaction::stringToMode):
      (WebCore::IDBTransaction::modeToString):
      * bindings/js/JSDOMBinding.cpp:
      (WebCore::setDOMException): Intercept new DOMException code, throw native TypeError.
      * bindings/v8/V8Proxy.cpp:
      (WebCore::V8Proxy::setDOMException): Ditto.
      * dom/ExceptionCode.h: Add new DOMException code.
      
      LayoutTests:
      
      * storage/indexeddb/cursor-advance-expected.txt:
      * storage/indexeddb/index-basics-expected.txt:
      * storage/indexeddb/index-basics-workers-expected.txt:
      * storage/indexeddb/objectstore-cursor-expected.txt:
      * storage/indexeddb/resources/cursor-advance.js:
      (testBadAdvance.advanceBadly):
      (testBadAdvance):
      * storage/indexeddb/resources/index-basics.js:
      (openKeyCursor):
      (openObjectCursor):
      * storage/indexeddb/resources/objectstore-cursor.js:
      (deleteExisting):
      * storage/indexeddb/resources/transaction-basics.js:
      (testInvalidMode):
      * storage/indexeddb/transaction-basics-expected.txt:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123112 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      818b83ed
  30. 12 Jul, 2012 2 commits
    • jsbell@chromium.org's avatar
      IndexedDB: Enable IDBFactory.deleteDatabase() and webkitGetDatabaseNames() in Workers · 078ffdf5
      jsbell@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=90310
      
      Reviewed by Tony Chang.
      
      Source/WebCore:
      
      Simplify Document vs. Worker logic for IDBFactory::open() and hook up the
      other two IDBFactory methods for use by workers as well.
      
      Test: storage/indexeddb/factory-basics-workers.html
      
      * Modules/indexeddb/IDBFactory.cpp:
      (isContextValid): Helper function consolidating checks that context is usable.
      (getIndexedDBDatabasePath): Helper function for accessing group settings.
      (WebCore::IDBFactory::getDatabaseNames): Simplify - just pass context through to back end.
      (WebCore::IDBFactory::open): Ditto.
      (WebCore::IDBFactory::deleteDatabase): Ditto.
      (WebCore::IDBFactory::cmp): Whitespace.
      * Modules/indexeddb/IDBFactoryBackendImpl.cpp: Obsolete openFromWorker() removed.
      (WebCore::IDBFactoryBackendImpl::getDatabaseNames): Signature updated.
      (WebCore::IDBFactoryBackendImpl::deleteDatabase): Signature updated.
      (WebCore::IDBFactoryBackendImpl::open): Signature updated.
      * Modules/indexeddb/IDBFactoryBackendImpl.h:
      (IDBFactoryBackendImpl):
      * Modules/indexeddb/IDBFactoryBackendInterface.h: Interface methods now take both SecurityOrigin
      and ScriptExecutionContext, but not Frame. In the proxy, SecurityOrigin is redundant (can be
      accessed from context) but on the real back end the context is null (as Frame was previously).
      (IDBFactoryBackendInterface):
      * inspector/InspectorIndexedDBAgent.cpp:
      (WebCore):
      (WebCore::InspectorIndexedDBAgent::requestDatabaseNamesForFrame):
      (WebCore::InspectorIndexedDBAgent::requestDatabase):
      (WebCore::InspectorIndexedDBAgent::requestData):
      
      Source/WebKit/chromium:
      
      * src/IDBFactoryBackendProxy.cpp:
      (WebKit::IDBFactoryBackendProxy::allowIndexedDB): Consolidates user-prompting logic.
      (WebKit::getWebFrame): Helper to dig out frame from Document, or null for Worker.
      (WebKit::IDBFactoryBackendProxy::getDatabaseNames):
      (WebKit):
      (WebKit::IDBFactoryBackendProxy::open):
      (WebKit::IDBFactoryBackendProxy::deleteDatabase):
      * src/IDBFactoryBackendProxy.h: Update method signatures to match interface.
      (WebCore):
      (IDBFactoryBackendProxy):
      
      LayoutTests:
      
      * storage/indexeddb/factory-basics-workers-expected.txt: Added.
      * storage/indexeddb/factory-basics-workers.html: Added.
      * storage/indexeddb/resources/factory-basics.js: Allow use by Worker as well as Window.
      (getDatabaseNamesSuccess1):
      (openSuccess):
      (getDatabaseNamesSuccess2):
      (getDatabaseNamesSuccess3):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122515 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      078ffdf5
    • jsbell@chromium.org's avatar
      IndexedDB: ASSERT hit calling open from callback in Worker · 334cfc03
      jsbell@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=90832
      
      Reviewed by Kentaro Hara.
      
      Source/WebCore:
      
      GroupSettings are used to provide the backing store path in some
      ports. Accessing those settings from a Worker was added, but the
      access referenced thread startup data that is cleared before the
      run loop, so an IDBFactory.open() call executed asynchronously
      would dereference a null pointer. Plumb the settings startup
      data into the context itself, like all of the other properties.
      
      Test: storage/indexeddb/open-twice-workers.html
      
      * Modules/indexeddb/IDBFactory.cpp:
      (WebCore::IDBFactory::open):
      * workers/DedicatedWorkerContext.cpp:
      (WebCore::DedicatedWorkerContext::DedicatedWorkerContext):
      * workers/DedicatedWorkerContext.h:
      (WebCore::DedicatedWorkerContext::create):
      (DedicatedWorkerContext):
      * workers/DedicatedWorkerThread.cpp:
      (WebCore::DedicatedWorkerThread::createWorkerContext):
      * workers/DedicatedWorkerThread.h:
      (DedicatedWorkerThread):
      * workers/SharedWorkerContext.cpp:
      (WebCore::SharedWorkerContext::SharedWorkerContext):
      * workers/SharedWorkerContext.h:
      (WebCore::SharedWorkerContext::create):
      (SharedWorkerContext):
      * workers/SharedWorkerThread.cpp:
      (WebCore::SharedWorkerThread::createWorkerContext):
      * workers/SharedWorkerThread.h:
      (SharedWorkerThread):
      * workers/WorkerContext.cpp:
      (WebCore::WorkerContext::WorkerContext):
      * workers/WorkerContext.h:
      (WebCore::WorkerContext::groupSettings):
      (WorkerContext):
      * workers/WorkerThread.cpp:
      (WebCore::WorkerThread::workerThread):
      * workers/WorkerThread.h:
      (WorkerThread):
      
      LayoutTests:
      
      Call IDBFactory.open() twice from a worker - once from the initial worker
      script evaluation, and once in a callback after the worker thread data
      has been purged.
      
      * storage/indexeddb/open-twice-workers-expected.txt: Added.
      * storage/indexeddb/open-twice-workers.html: Added.
      * storage/indexeddb/resources/open-twice.js: Added.
      (test):
      (openAnother):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122463 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      334cfc03
  31. 03 Jul, 2012 1 commit
    • charles.wei@torchmobile.com.cn's avatar
      IndexedDB: should make the LevelDB persistant to the directory indicated in... · c0516122
      charles.wei@torchmobile.com.cn authored
      IndexedDB: should make the LevelDB persistant to the directory indicated in PageGroupSettings::indexedDBDataBasePath
      https://bugs.webkit.org/show_bug.cgi?id=88338
      
      Reviewed by David Levin.
      
      Source/WebCore:
      
      If the indexedDB runs in main thread it can access the GroupSettings via the document;
      otherwise, we need to pass the page GroupSettings to the worker thread so that accessible
      to the indexedDB running in WorkerContext.
      
      * Modules/indexeddb/IDBFactory.cpp:
      (WebCore::IDBFactory::open):
      * workers/DedicatedWorkerThread.cpp:
      (WebCore::DedicatedWorkerThread::create):
      (WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
      * workers/DedicatedWorkerThread.h:
      (DedicatedWorkerThread):
      * workers/DefaultSharedWorkerRepository.cpp:
      (SharedWorkerProxy):
      (WebCore::SharedWorkerProxy::groupSettings):
      (WebCore):
      (WebCore::DefaultSharedWorkerRepository::workerScriptLoaded):
      * workers/SharedWorkerThread.cpp:
      (WebCore::SharedWorkerThread::create):
      (WebCore::SharedWorkerThread::SharedWorkerThread):
      * workers/SharedWorkerThread.h:
      (SharedWorkerThread):
      * workers/WorkerMessagingProxy.cpp:
      (WebCore::WorkerMessagingProxy::startWorkerContext):
      * workers/WorkerThread.cpp:
      (WebCore::WorkerThreadStartupData::create):
      (WorkerThreadStartupData):
      (WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
      (WebCore::WorkerThread::WorkerThread):
      (WebCore::WorkerThread::groupSettings):
      (WebCore):
      * workers/WorkerThread.h:
      (WorkerThread):
      
      Source/WebKit/chromium:
      
      * src/WebSharedWorkerImpl.cpp:
      (WebKit::WebSharedWorkerImpl::startWorkerContext):
      * src/WebWorkerClientImpl.cpp:
      (WebKit::WebWorkerClientImpl::startWorkerContext):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@121742 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c0516122
  32. 28 Jun, 2012 1 commit
    • zandobersek@gmail.com's avatar
      Unreviewed, rolling out r121395. · 376e024f
      zandobersek@gmail.com authored
      http://trac.webkit.org/changeset/121395
      https://bugs.webkit.org/show_bug.cgi?id=90143
      
      Patch causes crashes in fast/workers/worker-context-gc.html
      (Requested by zdobersek on #webkit).
      
      Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-06-28
      
      Source/WebCore: 
      
      * Modules/indexeddb/IDBFactory.cpp:
      (WebCore::IDBFactory::open):
      * workers/DedicatedWorkerThread.cpp:
      (WebCore::DedicatedWorkerThread::create):
      (WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
      * workers/DedicatedWorkerThread.h:
      (DedicatedWorkerThread):
      * workers/DefaultSharedWorkerRepository.cpp:
      (SharedWorkerProxy):
      (WebCore::DefaultSharedWorkerRepository::workerScriptLoaded):
      * workers/SharedWorkerThread.cpp:
      (WebCore::SharedWorkerThread::create):
      (WebCore::SharedWorkerThread::SharedWorkerThread):
      * workers/SharedWorkerThread.h:
      (SharedWorkerThread):
      * workers/WorkerMessagingProxy.cpp:
      (WebCore::WorkerMessagingProxy::startWorkerContext):
      * workers/WorkerThread.cpp:
      (WebCore::WorkerThreadStartupData::create):
      (WorkerThreadStartupData):
      (WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
      (WebCore::WorkerThread::WorkerThread):
      * workers/WorkerThread.h:
      (WorkerThread):
      
      Source/WebKit/chromium: 
      
      * src/WebSharedWorkerImpl.cpp:
      (WebKit::WebSharedWorkerImpl::startWorkerContext):
      * src/WebWorkerClientImpl.cpp:
      (WebKit::WebWorkerClientImpl::startWorkerContext):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@121417 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      376e024f
  33. 27 Jun, 2012 1 commit
    • charles.wei@torchmobile.com.cn's avatar
      IndexedDB: should make the LevelDB persistant to the directory indicated in... · 4980ea51
      charles.wei@torchmobile.com.cn authored
      IndexedDB: should make the LevelDB persistant to the directory indicated in PageGroupSettings::indexedDBDataBasePath
      https://bugs.webkit.org/show_bug.cgi?id=88338
      
      Reviewed by David Levin.
      
      Source/WebCore:
      
      If the indexedDB runs in main thread it can access the GroupSettings via the document;
      otherwise, we need to pass the page GroupSettings to the worker thread so that accessible
      to the indexedDB running in WorkerContext.
      
      * Modules/indexeddb/IDBFactory.cpp:
      (WebCore::IDBFactory::open):
      * workers/DedicatedWorkerThread.cpp:
      (WebCore::DedicatedWorkerThread::create):
      (WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
      * workers/DedicatedWorkerThread.h:
      (DedicatedWorkerThread):
      * workers/DefaultSharedWorkerRepository.cpp:
      (SharedWorkerProxy):
      (WebCore::SharedWorkerProxy::groupSettings):
      (WebCore):
      (WebCore::DefaultSharedWorkerRepository::workerScriptLoaded):
      * workers/SharedWorkerThread.cpp:
      (WebCore::SharedWorkerThread::create):
      (WebCore::SharedWorkerThread::SharedWorkerThread):
      * workers/SharedWorkerThread.h:
      (SharedWorkerThread):
      * workers/WorkerMessagingProxy.cpp:
      (WebCore::WorkerMessagingProxy::startWorkerContext):
      * workers/WorkerThread.cpp:
      (WebCore::WorkerThreadStartupData::create):
      (WorkerThreadStartupData):
      (WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
      (WebCore::WorkerThread::WorkerThread):
      (WebCore::WorkerThread::groupSettings):
      (WebCore):
      * workers/WorkerThread.h:
      (WorkerThread):
      
      Source/WebKit/chromium:
      
      * src/WebSharedWorkerImpl.cpp:
      (WebKit::WebSharedWorkerImpl::startWorkerContext):
      * src/WebWorkerClientImpl.cpp:
      (WebKit::WebWorkerClientImpl::startWorkerContext):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@121395 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      4980ea51
  34. 21 Jun, 2012 1 commit
    • commit-queue@webkit.org's avatar
      IndexedDB: Implement spec behavior for multiEntry indexes with invalid/duplicate subkeys · d6d57718
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=86123
      
      Patch by Alec Flett <alecflett@chromium.org> on 2012-06-21
      Reviewed by Darin Fisher.
      
      Source/WebCore:
      
      Distinguish between an actual invalid IDBKey, and an array of
      possibly-invalid subkeys by making IDBKey::isValid() check subkeys
      if the type is an array.
      
      Introduce a new way to transform an IDBKey into a
      multiEntry-specific IDBKey, (IDBKey::createMultiEntryArray)
      throwing out duplicates and invalid keys. Use it when storing
      index entries for multiEntry indexes.
      
      No new tests: existing tests have been altered to include new behavior.
      
      * Modules/indexeddb/IDBCursor.cpp:
      (WebCore::IDBCursor::continueFunction):
      * Modules/indexeddb/IDBFactory.cpp:
      (WebCore::IDBFactory::cmp):
      * Modules/indexeddb/IDBIndex.cpp:
      (WebCore::IDBIndex::get):
      (WebCore::IDBIndex::getKey):
      * Modules/indexeddb/IDBKey.cpp:
      (WebCore::IDBKey::isValid):
      (WebCore):
      * Modules/indexeddb/IDBKey.h:
      (WebCore::IDBKey::createMultiEntryArray):
      (IDBKey):
      * Modules/indexeddb/IDBKeyRange.cpp:
      (WebCore::IDBKeyRange::only):
      (WebCore::IDBKeyRange::lowerBound):
      (WebCore::IDBKeyRange::upperBound):
      (WebCore::IDBKeyRange::bound):
      * Modules/indexeddb/IDBLevelDBBackingStore.cpp:
      (WebCore::IDBLevelDBBackingStore::putObjectStoreRecord):
      (WebCore::IDBLevelDBBackingStore::putIndexDataForRecord):
      * Modules/indexeddb/IDBLevelDBCoding.cpp:
      (WebCore::IDBLevelDBCoding::encodeIDBKey):
      * Modules/indexeddb/IDBObjectStore.cpp:
      (WebCore::IDBObjectStore::get):
      (WebCore::IDBObjectStore::add):
      (WebCore::IDBObjectStore::put):
      * Modules/indexeddb/IDBObjectStoreBackendImpl.cpp:
      (WebCore::IDBObjectStoreBackendImpl::putInternal):
      (WebCore):
      * bindings/v8/IDBBindingUtilities.cpp:
      (WebCore::createIDBKeyFromValue):
      
      Source/WebKit/chromium:
      
      Add matching isValid() to WebIDBKey to match the one in IDBKey.
      
      * public/WebIDBKey.h:
      * src/WebIDBKey.cpp:
      (WebKit::WebIDBKey::isValid):
      (WebKit):
      * src/WebIDBKeyRange.cpp:
      (WebKit::WebIDBKeyRange::assign):
      
      LayoutTests:
      
      * storage/indexeddb/index-multientry-expected.txt:
      * storage/indexeddb/resources/index-multientry.js:
      (addData):
      (verifyIndexes.request.onsuccess):
      (verifyIndexes):
      (verifyUniqueConstraint.request.onsuccess.request.onsuccess.request.onerror):
      (verifyUniqueConstraint.request.onsuccess.request.onsuccess):
      (verifyUniqueConstraint.request.onsuccess):
      (verifyUniqueConstraint):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@120967 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d6d57718