Source/JavaScriptCore:
* bytecode/SamplingTool.cpp:
(JSC::SamplingTool::doRun):
(JSC::SamplingTool::notifyOfScope):
* bytecode/SamplingTool.h:
* dfg/DFGThreadData.h:
* dfg/DFGWorklist.cpp:
(JSC::DFG::Worklist::~Worklist):
(JSC::DFG::Worklist::isActiveForVM):
(JSC::DFG::Worklist::enqueue):
(JSC::DFG::Worklist::compilationState):
(JSC::DFG::Worklist::waitUntilAllPlansForVMAreReady):
(JSC::DFG::Worklist::removeAllReadyPlansForVM):
(JSC::DFG::Worklist::completeAllReadyPlansForVM):
(JSC::DFG::Worklist::visitWeakReferences):
(JSC::DFG::Worklist::removeDeadPlans):
(JSC::DFG::Worklist::queueLength):
(JSC::DFG::Worklist::dump):
(JSC::DFG::Worklist::runThread):
* dfg/DFGWorklist.h:
* disassembler/Disassembler.cpp:
* heap/CopiedSpace.cpp:
(JSC::CopiedSpace::doneFillingBlock):
(JSC::CopiedSpace::doneCopying):
* heap/CopiedSpace.h:
* heap/CopiedSpaceInlines.h:
(JSC::CopiedSpace::recycleBorrowedBlock):
(JSC::CopiedSpace::allocateBlockForCopyingPhase):
* heap/HeapTimer.h:
* heap/MachineStackMarker.cpp:
(JSC::ActiveMachineThreadsManager::Locker::Locker):
(JSC::ActiveMachineThreadsManager::add):
(JSC::ActiveMachineThreadsManager::remove):
(JSC::ActiveMachineThreadsManager::ActiveMachineThreadsManager):
(JSC::MachineThreads::~MachineThreads):
(JSC::MachineThreads::addCurrentThread):
(JSC::MachineThreads::removeThreadIfFound):
(JSC::MachineThreads::tryCopyOtherThreadStack):
(JSC::MachineThreads::tryCopyOtherThreadStacks):
(JSC::MachineThreads::gatherConservativeRoots):
* heap/MachineStackMarker.h:
* interpreter/JSStack.cpp:
(JSC::stackStatisticsMutex):
(JSC::JSStack::addToCommittedByteCount):
(JSC::JSStack::committedByteCount):
* jit/JITThunks.h:
* profiler/ProfilerDatabase.h:
Source/WebCore:
* Modules/webaudio/AsyncAudioDecoder.cpp:
(WebCore::AsyncAudioDecoder::AsyncAudioDecoder):
(WebCore::AsyncAudioDecoder::runLoop):
* Modules/webaudio/AsyncAudioDecoder.h:
* Modules/webaudio/AudioContext.h:
* Modules/webaudio/MediaStreamAudioSource.cpp:
(WebCore::MediaStreamAudioSource::addAudioConsumer):
(WebCore::MediaStreamAudioSource::removeAudioConsumer):
(WebCore::MediaStreamAudioSource::setAudioFormat):
(WebCore::MediaStreamAudioSource::consumeAudio):
* Modules/webaudio/MediaStreamAudioSource.h:
* Modules/webdatabase/Database.cpp:
(WebCore::Database::close):
(WebCore::Database::runTransaction):
(WebCore::Database::inProgressTransactionCompleted):
(WebCore::Database::hasPendingTransaction):
* Modules/webdatabase/DatabaseTask.h:
* Modules/webdatabase/DatabaseThread.cpp:
(WebCore::DatabaseThread::start):
(WebCore::DatabaseThread::databaseThread):
* Modules/webdatabase/DatabaseThread.h:
* Modules/webdatabase/DatabaseTracker.cpp:
(WebCore::DatabaseTracker::setDatabaseDirectoryPath):
(WebCore::DatabaseTracker::canEstablishDatabase):
(WebCore::DatabaseTracker::retryCanEstablishDatabase):
(WebCore::DatabaseTracker::hasEntryForOrigin):
(WebCore::DatabaseTracker::getMaxSizeForDatabase):
(WebCore::DatabaseTracker::closeAllDatabases):
(WebCore::DatabaseTracker::fullPathForDatabase):
(WebCore::DatabaseTracker::origins):
(WebCore::DatabaseTracker::databaseNamesForOrigin):
(WebCore::DatabaseTracker::detailsForNameAndOrigin):
(WebCore::DatabaseTracker::setDatabaseDetails):
(WebCore::DatabaseTracker::doneCreatingDatabase):
(WebCore::DatabaseTracker::addOpenDatabase):
(WebCore::DatabaseTracker::removeOpenDatabase):
(WebCore::DatabaseTracker::getOpenDatabases):
(WebCore::DatabaseTracker::originLockFor):
(WebCore::DatabaseTracker::quotaForOrigin):
(WebCore::DatabaseTracker::setQuota):
(WebCore::DatabaseTracker::deleteOrigin):
(WebCore::DatabaseTracker::deleteDatabase):
(WebCore::DatabaseTracker::deleteDatabaseFile):
(WebCore::DatabaseTracker::removeDeletedOpenedDatabases):
(WebCore::DatabaseTracker::deleteDatabaseFileIfEmpty):
(WebCore::DatabaseTracker::openDatabaseMutex):
(WebCore::DatabaseTracker::setClient):
(WebCore::notificationMutex):
(WebCore::DatabaseTracker::scheduleNotifyDatabaseChanged):
(WebCore::DatabaseTracker::notifyDatabasesChanged):
* Modules/webdatabase/DatabaseTracker.h:
* Modules/webdatabase/OriginLock.h:
* Modules/webdatabase/SQLCallbackWrapper.h:
(WebCore::SQLCallbackWrapper::clear):
(WebCore::SQLCallbackWrapper::unwrap):
(WebCore::SQLCallbackWrapper::hasCallback):
* Modules/webdatabase/SQLTransactionBackend.cpp:
(WebCore::SQLTransactionBackend::doCleanup):
(WebCore::SQLTransactionBackend::enqueueStatementBackend):
(WebCore::SQLTransactionBackend::getNextStatement):
* Modules/webdatabase/SQLTransactionBackend.h:
* bindings/js/WorkerScriptController.cpp:
(WebCore::WorkerScriptController::scheduleExecutionTermination):
(WebCore::WorkerScriptController::isExecutionTerminating):
* bindings/js/WorkerScriptController.h:
* dom/default/PlatformMessagePortChannel.cpp:
(WebCore::MessagePortChannel::postMessageToRemote):
(WebCore::MessagePortChannel::tryGetMessageFromRemote):
(WebCore::MessagePortChannel::isConnectedTo):
(WebCore::MessagePortChannel::hasPendingActivity):
(WebCore::MessagePortChannel::locallyEntangledPort):
(WebCore::PlatformMessagePortChannel::setRemotePort):
(WebCore::PlatformMessagePortChannel::entangledChannel):
(WebCore::PlatformMessagePortChannel::closeInternal):
* dom/default/PlatformMessagePortChannel.h:
* loader/icon/IconDatabase.cpp:
(WebCore::IconDatabase::removeAllIcons):
(WebCore::IconDatabase::synchronousIconForPageURL):
(WebCore::IconDatabase::synchronousNativeIconForPageURL):
(WebCore::IconDatabase::synchronousIconURLForPageURL):
(WebCore::IconDatabase::retainIconForPageURL):
(WebCore::IconDatabase::performRetainIconForPageURL):
(WebCore::IconDatabase::releaseIconForPageURL):
(WebCore::IconDatabase::performReleaseIconForPageURL):
(WebCore::IconDatabase::setIconDataForIconURL):
(WebCore::IconDatabase::setIconURLForPageURL):
(WebCore::IconDatabase::synchronousLoadDecisionForIconURL):
(WebCore::IconDatabase::synchronousIconDataKnownForIconURL):
(WebCore::IconDatabase::pageURLMappingCount):
(WebCore::IconDatabase::retainedPageURLCount):
(WebCore::IconDatabase::iconRecordCount):
(WebCore::IconDatabase::iconRecordCountWithData):
(WebCore::IconDatabase::wakeSyncThread):
(WebCore::IconDatabase::isOpenBesidesMainThreadCallbacks):
(WebCore::IconDatabase::databasePath):
(WebCore::IconDatabase::getOrCreatePageURLRecord):
(WebCore::IconDatabase::iconDatabaseSyncThread):
(WebCore::IconDatabase::performOpenInitialization):
(WebCore::IconDatabase::performURLImport):
(WebCore::IconDatabase::syncThreadMainLoop):
(WebCore::IconDatabase::performPendingRetainAndReleaseOperations):
(WebCore::IconDatabase::readFromDatabase):
(WebCore::IconDatabase::writeToDatabase):
(WebCore::IconDatabase::pruneUnretainedIcons):
(WebCore::IconDatabase::cleanupSyncThread):
* loader/icon/IconDatabase.h:
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::shouldHandleWheelEventSynchronously):
(WebCore::ScrollingTree::commitNewTreeState):
(WebCore::ScrollingTree::setMainFramePinState):
(WebCore::ScrollingTree::mainFrameScrollPosition):
(WebCore::ScrollingTree::setMainFrameScrollPosition):
(WebCore::ScrollingTree::isPointInNonFastScrollableRegion):
(WebCore::ScrollingTree::isRubberBandInProgress):
(WebCore::ScrollingTree::setMainFrameIsRubberBanding):
(WebCore::ScrollingTree::isScrollSnapInProgress):
(WebCore::ScrollingTree::setMainFrameIsScrollSnapping):
(WebCore::ScrollingTree::setCanRubberBandState):
(WebCore::ScrollingTree::rubberBandsAtLeft):
(WebCore::ScrollingTree::rubberBandsAtRight):
(WebCore::ScrollingTree::rubberBandsAtBottom):
(WebCore::ScrollingTree::rubberBandsAtTop):
(WebCore::ScrollingTree::setScrollPinningBehavior):
(WebCore::ScrollingTree::scrollPinningBehavior):
(WebCore::ScrollingTree::willWheelEventStartSwipeGesture):
(WebCore::ScrollingTree::latchedNode):
(WebCore::ScrollingTree::setLatchedNode):
(WebCore::ScrollingTree::clearLatchedNode):
* page/scrolling/ScrollingTree.h:
* platform/MemoryPressureHandler.h:
* platform/audio/HRTFDatabaseLoader.cpp:
(WebCore::HRTFDatabaseLoader::loadAsynchronously):
(WebCore::HRTFDatabaseLoader::waitForLoaderThreadCompletion):
* platform/audio/HRTFDatabaseLoader.h:
* platform/cocoa/MemoryPressureHandlerCocoa.mm:
(WebCore::MemoryPressureHandler::setReceivedMemoryPressure):
(WebCore::MemoryPressureHandler::clearMemoryPressure):
(WebCore::MemoryPressureHandler::shouldWaitForMemoryClearMessage):
(WebCore::MemoryPressureHandler::respondToMemoryPressureIfNeeded):
* platform/graphics/DisplayRefreshMonitor.cpp:
(WebCore::DisplayRefreshMonitor::displayDidRefresh):
* platform/graphics/DisplayRefreshMonitor.h:
(WebCore::DisplayRefreshMonitor::setMonotonicAnimationStartTime):
(WebCore::DisplayRefreshMonitor::mutex):
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::setDelayCallbacks):
(WebCore::MediaPlayerPrivateAVFoundation::clearMainThreadPendingFlag):
(WebCore::MediaPlayerPrivateAVFoundation::dispatchNotification):
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::AVFWrapper::callbackContext):
(WebCore::AVFWrapper::~AVFWrapper):
(WebCore::AVFWrapper::mapLock):
(WebCore::AVFWrapper::addToMap):
(WebCore::AVFWrapper::removeFromMap):
(WebCore::AVFWrapper::periodicTimeObserverCallback):
(WebCore::AVFWrapper::processNotification):
(WebCore::AVFWrapper::loadPlayableCompletionCallback):
(WebCore::AVFWrapper::loadMetadataCompletionCallback):
(WebCore::AVFWrapper::seekCompletedCallback):
(WebCore::AVFWrapper::processCue):
(WebCore::AVFWrapper::legibleOutputCallback):
(WebCore::AVFWrapper::processShouldWaitForLoadingOfResource):
(WebCore::AVFWrapper::resourceLoaderShouldWaitForLoadingOfRequestedResource):
* platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp:
(WebCore::InbandTextTrackPrivateGStreamer::handleSample):
(WebCore::InbandTextTrackPrivateGStreamer::notifyTrackOfSample):
* platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h:
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
(WebCore::TrackPrivateBaseGStreamer::tagsChanged):
(WebCore::TrackPrivateBaseGStreamer::notifyTrackOfTagsChanged):
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
* platform/graphics/mac/DisplayRefreshMonitorMac.cpp:
(WebCore::DisplayRefreshMonitorMac::requestRefreshCallback):
(WebCore::DisplayRefreshMonitorMac::displayLinkFired):
* platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
(WebCore::MediaPlayerPrivateMediaFoundation::addListener):
(WebCore::MediaPlayerPrivateMediaFoundation::removeListener):
(WebCore::MediaPlayerPrivateMediaFoundation::notifyDeleted):
(WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::Invoke):
(WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::onMediaPlayerDeleted):
* platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
* platform/ios/LegacyTileCache.h:
* platform/ios/LegacyTileCache.mm:
(WebCore::LegacyTileCache::setTilesOpaque):
(WebCore::LegacyTileCache::doLayoutTiles):
(WebCore::LegacyTileCache::setCurrentScale):
(WebCore::LegacyTileCache::commitScaleChange):
(WebCore::LegacyTileCache::layoutTilesNow):
(WebCore::LegacyTileCache::layoutTilesNowForRect):
(WebCore::LegacyTileCache::removeAllNonVisibleTiles):
(WebCore::LegacyTileCache::removeAllTiles):
(WebCore::LegacyTileCache::removeForegroundTiles):
(WebCore::LegacyTileCache::setContentReplacementImage):
(WebCore::LegacyTileCache::contentReplacementImage):
(WebCore::LegacyTileCache::tileCreationTimerFired):
(WebCore::LegacyTileCache::setNeedsDisplayInRect):
(WebCore::LegacyTileCache::updateTilingMode):
(WebCore::LegacyTileCache::setTilingMode):
(WebCore::LegacyTileCache::doPendingRepaints):
(WebCore::LegacyTileCache::flushSavedDisplayRects):
(WebCore::LegacyTileCache::prepareToDraw):
* platform/ios/LegacyTileLayerPool.h:
* platform/ios/LegacyTileLayerPool.mm:
(WebCore::LegacyTileLayerPool::addLayer):
(WebCore::LegacyTileLayerPool::takeLayerWithSize):
(WebCore::LegacyTileLayerPool::setCapacity):
(WebCore::LegacyTileLayerPool::prune):
(WebCore::LegacyTileLayerPool::drain):
* platform/network/curl/CurlDownload.cpp:
(WebCore::CurlDownloadManager::add):
(WebCore::CurlDownloadManager::remove):
(WebCore::CurlDownloadManager::getActiveDownloadCount):
(WebCore::CurlDownloadManager::getPendingDownloadCount):
(WebCore::CurlDownloadManager::stopThreadIfIdle):
(WebCore::CurlDownloadManager::updateHandleList):
(WebCore::CurlDownload::~CurlDownload):
(WebCore::CurlDownload::init):
(WebCore::CurlDownload::getTempPath):
(WebCore::CurlDownload::getUrl):
(WebCore::CurlDownload::getResponse):
(WebCore::CurlDownload::closeFile):
(WebCore::CurlDownload::didReceiveHeader):
(WebCore::CurlDownload::didReceiveData):
(WebCore::CurlDownload::didFail):
* platform/network/curl/CurlDownload.h:
* platform/network/curl/ResourceHandleManager.cpp:
(WebCore::cookieJarPath):
(WebCore::sharedResourceMutex):
(WebCore::curl_lock_callback):
(WebCore::curl_unlock_callback):
* platform/network/ios/QuickLook.mm:
(WebCore::QLDirectoryAttributes):
(qlPreviewConverterDictionaryMutex):
(WebCore::addQLPreviewConverterWithFileForURL):
(WebCore::qlPreviewConverterUTIForURL):
(WebCore::removeQLPreviewConverterForURL):
(WebCore::safeQLURLForDocumentURLAndResourceURL):
* platform/sql/SQLiteDatabase.cpp:
(WebCore::SQLiteDatabase::close):
(WebCore::SQLiteDatabase::maximumSize):
(WebCore::SQLiteDatabase::setMaximumSize):
(WebCore::SQLiteDatabase::pageSize):
(WebCore::SQLiteDatabase::freeSpaceSize):
(WebCore::SQLiteDatabase::totalSize):
(WebCore::SQLiteDatabase::runIncrementalVacuumCommand):
(WebCore::SQLiteDatabase::setAuthorizer):
* platform/sql/SQLiteDatabase.h:
(WebCore::SQLiteDatabase::databaseMutex):
* platform/sql/SQLiteStatement.cpp:
(WebCore::SQLiteStatement::prepare):
(WebCore::SQLiteStatement::step):
* workers/WorkerThread.cpp:
(WebCore::WorkerThread::start):
(WebCore::WorkerThread::workerThread):
(WebCore::WorkerThread::stop):
* workers/WorkerThread.h:
Source/WebKit:
* Storage/StorageAreaSync.cpp:
(WebCore::StorageAreaSync::syncTimerFired):
(WebCore::StorageAreaSync::markImported):
(WebCore::StorageAreaSync::blockUntilImportComplete):
(WebCore::StorageAreaSync::performSync):
* Storage/StorageAreaSync.h:
* Storage/StorageTracker.cpp:
(WebCore::StorageTracker::setDatabaseDirectoryPath):
(WebCore::StorageTracker::finishedImportingOriginIdentifiers):
(WebCore::StorageTracker::syncImportOriginIdentifiers):
(WebCore::StorageTracker::syncFileSystemAndTrackerDatabase):
(WebCore::StorageTracker::setOriginDetails):
(WebCore::StorageTracker::syncSetOriginDetails):
(WebCore::StorageTracker::origins):
(WebCore::StorageTracker::deleteAllOrigins):
(WebCore::StorageTracker::syncDeleteAllOrigins):
(WebCore::StorageTracker::deleteOrigin):
(WebCore::StorageTracker::syncDeleteOrigin):
(WebCore::StorageTracker::canDeleteOrigin):
(WebCore::StorageTracker::cancelDeletingOrigin):
(WebCore::StorageTracker::diskUsageForOrigin):
* Storage/StorageTracker.h:
Source/WebKit/ios:
* WebCoreSupport/WebFixedPositionContent.mm:
(WebFixedPositionContentDataLock):
(-[WebFixedPositionContent scrollOrZoomChanged:]):
(-[WebFixedPositionContent overflowScrollPositionForLayer:changedTo:]):
(-[WebFixedPositionContent setViewportConstrainedLayers:stickyContainerMap:]):
(-[WebFixedPositionContent hasFixedOrStickyPositionLayers]):
(-[WebFixedPositionContent minimumOffsetFromFixedPositionLayersToAnchorEdge:ofRect:inLayer:]):
Source/WebKit/mac:
* Storage/WebDatabaseManager.mm:
(transactionBackgroundTaskIdentifierLock):
(+[WebDatabaseManager startBackgroundTask]):
(+[WebDatabaseManager endBackgroundTask]):
* WebView/WebView.mm:
(-[WebView _synchronizeCustomFixedPositionLayoutRect]):
(-[WebView _setCustomFixedPositionLayoutRectInWebThread:synchronize:]):
(-[WebView _setCustomFixedPositionLayoutRect:]):
(-[WebView _fetchCustomFixedPositionLayoutRect:]):
* WebView/WebViewData.h:
Source/WebKit/win:
* Plugins/PluginMainThreadScheduler.cpp:
(WebCore::PluginMainThreadScheduler::scheduleCall):
(WebCore::PluginMainThreadScheduler::registerPlugin):
(WebCore::PluginMainThreadScheduler::unregisterPlugin):
(WebCore::PluginMainThreadScheduler::dispatchCallsForPlugin):
* Plugins/PluginMainThreadScheduler.h:
* WebIconDatabase.cpp:
(WebIconDatabase::didRemoveAllIcons):
(WebIconDatabase::didImportIconURLForPageURL):
(WebIconDatabase::deliverNotifications):
* WebLocalizableStrings.cpp:
(mainBundleLocStrings):
(frameworkLocStringsMutex):
(findCachedString):
(cacheString):
Source/WebKit2:
* DatabaseProcess/DatabaseProcess.cpp:
(WebKit::DatabaseProcess::postDatabaseTask):
(WebKit::DatabaseProcess::performNextDatabaseTask):
* DatabaseProcess/DatabaseProcess.h:
* DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
(WebKit::UniqueIDBDatabase::shutdown):
(WebKit::UniqueIDBDatabase::postMainThreadTask):
(WebKit::UniqueIDBDatabase::performNextMainThreadTask):
(WebKit::UniqueIDBDatabase::postDatabaseTask):
(WebKit::UniqueIDBDatabase::performNextDatabaseTask):
* DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:
* Platform/IPC/Connection.cpp:
(IPC::Connection::sendSyncMessage):
(IPC::Connection::sendSyncMessageFromSecondaryThread):
(IPC::Connection::waitForSyncReply):
(IPC::Connection::processIncomingSyncReply):
(IPC::Connection::connectionDidClose):
* Platform/IPC/Connection.h:
* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
(WebKit::CoordinatedGraphicsScene::appendUpdate):
* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
(WebKit::ThreadedCompositor::createCompositingThread):
(WebKit::ThreadedCompositor::runCompositingThread):
(WebKit::ThreadedCompositor::terminateCompositingThread):
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
* Shared/Network/CustomProtocols/Cocoa/CustomProtocolManagerCocoa.mm:
(WebKit::CustomProtocolManager::addCustomProtocol):
(WebKit::CustomProtocolManager::removeCustomProtocol):
(WebKit::CustomProtocolManager::registerScheme):
(WebKit::CustomProtocolManager::unregisterScheme):
(WebKit::CustomProtocolManager::supportsScheme):
(WebKit::CustomProtocolManager::protocolForID):
* Shared/Network/CustomProtocols/CustomProtocolManager.h:
* Shared/linux/SeccompFilters/SeccompBroker.cpp:
* WebProcess/Plugins/PluginProcessConnectionManager.cpp:
(WebKit::PluginProcessConnectionManager::getPluginProcessConnection):
(WebKit::PluginProcessConnectionManager::removePluginProcessConnection):
(WebKit::PluginProcessConnectionManager::pluginProcessCrashed):
* WebProcess/Plugins/PluginProcessConnectionManager.h:
* WebProcess/WebPage/EventDispatcher.cpp:
(WebKit::EventDispatcher::addScrollingTreeForPage):
(WebKit::EventDispatcher::removeScrollingTreeForPage):
(WebKit::EventDispatcher::wheelEvent):
* WebProcess/WebPage/EventDispatcher.h:
* WebProcess/soup/WebKitSoupRequestInputStream.cpp:
(webkitSoupRequestInputStreamReadAsync):
(webkitSoupRequestInputStreamAddData):
Source/WTF:
* wtf/Atomics.cpp:
(WTF::getSwapLock):
(WTF::atomicStep):
* wtf/MessageQueue.h:
(WTF::MessageQueue::infiniteTime):
(WTF::MessageQueue<DataType>::append):
(WTF::MessageQueue<DataType>::appendAndKill):
(WTF::MessageQueue<DataType>::appendAndCheckEmpty):
(WTF::MessageQueue<DataType>::prepend):
(WTF::MessageQueue<DataType>::removeIf):
(WTF::MessageQueue<DataType>::isEmpty):
(WTF::MessageQueue<DataType>::kill):
(WTF::MessageQueue<DataType>::killed):
* wtf/ParallelJobsGeneric.cpp:
(WTF::ParallelEnvironment::ThreadPrivate::execute):
(WTF::ParallelEnvironment::ThreadPrivate::waitForFinish):
(WTF::ParallelEnvironment::ThreadPrivate::workerThread):
* wtf/ParallelJobsGeneric.h:
* wtf/RunLoop.cpp:
(WTF::RunLoop::performWork):
(WTF::RunLoop::dispatch):
* wtf/RunLoop.h:
* wtf/ThreadSpecificWin.cpp:
(WTF::destructorsList):
(WTF::destructorsMutex):
(WTF::threadSpecificKeyCreate):
(WTF::threadSpecificKeyDelete):
(WTF::ThreadSpecificThreadExit):
* wtf/Threading.cpp:
(WTF::threadEntryPoint):
(WTF::createThread):
* wtf/ThreadingPrimitives.h:
* wtf/ThreadingPthreads.cpp:
(WTF::threadMapMutex):
(WTF::initializeThreading):
(WTF::identifierByPthreadHandle):
(WTF::establishIdentifierForPthreadHandle):
(WTF::changeThreadPriority):
(WTF::waitForThreadCompletion):
(WTF::detachThread):
(WTF::threadDidExit):
(WTF::currentThread):
(WTF::Mutex::Mutex):
(WTF::Mutex::~Mutex):
(WTF::Mutex::lock):
(WTF::Mutex::tryLock):
(WTF::Mutex::unlock):
(WTF::ThreadCondition::~ThreadCondition):
(WTF::ThreadCondition::wait):
(WTF::ThreadCondition::timedWait):
(WTF::DeprecatedMutex::DeprecatedMutex): Deleted.
(WTF::DeprecatedMutex::~DeprecatedMutex): Deleted.
(WTF::DeprecatedMutex::lock): Deleted.
(WTF::DeprecatedMutex::tryLock): Deleted.
(WTF::DeprecatedMutex::unlock): Deleted.
* wtf/ThreadingWin.cpp:
(WTF::initializeCurrentThreadInternal):
(WTF::threadMapMutex):
(WTF::initializeThreading):
(WTF::storeThreadHandleByIdentifier):
(WTF::threadHandleForIdentifier):
(WTF::clearThreadHandleForIdentifier):
(WTF::currentThread):
(WTF::Mutex::Mutex):
(WTF::Mutex::~Mutex):
(WTF::Mutex::lock):
(WTF::Mutex::tryLock):
(WTF::Mutex::unlock):
(WTF::ThreadCondition::~ThreadCondition):
(WTF::ThreadCondition::wait):
(WTF::ThreadCondition::timedWait):
(WTF::DeprecatedMutex::DeprecatedMutex): Deleted.
(WTF::DeprecatedMutex::~DeprecatedMutex): Deleted.
(WTF::DeprecatedMutex::lock): Deleted.
(WTF::DeprecatedMutex::tryLock): Deleted.
(WTF::DeprecatedMutex::unlock): Deleted.
* wtf/WorkQueue.h:
* wtf/dtoa.cpp:
* wtf/dtoa.h:
* wtf/efl/DispatchQueueEfl.cpp:
(DispatchQueue::dispatch):
(DispatchQueue::performWork):
(DispatchQueue::performTimerWork):
(DispatchQueue::insertTimerWorkItem):
(DispatchQueue::wakeUpThread):
(DispatchQueue::getNextTimeOut):
* wtf/efl/DispatchQueueEfl.h:
* wtf/efl/RunLoopEfl.cpp:
(WTF::RunLoop::wakeUpEvent):
(WTF::RunLoop::wakeUp):
* wtf/threads/BinarySemaphore.cpp:
(WTF::BinarySemaphore::signal):
(WTF::BinarySemaphore::wait):
* wtf/threads/BinarySemaphore.h:
* wtf/win/WorkQueueWin.cpp:
(WTF::WorkQueue::handleCallback):
(WTF::WorkQueue::platformInvalidate):
(WTF::WorkQueue::dispatch):
(WTF::WorkQueue::timerCallback):
(WTF::WorkQueue::dispatchAfter):
Tools:
* DumpRenderTree/JavaScriptThreading.cpp:
(javaScriptThreadsMutex):
(runJavaScriptThread):
(startJavaScriptThreads):
(stopJavaScriptThreads):
* TestWebKitAPI/Tests/WTF/WorkQueue.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WTF/glib/WorkQueueGLib.cpp:
(TestWebKitAPI::TEST):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@188002
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2015-08-05 Filip Pizlo <fpizlo@apple.com>
+
+ Unreviewed, roll out http://trac.webkit.org/changeset/187972.
+
+ * bytecode/SamplingTool.cpp:
+ (JSC::SamplingTool::doRun):
+ (JSC::SamplingTool::notifyOfScope):
+ * bytecode/SamplingTool.h:
+ * dfg/DFGThreadData.h:
+ * dfg/DFGWorklist.cpp:
+ (JSC::DFG::Worklist::~Worklist):
+ (JSC::DFG::Worklist::isActiveForVM):
+ (JSC::DFG::Worklist::enqueue):
+ (JSC::DFG::Worklist::compilationState):
+ (JSC::DFG::Worklist::waitUntilAllPlansForVMAreReady):
+ (JSC::DFG::Worklist::removeAllReadyPlansForVM):
+ (JSC::DFG::Worklist::completeAllReadyPlansForVM):
+ (JSC::DFG::Worklist::visitWeakReferences):
+ (JSC::DFG::Worklist::removeDeadPlans):
+ (JSC::DFG::Worklist::queueLength):
+ (JSC::DFG::Worklist::dump):
+ (JSC::DFG::Worklist::runThread):
+ * dfg/DFGWorklist.h:
+ * disassembler/Disassembler.cpp:
+ * heap/CopiedSpace.cpp:
+ (JSC::CopiedSpace::doneFillingBlock):
+ (JSC::CopiedSpace::doneCopying):
+ * heap/CopiedSpace.h:
+ * heap/CopiedSpaceInlines.h:
+ (JSC::CopiedSpace::recycleBorrowedBlock):
+ (JSC::CopiedSpace::allocateBlockForCopyingPhase):
+ * heap/HeapTimer.h:
+ * heap/MachineStackMarker.cpp:
+ (JSC::ActiveMachineThreadsManager::Locker::Locker):
+ (JSC::ActiveMachineThreadsManager::add):
+ (JSC::ActiveMachineThreadsManager::remove):
+ (JSC::ActiveMachineThreadsManager::ActiveMachineThreadsManager):
+ (JSC::MachineThreads::~MachineThreads):
+ (JSC::MachineThreads::addCurrentThread):
+ (JSC::MachineThreads::removeThreadIfFound):
+ (JSC::MachineThreads::tryCopyOtherThreadStack):
+ (JSC::MachineThreads::tryCopyOtherThreadStacks):
+ (JSC::MachineThreads::gatherConservativeRoots):
+ * heap/MachineStackMarker.h:
+ * interpreter/JSStack.cpp:
+ (JSC::stackStatisticsMutex):
+ (JSC::JSStack::addToCommittedByteCount):
+ (JSC::JSStack::committedByteCount):
+ * jit/JITThunks.h:
+ * profiler/ProfilerDatabase.h:
+
2015-08-05 Saam barati <saambarati1@gmail.com>
Bytecodegenerator emits crappy code for returns in a lexical scope.
#if ENABLE(CODEBLOCK_SAMPLING)
if (CodeBlock* codeBlock = sample.codeBlock()) {
- DeprecatedMutexLocker locker(m_scriptSampleMapMutex);
+ MutexLocker locker(m_scriptSampleMapMutex);
ScriptSampleRecord* record = m_scopeSampleMap->get(codeBlock->ownerExecutable());
ASSERT(record);
record->sample(codeBlock, sample.vPC());
void SamplingTool::notifyOfScope(VM& vm, ScriptExecutable* script)
{
#if ENABLE(CODEBLOCK_SAMPLING)
- DeprecatedMutexLocker locker(m_scriptSampleMapMutex);
+ MutexLocker locker(m_scriptSampleMapMutex);
m_scopeSampleMap->set(script, adoptPtr(new ScriptSampleRecord(vm, script)));
#else
UNUSED_PARAM(vm);
unsigned m_opcodeSamplesInCTIFunctions[numOpcodeIDs];
#if ENABLE(CODEBLOCK_SAMPLING)
- DeprecatedMutex m_scriptSampleMapMutex;
+ Mutex m_scriptSampleMapMutex;
std::unique_ptr<ScriptSampleRecordMap> m_scopeSampleMap;
#endif
};
Worklist* m_worklist;
ThreadIdentifier m_identifier;
- DeprecatedMutex m_rightToRun;
+ Mutex m_rightToRun;
Safepoint* m_safepoint;
};
Worklist::~Worklist()
{
{
- DeprecatedMutexLocker locker(m_lock);
+ MutexLocker locker(m_lock);
for (unsigned i = m_threads.size(); i--;)
m_queue.append(nullptr); // Use null plan to indicate that we want the thread to terminate.
m_planEnqueued.broadcast();
bool Worklist::isActiveForVM(VM& vm) const
{
- DeprecatedMutexLocker locker(m_lock);
+ MutexLocker locker(m_lock);
PlanMap::const_iterator end = m_plans.end();
for (PlanMap::const_iterator iter = m_plans.begin(); iter != end; ++iter) {
if (&iter->value->vm == &vm)
void Worklist::enqueue(PassRefPtr<Plan> passedPlan)
{
RefPtr<Plan> plan = passedPlan;
- DeprecatedMutexLocker locker(m_lock);
+ MutexLocker locker(m_lock);
if (Options::verboseCompilationQueue()) {
dump(locker, WTF::dataFile());
dataLog(": Enqueueing plan to optimize ", plan->key(), "\n");
Worklist::State Worklist::compilationState(CompilationKey key)
{
- DeprecatedMutexLocker locker(m_lock);
+ MutexLocker locker(m_lock);
PlanMap::iterator iter = m_plans.find(key);
if (iter == m_plans.end())
return NotKnown;
// After we release this lock, we know that although other VMs may still
// be adding plans, our VM will not be.
- DeprecatedMutexLocker locker(m_lock);
+ MutexLocker locker(m_lock);
if (Options::verboseCompilationQueue()) {
dump(locker, WTF::dataFile());
void Worklist::removeAllReadyPlansForVM(VM& vm, Vector<RefPtr<Plan>, 8>& myReadyPlans)
{
DeferGC deferGC(vm.heap);
- DeprecatedMutexLocker locker(m_lock);
+ MutexLocker locker(m_lock);
for (size_t i = 0; i < m_readyPlans.size(); ++i) {
RefPtr<Plan> plan = m_readyPlans[i];
if (&plan->vm != &vm)
}
if (!!requestedKey && resultingState == NotKnown) {
- DeprecatedMutexLocker locker(m_lock);
+ MutexLocker locker(m_lock);
if (m_plans.contains(requestedKey))
resultingState = Compiling;
}
{
VM* vm = visitor.heap()->vm();
{
- DeprecatedMutexLocker locker(m_lock);
+ MutexLocker locker(m_lock);
for (PlanMap::iterator iter = m_plans.begin(); iter != m_plans.end(); ++iter) {
Plan* plan = iter->value.get();
if (&plan->vm != vm)
void Worklist::removeDeadPlans(VM& vm)
{
{
- DeprecatedMutexLocker locker(m_lock);
+ MutexLocker locker(m_lock);
HashSet<CompilationKey> deadPlanKeys;
for (PlanMap::iterator iter = m_plans.begin(); iter != m_plans.end(); ++iter) {
Plan* plan = iter->value.get();
size_t Worklist::queueLength()
{
- DeprecatedMutexLocker locker(m_lock);
+ MutexLocker locker(m_lock);
return m_queue.size();
}
void Worklist::dump(PrintStream& out) const
{
- DeprecatedMutexLocker locker(m_lock);
+ MutexLocker locker(m_lock);
dump(locker, out);
}
-void Worklist::dump(const DeprecatedMutexLocker&, PrintStream& out) const
+void Worklist::dump(const MutexLocker&, PrintStream& out) const
{
out.print(
"Worklist(", RawPointer(this), ")[Queue Length = ", m_queue.size(),
for (;;) {
RefPtr<Plan> plan;
{
- DeprecatedMutexLocker locker(m_lock);
+ MutexLocker locker(m_lock);
while (m_queue.isEmpty())
m_planEnqueued.wait(m_lock);
}
{
- DeprecatedMutexLocker locker(data->m_rightToRun);
+ MutexLocker locker(data->m_rightToRun);
{
- DeprecatedMutexLocker locker(m_lock);
+ MutexLocker locker(m_lock);
if (plan->stage == Plan::Cancelled) {
m_numberOfActiveThreads--;
continue;
RELEASE_ASSERT(!plan->vm.heap.isCollecting());
{
- DeprecatedMutexLocker locker(m_lock);
+ MutexLocker locker(m_lock);
if (plan->stage == Plan::Cancelled) {
m_numberOfActiveThreads--;
continue;
}
{
- DeprecatedMutexLocker locker(m_lock);
+ MutexLocker locker(m_lock);
// We could have been cancelled between releasing rightToRun and acquiring m_lock.
// This would mean that we might be in the middle of GC right now.
void removeAllReadyPlansForVM(VM&, Vector<RefPtr<Plan>, 8>&);
- void dump(const DeprecatedMutexLocker&, PrintStream&) const;
+ void dump(const MutexLocker&, PrintStream&) const;
CString m_threadName;
// be completed.
Vector<RefPtr<Plan>, 16> m_readyPlans;
- DeprecatedMutex m_suspensionLock;
+ Mutex m_suspensionLock;
- mutable DeprecatedMutex m_lock;
+ mutable Mutex m_lock;
ThreadCondition m_planEnqueued;
ThreadCondition m_planCompiled;
void enqueue(std::unique_ptr<DisassemblyTask> task)
{
- DeprecatedMutexLocker locker(m_lock);
+ MutexLocker locker(m_lock);
m_queue.append(WTF::move(task));
m_condition.broadcast();
}
void waitUntilEmpty()
{
- DeprecatedMutexLocker locker(m_lock);
+ MutexLocker locker(m_lock);
while (!m_queue.isEmpty() || m_working)
m_condition.wait(m_lock);
}
for (;;) {
std::unique_ptr<DisassemblyTask> task;
{
- DeprecatedMutexLocker locker(m_lock);
+ MutexLocker locker(m_lock);
m_working = false;
m_condition.broadcast();
while (m_queue.isEmpty())
}
}
- DeprecatedMutex m_lock;
+ Mutex m_lock;
ThreadCondition m_condition;
Deque<std::unique_ptr<DisassemblyTask>> m_queue;
bool m_working { false };
}
{
- DeprecatedMutexLocker locker(m_loanedBlocksLock);
+ MutexLocker locker(m_loanedBlocksLock);
ASSERT(m_numberOfLoanedBlocks > 0);
ASSERT(m_inCopyingPhase);
m_numberOfLoanedBlocks--;
void CopiedSpace::doneCopying()
{
{
- DeprecatedMutexLocker locker(m_loanedBlocksLock);
+ MutexLocker locker(m_loanedBlocksLock);
while (m_numberOfLoanedBlocks > 0)
m_loanedBlocksCondition.wait(m_loanedBlocksLock);
}
bool m_inCopyingPhase;
bool m_shouldDoCopyPhase;
- DeprecatedMutex m_loanedBlocksLock;
+ Mutex m_loanedBlocksLock;
ThreadCondition m_loanedBlocksCondition;
size_t m_numberOfLoanedBlocks;
CopiedBlock::destroy(block);
{
- DeprecatedMutexLocker locker(m_loanedBlocksLock);
+ MutexLocker locker(m_loanedBlocksLock);
ASSERT(m_numberOfLoanedBlocks > 0);
ASSERT(m_inCopyingPhase);
m_numberOfLoanedBlocks--;
CopiedBlock* block = CopiedBlock::createNoZeroFill();
{
- DeprecatedMutexLocker locker(m_loanedBlocksLock);
+ MutexLocker locker(m_loanedBlocksLock);
m_numberOfLoanedBlocks++;
}
RetainPtr<CFRunLoopRef> m_runLoop;
CFRunLoopTimerContext m_context;
- DeprecatedMutex m_shutdownMutex;
+ Mutex m_shutdownMutex;
#elif PLATFORM(EFL)
static bool timerEvent(void*);
Ecore_Timer* add(double delay, void* agent);
}
private:
- DeprecatedMutexLocker m_locker;
+ MutexLocker m_locker;
};
void add(MachineThreads* machineThreads)
{
- DeprecatedMutexLocker managerLock(m_lock);
+ MutexLocker managerLock(m_lock);
m_set.add(machineThreads);
}
void remove(MachineThreads* machineThreads)
{
- DeprecatedMutexLocker managerLock(m_lock);
+ MutexLocker managerLock(m_lock);
auto recordedMachineThreads = m_set.take(machineThreads);
RELEASE_ASSERT(recordedMachineThreads = machineThreads);
}
ActiveMachineThreadsManager() { }
- DeprecatedMutex m_lock;
+ Mutex m_lock;
MachineThreadsSet m_set;
friend ActiveMachineThreadsManager& activeMachineThreadsManager();
activeMachineThreadsManager().remove(this);
threadSpecificKeyDelete(m_threadSpecific);
- DeprecatedMutexLocker registeredThreadsLock(m_registeredThreadsMutex);
+ MutexLocker registeredThreadsLock(m_registeredThreadsMutex);
for (Thread* t = m_registeredThreads; t;) {
Thread* next = t->next;
delete t;
threadSpecificSet(m_threadSpecific, this);
Thread* thread = Thread::createForCurrentThread();
- DeprecatedMutexLocker lock(m_registeredThreadsMutex);
+ MutexLocker lock(m_registeredThreadsMutex);
thread->next = m_registeredThreads;
m_registeredThreads = thread;
template<typename PlatformThread>
void MachineThreads::removeThreadIfFound(PlatformThread platformThread)
{
- DeprecatedMutexLocker lock(m_registeredThreadsMutex);
+ MutexLocker lock(m_registeredThreadsMutex);
Thread* t = m_registeredThreads;
if (*t == platformThread) {
m_registeredThreads = m_registeredThreads->next;
thread->freeRegisters(registers);
}
-bool MachineThreads::tryCopyOtherThreadStacks(DeprecatedMutexLocker&, void* buffer, size_t capacity, size_t* size)
+bool MachineThreads::tryCopyOtherThreadStacks(MutexLocker&, void* buffer, size_t capacity, size_t* size)
{
// Prevent two VMs from suspending each other's threads at the same time,
// which can cause deadlock: <rdar://problem/20300842>.
size_t size;
size_t capacity = 0;
void* buffer = nullptr;
- DeprecatedMutexLocker lock(m_registeredThreadsMutex);
+ MutexLocker lock(m_registeredThreadsMutex);
while (!tryCopyOtherThreadStacks(lock, buffer, capacity, &size))
growBuffer(size, &buffer, &capacity);
void gatherFromCurrentThread(ConservativeRoots&, JITStubRoutineSet&, CodeBlockSet&, void* stackOrigin, void* stackTop, RegisterState& calleeSavedRegisters);
void tryCopyOtherThreadStack(Thread*, void*, size_t capacity, size_t*);
- bool tryCopyOtherThreadStacks(DeprecatedMutexLocker&, void*, size_t capacity, size_t*);
+ bool tryCopyOtherThreadStacks(MutexLocker&, void*, size_t capacity, size_t*);
static void removeThread(void*);
template<typename PlatformThread>
void removeThreadIfFound(PlatformThread);
- DeprecatedMutex m_registeredThreadsMutex;
+ Mutex m_registeredThreadsMutex;
Thread* m_registeredThreads;
WTF::ThreadSpecificKey m_threadSpecific;
#if !ASSERT_DISABLED
#if !ENABLE(JIT)
static size_t committedBytesCount = 0;
-static DeprecatedMutex& stackStatisticsMutex()
+static Mutex& stackStatisticsMutex()
{
- DEPRECATED_DEFINE_STATIC_LOCAL(DeprecatedMutex, staticMutex, ());
+ DEPRECATED_DEFINE_STATIC_LOCAL(Mutex, staticMutex, ());
return staticMutex;
}
#endif // !ENABLE(JIT)
void JSStack::addToCommittedByteCount(long byteCount)
{
- DeprecatedMutexLocker locker(stackStatisticsMutex());
+ MutexLocker locker(stackStatisticsMutex());
ASSERT(static_cast<long>(committedBytesCount) + byteCount > -1);
committedBytesCount += byteCount;
}
size_t JSStack::committedByteCount()
{
#if !ENABLE(JIT)
- DeprecatedMutexLocker locker(stackStatisticsMutex());
+ MutexLocker locker(stackStatisticsMutex());
return committedBytesCount;
#else
// When using the C stack, we don't know how many stack pages are actually
private:
// Main thread can hold this lock for a while, so use an adaptive mutex.
- typedef DeprecatedMutex Lock;
- typedef DeprecatedMutexLocker Locker;
+ typedef Mutex Lock;
+ typedef MutexLocker Locker;
void finalize(Handle<Unknown>, void* context) override;
// performance, but if we did have contention, we would want a sensible,
// power-aware backoff. An adaptive mutex will do this as a matter of course,
// but a spinlock won't.
- typedef DeprecatedMutex Lock;
- typedef DeprecatedMutexLocker Locker;
+ typedef Mutex Lock;
+ typedef MutexLocker Locker;
void addDatabaseToAtExit();
2015-08-05 Filip Pizlo <fpizlo@apple.com>
+ Unreviewed, roll out http://trac.webkit.org/changeset/187972.
+
+ * wtf/Atomics.cpp:
+ (WTF::getSwapLock):
+ (WTF::atomicStep):
+ * wtf/MessageQueue.h:
+ (WTF::MessageQueue::infiniteTime):
+ (WTF::MessageQueue<DataType>::append):
+ (WTF::MessageQueue<DataType>::appendAndKill):
+ (WTF::MessageQueue<DataType>::appendAndCheckEmpty):
+ (WTF::MessageQueue<DataType>::prepend):
+ (WTF::MessageQueue<DataType>::removeIf):
+ (WTF::MessageQueue<DataType>::isEmpty):
+ (WTF::MessageQueue<DataType>::kill):
+ (WTF::MessageQueue<DataType>::killed):
+ * wtf/ParallelJobsGeneric.cpp:
+ (WTF::ParallelEnvironment::ThreadPrivate::execute):
+ (WTF::ParallelEnvironment::ThreadPrivate::waitForFinish):
+ (WTF::ParallelEnvironment::ThreadPrivate::workerThread):
+ * wtf/ParallelJobsGeneric.h:
+ * wtf/RunLoop.cpp:
+ (WTF::RunLoop::performWork):
+ (WTF::RunLoop::dispatch):
+ * wtf/RunLoop.h:
+ * wtf/ThreadSpecificWin.cpp:
+ (WTF::destructorsList):
+ (WTF::destructorsMutex):
+ (WTF::threadSpecificKeyCreate):
+ (WTF::threadSpecificKeyDelete):
+ (WTF::ThreadSpecificThreadExit):
+ * wtf/Threading.cpp:
+ (WTF::threadEntryPoint):
+ (WTF::createThread):
+ * wtf/ThreadingPrimitives.h:
+ * wtf/ThreadingPthreads.cpp:
+ (WTF::threadMapMutex):
+ (WTF::initializeThreading):
+ (WTF::identifierByPthreadHandle):
+ (WTF::establishIdentifierForPthreadHandle):
+ (WTF::changeThreadPriority):
+ (WTF::waitForThreadCompletion):
+ (WTF::detachThread):
+ (WTF::threadDidExit):
+ (WTF::currentThread):
+ (WTF::Mutex::Mutex):
+ (WTF::Mutex::~Mutex):
+ (WTF::Mutex::lock):
+ (WTF::Mutex::tryLock):
+ (WTF::Mutex::unlock):
+ (WTF::ThreadCondition::~ThreadCondition):
+ (WTF::ThreadCondition::wait):
+ (WTF::ThreadCondition::timedWait):
+ (WTF::DeprecatedMutex::DeprecatedMutex): Deleted.
+ (WTF::DeprecatedMutex::~DeprecatedMutex): Deleted.
+ (WTF::DeprecatedMutex::lock): Deleted.
+ (WTF::DeprecatedMutex::tryLock): Deleted.
+ (WTF::DeprecatedMutex::unlock): Deleted.
+ * wtf/ThreadingWin.cpp:
+ (WTF::initializeCurrentThreadInternal):
+ (WTF::threadMapMutex):
+ (WTF::initializeThreading):
+ (WTF::storeThreadHandleByIdentifier):
+ (WTF::threadHandleForIdentifier):
+ (WTF::clearThreadHandleForIdentifier):
+ (WTF::currentThread):
+ (WTF::Mutex::Mutex):
+ (WTF::Mutex::~Mutex):
+ (WTF::Mutex::lock):
+ (WTF::Mutex::tryLock):
+ (WTF::Mutex::unlock):
+ (WTF::ThreadCondition::~ThreadCondition):
+ (WTF::ThreadCondition::wait):
+ (WTF::ThreadCondition::timedWait):
+ (WTF::DeprecatedMutex::DeprecatedMutex): Deleted.
+ (WTF::DeprecatedMutex::~DeprecatedMutex): Deleted.
+ (WTF::DeprecatedMutex::lock): Deleted.
+ (WTF::DeprecatedMutex::tryLock): Deleted.
+ (WTF::DeprecatedMutex::unlock): Deleted.
+ * wtf/WorkQueue.h:
+ * wtf/dtoa.cpp:
+ * wtf/dtoa.h:
+ * wtf/efl/DispatchQueueEfl.cpp:
+ (DispatchQueue::dispatch):
+ (DispatchQueue::performWork):
+ (DispatchQueue::performTimerWork):
+ (DispatchQueue::insertTimerWorkItem):
+ (DispatchQueue::wakeUpThread):
+ (DispatchQueue::getNextTimeOut):
+ * wtf/efl/DispatchQueueEfl.h:
+ * wtf/efl/RunLoopEfl.cpp:
+ (WTF::RunLoop::wakeUpEvent):
+ (WTF::RunLoop::wakeUp):
+ * wtf/threads/BinarySemaphore.cpp:
+ (WTF::BinarySemaphore::signal):
+ (WTF::BinarySemaphore::wait):
+ * wtf/threads/BinarySemaphore.h:
+ * wtf/win/WorkQueueWin.cpp:
+ (WTF::WorkQueue::handleCallback):
+ (WTF::WorkQueue::platformInvalidate):
+ (WTF::WorkQueue::dispatch):
+ (WTF::WorkQueue::timerCallback):
+ (WTF::WorkQueue::dispatchAfter):
+
+2015-08-05 Filip Pizlo <fpizlo@apple.com>
+
Unreviewed, fix Windows.
* wtf/ThreadSpecificWin.cpp:
namespace WTF {
static const size_t kSwapLockCount = 32;
-static DeprecatedMutex s_swapLocks[kSwapLockCount];
+static Mutex s_swapLocks[kSwapLockCount];
-static inline DeprecatedMutex& getSwapLock(const volatile int64_t* addr)
+static inline Mutex& getSwapLock(const volatile int64_t* addr)
{
return s_swapLocks[(reinterpret_cast<intptr_t>(addr) >> 3U) % kSwapLockCount];
}
static int64_t atomicStep(int64_t volatile* addend, int64_t step)
{
- DeprecatedMutex& mutex = getSwapLock(addend);
+ Mutex& mutex = getSwapLock(addend);
mutex.lock();
int64_t value = *addend + step;
static double infiniteTime() { return std::numeric_limits<double>::max(); }
private:
- mutable DeprecatedMutex m_mutex;
+ mutable Mutex m_mutex;
ThreadCondition m_condition;
Deque<std::unique_ptr<DataType>> m_queue;
bool m_killed;
template<typename DataType>
inline void MessageQueue<DataType>::append(std::unique_ptr<DataType> message)
{
- DeprecatedMutexLocker lock(m_mutex);
+ MutexLocker lock(m_mutex);
m_queue.append(WTF::move(message));
m_condition.signal();
}
template<typename DataType>
inline void MessageQueue<DataType>::appendAndKill(std::unique_ptr<DataType> message)
{
- DeprecatedMutexLocker lock(m_mutex);
+ MutexLocker lock(m_mutex);
m_queue.append(WTF::move(message));
m_killed = true;
m_condition.broadcast();
template<typename DataType>
inline bool MessageQueue<DataType>::appendAndCheckEmpty(std::unique_ptr<DataType> message)
{
- DeprecatedMutexLocker lock(m_mutex);
+ MutexLocker lock(m_mutex);
bool wasEmpty = m_queue.isEmpty();
m_queue.append(WTF::move(message));
m_condition.signal();
template<typename DataType>
inline void MessageQueue<DataType>::prepend(std::unique_ptr<DataType> message)
{
- DeprecatedMutexLocker lock(m_mutex);
+ MutexLocker lock(m_mutex);
m_queue.prepend(WTF::move(message));
m_condition.signal();
}
template<typename Predicate>
inline auto MessageQueue<DataType>::waitForMessageFilteredWithTimeout(MessageQueueWaitResult& result, Predicate&& predicate, double absoluteTime) -> std::unique_ptr<DataType>
{
- DeprecatedMutexLocker lock(m_mutex);
+ MutexLocker lock(m_mutex);
bool timedOut = false;
auto found = m_queue.end();
template<typename DataType>
inline auto MessageQueue<DataType>::tryGetMessage() -> std::unique_ptr<DataType>
{
- DeprecatedMutexLocker lock(m_mutex);
+ MutexLocker lock(m_mutex);
if (m_killed)
return nullptr;
if (m_queue.isEmpty())
template<typename DataType>
inline auto MessageQueue<DataType>::tryGetMessageIgnoringKilled() -> std::unique_ptr<DataType>
{
- DeprecatedMutexLocker lock(m_mutex);
+ MutexLocker lock(m_mutex);
if (m_queue.isEmpty())
return nullptr;
template<typename Predicate>
inline void MessageQueue<DataType>::removeIf(Predicate&& predicate)
{
- DeprecatedMutexLocker lock(m_mutex);
+ MutexLocker lock(m_mutex);
while (true) {
auto found = m_queue.findIf([&predicate](const std::unique_ptr<DataType>& ptr) -> bool {
ASSERT(ptr);
template<typename DataType>
inline bool MessageQueue<DataType>::isEmpty()
{
- DeprecatedMutexLocker lock(m_mutex);
+ MutexLocker lock(m_mutex);
if (m_killed)
return true;
return m_queue.isEmpty();
template<typename DataType>
inline void MessageQueue<DataType>::kill()
{
- DeprecatedMutexLocker lock(m_mutex);
+ MutexLocker lock(m_mutex);
m_killed = true;
m_condition.broadcast();
}
template<typename DataType>
inline bool MessageQueue<DataType>::killed() const
{
- DeprecatedMutexLocker lock(m_mutex);
+ MutexLocker lock(m_mutex);
return m_killed;
}
} // namespace WTF
void ParallelEnvironment::ThreadPrivate::execute(ThreadFunction threadFunction, void* parameters)
{
- DeprecatedMutexLocker lock(m_mutex);
+ MutexLocker lock(m_mutex);
m_threadFunction = threadFunction;
m_parameters = parameters;
void ParallelEnvironment::ThreadPrivate::waitForFinish()
{
- DeprecatedMutexLocker lock(m_mutex);
+ MutexLocker lock(m_mutex);
while (m_running)
m_threadCondition.wait(m_mutex);
void ParallelEnvironment::ThreadPrivate::workerThread(void* threadData)
{
ThreadPrivate* sharedThread = reinterpret_cast<ThreadPrivate*>(threadData);
- DeprecatedMutexLocker lock(sharedThread->m_mutex);
+ MutexLocker lock(sharedThread->m_mutex);
while (sharedThread->m_threadID) {
if (sharedThread->m_running) {
bool m_running;
ParallelEnvironment* m_parent;
- mutable DeprecatedMutex m_mutex;
+ mutable Mutex m_mutex;
ThreadCondition m_threadCondition;
ThreadFunction m_threadFunction;
{
std::function<void()> function;
{
- DeprecatedMutexLocker locker(m_functionQueueLock);
+ MutexLocker locker(m_functionQueueLock);
functionsToHandle = m_functionQueue.size();
if (m_functionQueue.isEmpty())
for (size_t functionsHandled = 1; functionsHandled < functionsToHandle; ++functionsHandled) {
std::function<void()> function;
{
- DeprecatedMutexLocker locker(m_functionQueueLock);
+ MutexLocker locker(m_functionQueueLock);
// Even if we start off with N functions to handle and we've only handled less than N functions, the queue
// still might be empty because those functions might have been handled in an inner RunLoop::performWork().
void RunLoop::dispatch(std::function<void ()> function)
{
{
- DeprecatedMutexLocker locker(m_functionQueueLock);
+ MutexLocker locker(m_functionQueueLock);
m_functionQueue.append(WTF::move(function));
}
void performWork();
- DeprecatedMutex m_functionQueueLock;
+ Mutex m_functionQueueLock;
Deque<std::function<void ()>> m_functionQueue;
#if PLATFORM(WIN)
RetainPtr<CFRunLoopSourceRef> m_runLoopSource;
int m_nestingLevel;
#elif PLATFORM(EFL)
- DeprecatedMutex m_pipeLock;
+ Mutex m_pipeLock;
EflUniquePtr<Ecore_Pipe> m_pipe;
- DeprecatedMutex m_wakeUpEventRequestedLock;
+ Mutex m_wakeUpEventRequestedLock;
bool m_wakeUpEventRequested;
static void wakeUpEvent(void* data, void*, unsigned);
return staticList;
}
-static DeprecatedMutex& destructorsMutex()
+static Mutex& destructorsMutex()
{
- static DeprecatedMutex staticMutex;
+ static Mutex staticMutex;
return staticMutex;
}
*key = static_cast<PlatformThreadSpecificKey*>(::malloc(sizeof(PlatformThreadSpecificKey)));
new (*key) PlatformThreadSpecificKey(destructor);
- DeprecatedMutexLocker locker(destructorsMutex());
+ MutexLocker locker(destructorsMutex());
destructorsList().push(*key);
}
void threadSpecificKeyDelete(ThreadSpecificKey key)
{
- DeprecatedMutexLocker locker(destructorsMutex());
+ MutexLocker locker(destructorsMutex());
destructorsList().remove(key);
key->~PlatformThreadSpecificKey();
::free(key);
data->destructor(data);
}
- DeprecatedMutexLocker locker(destructorsMutex());
+ MutexLocker locker(destructorsMutex());
PlatformThreadSpecificKey* key = destructorsList().head();
while (key) {
PlatformThreadSpecificKey* nextKey = key->next();
public:
const char* name;
std::function<void()> entryPoint;
- DeprecatedMutex creationMutex;
+ Mutex creationMutex;
};
static void threadEntryPoint(void* contextData)
// Block until our creating thread has completed any extra setup work, including
// establishing ThreadIdentifier.
{
- DeprecatedMutexLocker locker(context->creationMutex);
+ MutexLocker locker(context->creationMutex);
}
initializeCurrentThreadInternal(context->name);
NewThreadContext* context = new NewThreadContext { name, WTF::move(entryPoint), { } };
// Prevent the thread body from executing until we've established the thread identifier.
- DeprecatedMutexLocker locker(context->creationMutex);
+ MutexLocker locker(context->creationMutex);
return createThreadInternal(threadEntryPoint, context, name);
}
typedef void* PlatformCondition;
#endif
-class DeprecatedMutex {
- WTF_MAKE_NONCOPYABLE(DeprecatedMutex); WTF_MAKE_FAST_ALLOCATED;
+class Mutex {
+ WTF_MAKE_NONCOPYABLE(Mutex); WTF_MAKE_FAST_ALLOCATED;
public:
- WTF_EXPORT_PRIVATE DeprecatedMutex();
- WTF_EXPORT_PRIVATE ~DeprecatedMutex();
+ WTF_EXPORT_PRIVATE Mutex();
+ WTF_EXPORT_PRIVATE ~Mutex();
WTF_EXPORT_PRIVATE void lock();
WTF_EXPORT_PRIVATE bool tryLock();
PlatformMutex m_mutex;
};
-typedef Locker<DeprecatedMutex> DeprecatedMutexLocker;
+typedef Locker<Mutex> MutexLocker;
class ThreadCondition {
WTF_MAKE_NONCOPYABLE(ThreadCondition);
WTF_EXPORT_PRIVATE ThreadCondition();
WTF_EXPORT_PRIVATE ~ThreadCondition();
- WTF_EXPORT_PRIVATE void wait(DeprecatedMutex&);
+ WTF_EXPORT_PRIVATE void wait(Mutex& mutex);
// Returns true if the condition was signaled before absoluteTime, false if the absoluteTime was reached or is in the past.
// The absoluteTime is in seconds, starting on January 1, 1970. The time is assumed to use the same time zone as WTF::currentTime().
- WTF_EXPORT_PRIVATE bool timedWait(DeprecatedMutex&, double absoluteTime);
+ WTF_EXPORT_PRIVATE bool timedWait(Mutex&, double absoluteTime);
WTF_EXPORT_PRIVATE void signal();
WTF_EXPORT_PRIVATE void broadcast();
} // namespace WTF
-using WTF::DeprecatedMutex;
-using WTF::DeprecatedMutexLocker;
+using WTF::Mutex;
+using WTF::MutexLocker;
using WTF::ThreadCondition;
#if OS(WINDOWS)
void threadDidExit(ThreadIdentifier);
void threadWasJoined(ThreadIdentifier);
-static DeprecatedMutex& threadMapMutex()
+static Mutex& threadMapMutex()
{
- DEPRECATED_DEFINE_STATIC_LOCAL(DeprecatedMutex, mutex, ());
+ DEPRECATED_DEFINE_STATIC_LOCAL(Mutex, mutex, ());
return mutex;
}
ThreadIdentifierData::initializeOnce();
StackStats::initialize();
wtfThreadData();
- s_dtoaP5Mutex = new DeprecatedMutex;
+ s_dtoaP5Mutex = new Mutex;
initializeDates();
}
static ThreadIdentifier identifierByPthreadHandle(const pthread_t& pthreadHandle)
{
- DeprecatedMutexLocker locker(threadMapMutex());
+ MutexLocker locker(threadMapMutex());
ThreadMap::iterator i = threadMap().begin();
for (; i != threadMap().end(); ++i) {
static ThreadIdentifier establishIdentifierForPthreadHandle(const pthread_t& pthreadHandle)
{
ASSERT(!identifierByPthreadHandle(pthreadHandle));
- DeprecatedMutexLocker locker(threadMapMutex());
+ MutexLocker locker(threadMapMutex());
static ThreadIdentifier identifierCount = 1;
threadMap().add(identifierCount, std::make_unique<PthreadState>(pthreadHandle));
return identifierCount++;
ASSERT(threadID);
{
- DeprecatedMutexLocker locker(threadMapMutex());
+ MutexLocker locker(threadMapMutex());
pthreadHandle = pthreadHandleForIdentifierWithLockAlreadyHeld(threadID);
ASSERT(pthreadHandle);
}
{
// We don't want to lock across the call to join, since that can block our thread and cause deadlock.
- DeprecatedMutexLocker locker(threadMapMutex());
+ MutexLocker locker(threadMapMutex());
pthreadHandle = pthreadHandleForIdentifierWithLockAlreadyHeld(threadID);
ASSERT(pthreadHandle);
}
else if (joinResult)
LOG_ERROR("ThreadIdentifier %u was unable to be joined.\n", threadID);
- DeprecatedMutexLocker locker(threadMapMutex());
+ MutexLocker locker(threadMapMutex());
PthreadState* state = threadMap().get(threadID);
ASSERT(state);
ASSERT(state->joinableState() == PthreadState::Joinable);
{
ASSERT(threadID);
- DeprecatedMutexLocker locker(threadMapMutex());
+ MutexLocker locker(threadMapMutex());
pthread_t pthreadHandle = pthreadHandleForIdentifierWithLockAlreadyHeld(threadID);
ASSERT(pthreadHandle);
void threadDidExit(ThreadIdentifier threadID)
{
- DeprecatedMutexLocker locker(threadMapMutex());
+ MutexLocker locker(threadMapMutex());
PthreadState* state = threadMap().get(threadID);
ASSERT(state);
return id;
}
-DeprecatedMutex::DeprecatedMutex()
+Mutex::Mutex()
{
pthread_mutexattr_t attr;
pthread_mutexattr_init(&attr);
pthread_mutexattr_destroy(&attr);
}
-DeprecatedMutex::~DeprecatedMutex()
+Mutex::~Mutex()
{
int result = pthread_mutex_destroy(&m_mutex);
ASSERT_UNUSED(result, !result);
}
-void DeprecatedMutex::lock()
+void Mutex::lock()
{
int result = pthread_mutex_lock(&m_mutex);
ASSERT_UNUSED(result, !result);
}
-bool DeprecatedMutex::tryLock()
+bool Mutex::tryLock()
{
int result = pthread_mutex_trylock(&m_mutex);
return false;
}
-void DeprecatedMutex::unlock()
+void Mutex::unlock()
{
int result = pthread_mutex_unlock(&m_mutex);
ASSERT_UNUSED(result, !result);
pthread_cond_destroy(&m_condition);
}
-void ThreadCondition::wait(DeprecatedMutex& mutex)
+void ThreadCondition::wait(Mutex& mutex)
{
int result = pthread_cond_wait(&m_condition, &mutex.impl());
ASSERT_UNUSED(result, !result);
}
-bool ThreadCondition::timedWait(DeprecatedMutex& mutex, double absoluteTime)
+bool ThreadCondition::timedWait(Mutex& mutex, double absoluteTime)
{
if (absoluteTime < currentTime())
return false;
#endif
}
-static DeprecatedMutex& threadMapMutex()
+static Mutex& threadMapMutex()
{
- static DeprecatedMutex mutex;
+ static Mutex mutex;
return mutex;
}
threadMapMutex();
initializeRandomNumberGenerator();
wtfThreadData();
- s_dtoaP5Mutex = new DeprecatedMutex;
+ s_dtoaP5Mutex = new Mutex;
initializeDates();
}
static void storeThreadHandleByIdentifier(DWORD threadID, HANDLE threadHandle)
{
- DeprecatedMutexLocker locker(threadMapMutex());
+ MutexLocker locker(threadMapMutex());
ASSERT(!threadMap().contains(threadID));
threadMap().add(threadID, threadHandle);
}
static HANDLE threadHandleForIdentifier(ThreadIdentifier id)
{
- DeprecatedMutexLocker locker(threadMapMutex());
+ MutexLocker locker(threadMapMutex());
return threadMap().get(id);
}
static void clearThreadHandleForIdentifier(ThreadIdentifier id)
{
- DeprecatedMutexLocker locker(threadMapMutex());
+ MutexLocker locker(threadMapMutex());
ASSERT(threadMap().contains(id));
threadMap().remove(id);
}
return static_cast<ThreadIdentifier>(GetCurrentThreadId());
}
-DeprecatedMutex::DeprecatedMutex()
+Mutex::Mutex()
{
m_mutex.m_recursionCount = 0;
InitializeCriticalSection(&m_mutex.m_internalMutex);
}
-DeprecatedMutex::~DeprecatedMutex()
+Mutex::~Mutex()
{
DeleteCriticalSection(&m_mutex.m_internalMutex);
}
-void DeprecatedMutex::lock()
+void Mutex::lock()
{
EnterCriticalSection(&m_mutex.m_internalMutex);
++m_mutex.m_recursionCount;
}
#pragma warning(suppress: 26115)
-bool DeprecatedMutex::tryLock()
+bool Mutex::tryLock()
{
// This method is modeled after the behavior of pthread_mutex_trylock,
// which will return an error if the lock is already owned by the
return false;
}
-void DeprecatedMutex::unlock()
+void Mutex::unlock()
{
ASSERT(m_mutex.m_recursionCount);
--m_mutex.m_recursionCount;
CloseHandle(m_condition.m_unblockLock);
}
-void ThreadCondition::wait(DeprecatedMutex& mutex)
+void ThreadCondition::wait(Mutex& mutex)
{
m_condition.timedWait(mutex.impl(), INFINITE);
}
-bool ThreadCondition::timedWait(DeprecatedMutex& mutex, double absoluteTime)
+bool ThreadCondition::timedWait(Mutex& mutex, double absoluteTime)
{
DWORD interval = absoluteTimeToWaitTimeoutInterval(absoluteTime);
#elif OS(WINDOWS)
volatile LONG m_isWorkThreadRegistered;
- DeprecatedMutex m_workItemQueueLock;
+ Mutex m_workItemQueueLock;
Vector<RefPtr<WorkItemWin>> m_workItemQueue;
- DeprecatedMutex m_handlesLock;
+ Mutex m_handlesLock;
HashMap<HANDLE, RefPtr<HandleWorkItem>> m_handles;
HANDLE m_timerQueue;
namespace WTF {
-DeprecatedMutex* s_dtoaP5Mutex;
+Mutex* s_dtoaP5Mutex;
typedef union {
double d;
namespace WTF {
-class DeprecatedMutex;
+class Mutex;
-extern DeprecatedMutex* s_dtoaP5Mutex;
+extern Mutex* s_dtoaP5Mutex;
typedef char DtoaBuffer[80];
void DispatchQueue::dispatch(std::unique_ptr<WorkItem> item)
{
{
- DeprecatedMutexLocker locker(m_workItemsLock);
+ MutexLocker locker(m_workItemsLock);
m_workItems.append(WTF::move(item));
}
Vector<std::unique_ptr<WorkItem>> workItems;
{
- DeprecatedMutexLocker locker(m_workItemsLock);
+ MutexLocker locker(m_workItemsLock);
if (m_workItems.isEmpty())
return;
{
// Protects m_timerWorkItems.
- DeprecatedMutexLocker locker(m_timerWorkItemsLock);
+ MutexLocker locker(m_timerWorkItemsLock);
if (m_timerWorkItems.isEmpty())
return;
size_t position = 0;
- DeprecatedMutexLocker locker(m_timerWorkItemsLock);
+ MutexLocker locker(m_timerWorkItemsLock);
// The items should be ordered by expire time.
for (; position < m_timerWorkItems.size(); ++position)
if (item->expirationTimeNanoSeconds() < m_timerWorkItems[position]->expirationTimeNanoSeconds())
void DispatchQueue::wakeUpThread()
{
- DeprecatedMutexLocker locker(m_writeToPipeDescriptorLock);
+ MutexLocker locker(m_writeToPipeDescriptorLock);
if (write(m_writeToPipeDescriptor, &wakeUpThreadMessage, sizeof(char)) == -1)
LOG_ERROR("Failed to wake up DispatchQueue Thread");
}
timeval* DispatchQueue::getNextTimeOut() const
{
- DeprecatedMutexLocker locker(m_timerWorkItemsLock);
+ MutexLocker locker(m_timerWorkItemsLock);
if (m_timerWorkItems.isEmpty())
return 0;
int m_maxFileDescriptor;
int m_readFromPipeDescriptor;
int m_writeToPipeDescriptor;
- DeprecatedMutex m_writeToPipeDescriptorLock;
+ Mutex m_writeToPipeDescriptorLock;
bool m_isThreadRunning;
std::function<void ()> m_socketEventHandler;
Vector<std::unique_ptr<WorkItem>> m_workItems;
- DeprecatedMutex m_workItemsLock;
+ Mutex m_workItemsLock;
Vector<std::unique_ptr<TimerWorkItem>> m_timerWorkItems;
- mutable DeprecatedMutex m_timerWorkItemsLock;
+ mutable Mutex m_timerWorkItemsLock;
};
#endif // DispatchQueueEfl_h
RunLoop* loop = static_cast<RunLoop*>(data);
{
- DeprecatedMutexLocker locker(loop->m_wakeUpEventRequestedLock);
+ MutexLocker locker(loop->m_wakeUpEventRequestedLock);
loop->m_wakeUpEventRequested = false;
}
void RunLoop::wakeUp()
{
{
- DeprecatedMutexLocker locker(m_wakeUpEventRequestedLock);
+ MutexLocker locker(m_wakeUpEventRequestedLock);
if (m_wakeUpEventRequested)
return;
m_wakeUpEventRequested = true;
}
{
- DeprecatedMutexLocker locker(m_pipeLock);
+ MutexLocker locker(m_pipeLock);
ecore_pipe_write(m_pipe.get(), wakupEcorePipeMessage, ecorePipeMessageSize);
}
}
void BinarySemaphore::signal()
{
- DeprecatedMutexLocker locker(m_mutex);
+ MutexLocker locker(m_mutex);
m_isSet = true;
m_condition.signal();
bool BinarySemaphore::wait(double absoluteTime)
{
- DeprecatedMutexLocker locker(m_mutex);
+ MutexLocker locker(m_mutex);
bool timedOut = false;
while (!m_isSet) {
private:
bool m_isSet;
- DeprecatedMutex m_mutex;
+ Mutex m_mutex;
ThreadCondition m_condition;
};
RefPtr<WorkQueue> queue = item->queue();
{
- DeprecatedMutexLocker lock(queue->m_workItemQueueLock);
+ MutexLocker lock(queue->m_workItemQueueLock);
queue->m_workItemQueue.append(item);
// If no other thread is performing work, we can do it on this thread.
void WorkQueue::platformInvalidate()
{
#if !ASSERT_DISABLED
- DeprecatedMutexLocker lock(m_handlesLock);
+ MutexLocker lock(m_handlesLock);
ASSERT(m_handles.isEmpty());
#endif
void WorkQueue::dispatch(std::function<void()> function)
{
- DeprecatedMutexLocker locker(m_workItemQueueLock);
+ MutexLocker locker(m_workItemQueueLock);
ref();
m_workItemQueue.append(WorkItemWin::create(function, this));
WorkQueue* queue;
std::function<void()> function;
- DeprecatedMutex timerMutex;
+ Mutex timerMutex;
HANDLE timer;
private:
timerContext->queue->dispatch(timerContext->function);
- DeprecatedMutexLocker lock(timerContext->timerMutex);
+ MutexLocker lock(timerContext->timerMutex);
ASSERT(timerContext->timer);
ASSERT(timerContext->queue->m_timerQueue);
if (!::DeleteTimerQueueTimer(timerContext->queue->m_timerQueue, timerContext->timer, 0)) {
// The timer callback could fire before ::CreateTimerQueueTimer even returns, so we protect
// context->timer with a mutex to ensure the timer callback doesn't access it before the
// timer handle has been stored in it.
- DeprecatedMutexLocker lock(context->timerMutex);
+ MutexLocker lock(context->timerMutex);
// Since our timer callback is quick, we can execute in the timer thread itself and avoid
// an extra thread switch over to a worker thread.
+2015-08-05 Filip Pizlo <fpizlo@apple.com>
+
+ Unreviewed, roll out http://trac.webkit.org/changeset/187972.
+
+ * Modules/webaudio/AsyncAudioDecoder.cpp:
+ (WebCore::AsyncAudioDecoder::AsyncAudioDecoder):
+ (WebCore::AsyncAudioDecoder::runLoop):
+ * Modules/webaudio/AsyncAudioDecoder.h:
+ * Modules/webaudio/AudioContext.h:
+ * Modules/webaudio/MediaStreamAudioSource.cpp:
+ (WebCore::MediaStreamAudioSource::addAudioConsumer):
+ (WebCore::MediaStreamAudioSource::removeAudioConsumer):
+ (WebCore::MediaStreamAudioSource::setAudioFormat):
+ (WebCore::MediaStreamAudioSource::consumeAudio):
+ * Modules/webaudio/MediaStreamAudioSource.h:
+ * Modules/webdatabase/Database.cpp:
+ (WebCore::Database::close):
+ (WebCore::Database::runTransaction):
+ (WebCore::Database::inProgressTransactionCompleted):
+ (WebCore::Database::hasPendingTransaction):
+ * Modules/webdatabase/DatabaseTask.h:
+ * Modules/webdatabase/DatabaseThread.cpp:
+ (WebCore::DatabaseThread::start):
+ (WebCore::DatabaseThread::databaseThread):
+ * Modules/webdatabase/DatabaseThread.h:
+ * Modules/webdatabase/DatabaseTracker.cpp:
+ (WebCore::DatabaseTracker::setDatabaseDirectoryPath):
+ (WebCore::DatabaseTracker::canEstablishDatabase):
+ (WebCore::DatabaseTracker::retryCanEstablishDatabase):
+ (WebCore::DatabaseTracker::hasEntryForOrigin):
+ (WebCore::DatabaseTracker::getMaxSizeForDatabase):
+ (WebCore::DatabaseTracker::closeAllDatabases):
+ (WebCore::DatabaseTracker::fullPathForDatabase):
+ (WebCore::DatabaseTracker::origins):
+ (WebCore::DatabaseTracker::databaseNamesForOrigin):
+ (WebCore::DatabaseTracker::detailsForNameAndOrigin):
+ (WebCore::DatabaseTracker::setDatabaseDetails):
+ (WebCore::DatabaseTracker::doneCreatingDatabase):
+ (WebCore::DatabaseTracker::addOpenDatabase):
+ (WebCore::DatabaseTracker::removeOpenDatabase):
+ (WebCore::DatabaseTracker::getOpenDatabases):
+ (WebCore::DatabaseTracker::originLockFor):
+ (WebCore::DatabaseTracker::quotaForOrigin):
+ (WebCore::DatabaseTracker::setQuota):
+ (WebCore::DatabaseTracker::deleteOrigin):
+ (WebCore::DatabaseTracker::deleteDatabase):
+ (WebCore::DatabaseTracker::deleteDatabaseFile):
+ (WebCore::DatabaseTracker::removeDeletedOpenedDatabases):
+ (WebCore::DatabaseTracker::deleteDatabaseFileIfEmpty):
+ (WebCore::DatabaseTracker::openDatabaseMutex):
+ (WebCore::DatabaseTracker::setClient):
+ (WebCore::notificationMutex):
+ (WebCore::DatabaseTracker::scheduleNotifyDatabaseChanged):
+ (WebCore::DatabaseTracker::notifyDatabasesChanged):
+ * Modules/webdatabase/DatabaseTracker.h:
+ * Modules/webdatabase/OriginLock.h:
+ * Modules/webdatabase/SQLCallbackWrapper.h:
+ (WebCore::SQLCallbackWrapper::clear):
+ (WebCore::SQLCallbackWrapper::unwrap):
+ (WebCore::SQLCallbackWrapper::hasCallback):
+ * Modules/webdatabase/SQLTransactionBackend.cpp:
+ (WebCore::SQLTransactionBackend::doCleanup):
+ (WebCore::SQLTransactionBackend::enqueueStatementBackend):
+ (WebCore::SQLTransactionBackend::getNextStatement):
+ * Modules/webdatabase/SQLTransactionBackend.h:
+ * bindings/js/WorkerScriptController.cpp:
+ (WebCore::WorkerScriptController::scheduleExecutionTermination):
+ (WebCore::WorkerScriptController::isExecutionTerminating):
+ * bindings/js/WorkerScriptController.h:
+ * dom/default/PlatformMessagePortChannel.cpp:
+ (WebCore::MessagePortChannel::postMessageToRemote):
+ (WebCore::MessagePortChannel::tryGetMessageFromRemote):
+ (WebCore::MessagePortChannel::isConnectedTo):
+ (WebCore::MessagePortChannel::hasPendingActivity):
+ (WebCore::MessagePortChannel::locallyEntangledPort):
+ (WebCore::PlatformMessagePortChannel::setRemotePort):
+ (WebCore::PlatformMessagePortChannel::entangledChannel):
+ (WebCore::PlatformMessagePortChannel::closeInternal):
+ * dom/default/PlatformMessagePortChannel.h:
+ * loader/icon/IconDatabase.cpp:
+ (WebCore::IconDatabase::removeAllIcons):
+ (WebCore::IconDatabase::synchronousIconForPageURL):
+ (WebCore::IconDatabase::synchronousNativeIconForPageURL):
+ (WebCore::IconDatabase::synchronousIconURLForPageURL):
+ (WebCore::IconDatabase::retainIconForPageURL):
+ (WebCore::IconDatabase::performRetainIconForPageURL):
+ (WebCore::IconDatabase::releaseIconForPageURL):
+ (WebCore::IconDatabase::performReleaseIconForPageURL):
+ (WebCore::IconDatabase::setIconDataForIconURL):
+ (WebCore::IconDatabase::setIconURLForPageURL):
+ (WebCore::IconDatabase::synchronousLoadDecisionForIconURL):
+ (WebCore::IconDatabase::synchronousIconDataKnownForIconURL):
+ (WebCore::IconDatabase::pageURLMappingCount):
+ (WebCore::IconDatabase::retainedPageURLCount):
+ (WebCore::IconDatabase::iconRecordCount):
+ (WebCore::IconDatabase::iconRecordCountWithData):
+ (WebCore::IconDatabase::wakeSyncThread):
+ (WebCore::IconDatabase::isOpenBesidesMainThreadCallbacks):
+ (WebCore::IconDatabase::databasePath):
+ (WebCore::IconDatabase::getOrCreatePageURLRecord):
+ (WebCore::IconDatabase::iconDatabaseSyncThread):
+ (WebCore::IconDatabase::performOpenInitialization):
+ (WebCore::IconDatabase::performURLImport):
+ (WebCore::IconDatabase::syncThreadMainLoop):
+ (WebCore::IconDatabase::performPendingRetainAndReleaseOperations):
+ (WebCore::IconDatabase::readFromDatabase):
+ (WebCore::IconDatabase::writeToDatabase):
+ (WebCore::IconDatabase::pruneUnretainedIcons):
+ (WebCore::IconDatabase::cleanupSyncThread):
+ * loader/icon/IconDatabase.h:
+ * page/scrolling/ScrollingTree.cpp:
+ (WebCore::ScrollingTree::shouldHandleWheelEventSynchronously):
+ (WebCore::ScrollingTree::commitNewTreeState):
+ (WebCore::ScrollingTree::setMainFramePinState):
+ (WebCore::ScrollingTree::mainFrameScrollPosition):
+ (WebCore::ScrollingTree::setMainFrameScrollPosition):
+ (WebCore::ScrollingTree::isPointInNonFastScrollableRegion):
+ (WebCore::ScrollingTree::isRubberBandInProgress):
+ (WebCore::ScrollingTree::setMainFrameIsRubberBanding):
+ (WebCore::ScrollingTree::isScrollSnapInProgress):
+ (WebCore::ScrollingTree::setMainFrameIsScrollSnapping):
+ (WebCore::ScrollingTree::setCanRubberBandState):
+ (WebCore::ScrollingTree::rubberBandsAtLeft):
+ (WebCore::ScrollingTree::rubberBandsAtRight):
+ (WebCore::ScrollingTree::rubberBandsAtBottom):
+ (WebCore::ScrollingTree::rubberBandsAtTop):
+ (WebCore::ScrollingTree::setScrollPinningBehavior):
+ (WebCore::ScrollingTree::scrollPinningBehavior):
+ (WebCore::ScrollingTree::willWheelEventStartSwipeGesture):
+ (WebCore::ScrollingTree::latchedNode):
+ (WebCore::ScrollingTree::setLatchedNode):
+ (WebCore::ScrollingTree::clearLatchedNode):
+ * page/scrolling/ScrollingTree.h:
+ * platform/MemoryPressureHandler.h:
+ * platform/audio/HRTFDatabaseLoader.cpp:
+ (WebCore::HRTFDatabaseLoader::loadAsynchronously):
+ (WebCore::HRTFDatabaseLoader::waitForLoaderThreadCompletion):
+ * platform/audio/HRTFDatabaseLoader.h:
+ * platform/cocoa/MemoryPressureHandlerCocoa.mm:
+ (WebCore::MemoryPressureHandler::setReceivedMemoryPressure):
+ (WebCore::MemoryPressureHandler::clearMemoryPressure):
+ (WebCore::MemoryPressureHandler::shouldWaitForMemoryClearMessage):
+ (WebCore::MemoryPressureHandler::respondToMemoryPressureIfNeeded):
+ * platform/graphics/DisplayRefreshMonitor.cpp:
+ (WebCore::DisplayRefreshMonitor::displayDidRefresh):
+ * platform/graphics/DisplayRefreshMonitor.h:
+ (WebCore::DisplayRefreshMonitor::setMonotonicAnimationStartTime):
+ (WebCore::DisplayRefreshMonitor::mutex):
+ * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
+ (WebCore::MediaPlayerPrivateAVFoundation::setDelayCallbacks):
+ (WebCore::MediaPlayerPrivateAVFoundation::clearMainThreadPendingFlag):
+ (WebCore::MediaPlayerPrivateAVFoundation::dispatchNotification):
+ * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
+ * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
+ (WebCore::AVFWrapper::callbackContext):
+ (WebCore::AVFWrapper::~AVFWrapper):
+ (WebCore::AVFWrapper::mapLock):
+ (WebCore::AVFWrapper::addToMap):
+ (WebCore::AVFWrapper::removeFromMap):
+ (WebCore::AVFWrapper::periodicTimeObserverCallback):
+ (WebCore::AVFWrapper::processNotification):
+ (WebCore::AVFWrapper::loadPlayableCompletionCallback):
+ (WebCore::AVFWrapper::loadMetadataCompletionCallback):
+ (WebCore::AVFWrapper::seekCompletedCallback):
+ (WebCore::AVFWrapper::processCue):
+ (WebCore::AVFWrapper::legibleOutputCallback):
+ (WebCore::AVFWrapper::processShouldWaitForLoadingOfResource):
+ (WebCore::AVFWrapper::resourceLoaderShouldWaitForLoadingOfRequestedResource):
+ * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp:
+ (WebCore::InbandTextTrackPrivateGStreamer::handleSample):
+ (WebCore::InbandTextTrackPrivateGStreamer::notifyTrackOfSample):
+ * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h:
+ * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
+ (WebCore::TrackPrivateBaseGStreamer::tagsChanged):
+ (WebCore::TrackPrivateBaseGStreamer::notifyTrackOfTagsChanged):
+ * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
+ * platform/graphics/mac/DisplayRefreshMonitorMac.cpp:
+ (WebCore::DisplayRefreshMonitorMac::requestRefreshCallback):
+ (WebCore::DisplayRefreshMonitorMac::displayLinkFired):
+ * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
+ (WebCore::MediaPlayerPrivateMediaFoundation::addListener):
+ (WebCore::MediaPlayerPrivateMediaFoundation::removeListener):
+ (WebCore::MediaPlayerPrivateMediaFoundation::notifyDeleted):
+ (WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::Invoke):
+ (WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::onMediaPlayerDeleted):
+ * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
+ * platform/ios/LegacyTileCache.h:
+ * platform/ios/LegacyTileCache.mm:
+ (WebCore::LegacyTileCache::setTilesOpaque):
+ (WebCore::LegacyTileCache::doLayoutTiles):
+ (WebCore::LegacyTileCache::setCurrentScale):
+ (WebCore::LegacyTileCache::commitScaleChange):
+ (WebCore::LegacyTileCache::layoutTilesNow):
+ (WebCore::LegacyTileCache::layoutTilesNowForRect):
+ (WebCore::LegacyTileCache::removeAllNonVisibleTiles):
+ (WebCore::LegacyTileCache::removeAllTiles):
+ (WebCore::LegacyTileCache::removeForegroundTiles):
+ (WebCore::LegacyTileCache::setContentReplacementImage):
+ (WebCore::LegacyTileCache::contentReplacementImage):
+ (WebCore::LegacyTileCache::tileCreationTimerFired):
+ (WebCore::LegacyTileCache::setNeedsDisplayInRect):
+ (WebCore::LegacyTileCache::updateTilingMode):
+ (WebCore::LegacyTileCache::setTilingMode):
+ (WebCore::LegacyTileCache::doPendingRepaints):
+ (WebCore::LegacyTileCache::flushSavedDisplayRects):
+ (WebCore::LegacyTileCache::prepareToDraw):
+ * platform/ios/LegacyTileLayerPool.h:
+ * platform/ios/LegacyTileLayerPool.mm:
+ (WebCore::LegacyTileLayerPool::addLayer):
+ (WebCore::LegacyTileLayerPool::takeLayerWithSize):
+ (WebCore::LegacyTileLayerPool::setCapacity):
+ (WebCore::LegacyTileLayerPool::prune):
+ (WebCore::LegacyTileLayerPool::drain):
+ * platform/network/curl/CurlDownload.cpp:
+ (WebCore::CurlDownloadManager::add):
+ (WebCore::CurlDownloadManager::remove):
+ (WebCore::CurlDownloadManager::getActiveDownloadCount):
+ (WebCore::CurlDownloadManager::getPendingDownloadCount):
+ (WebCore::CurlDownloadManager::stopThreadIfIdle):
+ (WebCore::CurlDownloadManager::updateHandleList):
+ (WebCore::CurlDownload::~CurlDownload):
+ (WebCore::CurlDownload::init):
+ (WebCore::CurlDownload::getTempPath):
+ (WebCore::CurlDownload::getUrl):
+ (WebCore::CurlDownload::getResponse):
+ (WebCore::CurlDownload::closeFile):
+ (WebCore::CurlDownload::didReceiveHeader):
+ (WebCore::CurlDownload::didReceiveData):
+ (WebCore::CurlDownload::didFail):
+ * platform/network/curl/CurlDownload.h:
+ * platform/network/curl/ResourceHandleManager.cpp:
+ (WebCore::cookieJarPath):
+ (WebCore::sharedResourceMutex):
+ (WebCore::curl_lock_callback):
+ (WebCore::curl_unlock_callback):
+ * platform/network/ios/QuickLook.mm:
+ (WebCore::QLDirectoryAttributes):
+ (qlPreviewConverterDictionaryMutex):
+ (WebCore::addQLPreviewConverterWithFileForURL):
+ (WebCore::qlPreviewConverterUTIForURL):
+ (WebCore::removeQLPreviewConverterForURL):
+ (WebCore::safeQLURLForDocumentURLAndResourceURL):
+ * platform/sql/SQLiteDatabase.cpp:
+ (WebCore::SQLiteDatabase::close):
+ (WebCore::SQLiteDatabase::maximumSize):
+ (WebCore::SQLiteDatabase::setMaximumSize):
+ (WebCore::SQLiteDatabase::pageSize):
+ (WebCore::SQLiteDatabase::freeSpaceSize):
+ (WebCore::SQLiteDatabase::totalSize):
+ (WebCore::SQLiteDatabase::runIncrementalVacuumCommand):
+ (WebCore::SQLiteDatabase::setAuthorizer):
+ * platform/sql/SQLiteDatabase.h:
+ (WebCore::SQLiteDatabase::databaseMutex):
+ * platform/sql/SQLiteStatement.cpp:
+ (WebCore::SQLiteStatement::prepare):
+ (WebCore::SQLiteStatement::step):
+ * workers/WorkerThread.cpp:
+ (WebCore::WorkerThread::start):
+ (WebCore::WorkerThread::workerThread):
+ (WebCore::WorkerThread::stop):
+ * workers/WorkerThread.h:
+
2015-08-05 Anders Carlsson <andersca@apple.com>
Move more functions from DatabaseBackendBase to Database
AsyncAudioDecoder::AsyncAudioDecoder()
{
// Start worker thread.
- DeprecatedMutexLocker lock(m_threadCreationMutex);
+ MutexLocker lock(m_threadCreationMutex);
m_threadID = createThread(AsyncAudioDecoder::threadEntry, this, "Audio Decoder");
}
{
// Wait for until we have m_threadID established before starting the run loop.
- DeprecatedMutexLocker lock(m_threadCreationMutex);
+ MutexLocker lock(m_threadCreationMutex);
}
// Keep running decoding tasks until we're killed.
void runLoop();
WTF::ThreadIdentifier m_threadID;
- DeprecatedMutex m_threadCreationMutex;
+ Mutex m_threadCreationMutex;
MessageQueue<DecodingTask> m_queue;
};
unsigned m_connectionCount { 0 };
// Graph locking.
- DeprecatedMutex m_contextGraphMutex;
+ Mutex m_contextGraphMutex;
volatile ThreadIdentifier m_audioThread { 0 };
volatile ThreadIdentifier m_graphOwnerThread; // if the lock is held then this is the thread which owns it, otherwise == UndefinedThreadIdentifier
void MediaStreamAudioSource::addAudioConsumer(PassRefPtr<AudioDestinationConsumer> consumer)
{
- DeprecatedMutexLocker locker(m_audioConsumersLock);
+ MutexLocker locker(m_audioConsumersLock);
m_audioConsumers.append(consumer);
}
bool MediaStreamAudioSource::removeAudioConsumer(AudioDestinationConsumer* consumer)
{
- DeprecatedMutexLocker locker(m_audioConsumersLock);
+ MutexLocker locker(m_audioConsumersLock);
size_t pos = m_audioConsumers.find(consumer);
if (pos != notFound) {
m_audioConsumers.remove(pos);
void MediaStreamAudioSource::setAudioFormat(size_t numberOfChannels, float sampleRate)
{
- DeprecatedMutexLocker locker(m_audioConsumersLock);
+ MutexLocker locker(m_audioConsumersLock);
for (auto& consumer : m_audioConsumers)
consumer->setFormat(numberOfChannels, sampleRate);
}
void MediaStreamAudioSource::consumeAudio(AudioBus* bus, size_t numberOfFrames)
{
- DeprecatedMutexLocker locker(m_audioConsumersLock);
+ MutexLocker locker(m_audioConsumersLock);
for (auto& consumer : m_audioConsumers)
consumer->consumeAudio(bus, numberOfFrames);
}
MediaStreamAudioSource();
String m_deviceId;
- DeprecatedMutex m_audioConsumersLock;
+ Mutex m_audioConsumersLock;
Vector<RefPtr<AudioDestinationConsumer>> m_audioConsumers;
RealtimeMediaSourceStates m_currentStates;
};
ASSERT(currentThread() == databaseContext()->databaseThread()->getThreadID());
{
- DeprecatedMutexLocker locker(m_transactionInProgressMutex);
+ MutexLocker locker(m_transactionInProgressMutex);
// Clean up transactions that have not been scheduled yet:
// Transaction phase 1 cleanup. See comment on "What happens if a
PassRefPtr<SQLTransactionBackend> Database::runTransaction(PassRefPtr<SQLTransaction> transaction, bool readOnly, const ChangeVersionData* data)
{
- DeprecatedMutexLocker locker(m_transactionInProgressMutex);
+ MutexLocker locker(m_transactionInProgressMutex);
if (!m_isTransactionQueueEnabled)
return 0;
void Database::inProgressTransactionCompleted()
{
- DeprecatedMutexLocker locker(m_transactionInProgressMutex);
+ MutexLocker locker(m_transactionInProgressMutex);
m_transactionInProgress = false;
scheduleTransaction();
}
bool Database::hasPendingTransaction()
{
- DeprecatedMutexLocker locker(m_transactionInProgressMutex);
+ MutexLocker locker(m_transactionInProgressMutex);
return m_transactionInProgress || !m_transactionQueue.isEmpty();
}
private:
bool m_taskCompleted;
- DeprecatedMutex m_synchronousMutex;
+ Mutex m_synchronousMutex;
ThreadCondition m_synchronousCondition;
#ifndef NDEBUG
bool m_hasCheckedForTermination;
bool DatabaseThread::start()
{
- DeprecatedMutexLocker lock(m_threadCreationMutex);
+ MutexLocker lock(m_threadCreationMutex);
if (m_threadID)
return true;
{
{
// Wait for DatabaseThread::start() to complete.
- DeprecatedMutexLocker lock(m_threadCreationMutex);
+ MutexLocker lock(m_threadCreationMutex);
LOG(StorageAPI, "Started DatabaseThread %p", this);
}
static void databaseThreadStart(void*);
void databaseThread();
- DeprecatedMutex m_threadCreationMutex;
+ Mutex m_threadCreationMutex;
ThreadIdentifier m_threadID;
RefPtr<DatabaseThread> m_selfRef;
void DatabaseTracker::setDatabaseDirectoryPath(const String& path)
{
- DeprecatedMutexLocker lockDatabase(m_databaseGuard);
+ MutexLocker lockDatabase(m_databaseGuard);
ASSERT(!m_database.isOpen());
m_databaseDirectoryPath = path.isolatedCopy();
}
{
error = DatabaseError::None;
- DeprecatedMutexLocker lockDatabase(m_databaseGuard);
+ MutexLocker lockDatabase(m_databaseGuard);
SecurityOrigin* origin = context->securityOrigin();
if (isDeletingDatabaseOrOriginFor(origin, name)) {
{
error = DatabaseError::None;
- DeprecatedMutexLocker lockDatabase(m_databaseGuard);
+ MutexLocker lockDatabase(m_databaseGuard);
SecurityOrigin* origin = context->securityOrigin();
// We have already eliminated other types of errors in canEstablishDatabase().
bool DatabaseTracker::hasEntryForOrigin(SecurityOrigin* origin)
{
- DeprecatedMutexLocker lockDatabase(m_databaseGuard);
+ MutexLocker lockDatabase(m_databaseGuard);
return hasEntryForOriginNoLock(origin);
}
{
// The maximum size for a database is the full quota for its origin, minus the current usage within the origin,
// plus the current usage of the given database
- DeprecatedMutexLocker lockDatabase(m_databaseGuard);
+ MutexLocker lockDatabase(m_databaseGuard);
SecurityOrigin* origin = database->securityOrigin();
unsigned long long quota = quotaForOriginNoLock(origin);
{
Vector<Ref<Database>> openDatabases;
{
- DeprecatedMutexLocker openDatabaseMapLock(m_openDatabaseMapGuard);
+ MutexLocker openDatabaseMapLock(m_openDatabaseMapGuard);
if (!m_openDatabaseMap)
return;
for (auto& nameMap : m_openDatabaseMap->values()) {
String DatabaseTracker::fullPathForDatabase(SecurityOrigin* origin, const String& name, bool createIfNotExists)
{
- DeprecatedMutexLocker lockDatabase(m_databaseGuard);
+ MutexLocker lockDatabase(m_databaseGuard);
return fullPathForDatabaseNoLock(origin, name, createIfNotExists).isolatedCopy();
}
void DatabaseTracker::origins(Vector<RefPtr<SecurityOrigin>>& originsResult)
{
- DeprecatedMutexLocker lockDatabase(m_databaseGuard);
+ MutexLocker lockDatabase(m_databaseGuard);
openTrackerDatabase(DontCreateIfDoesNotExist);
if (!m_database.isOpen())
{
Vector<String> temp;
{
- DeprecatedMutexLocker lockDatabase(m_databaseGuard);
+ MutexLocker lockDatabase(m_databaseGuard);
if (!databaseNamesForOriginNoLock(origin, temp))
return false;
}
int64_t expectedUsage;
{
- DeprecatedMutexLocker lockDatabase(m_databaseGuard);
+ MutexLocker lockDatabase(m_databaseGuard);
openTrackerDatabase(DontCreateIfDoesNotExist);
if (!m_database.isOpen())
String originIdentifier = origin->databaseIdentifier();
int64_t guid = 0;
- DeprecatedMutexLocker lockDatabase(m_databaseGuard);
+ MutexLocker lockDatabase(m_databaseGuard);
openTrackerDatabase(CreateIfDoesNotExist);
if (!m_database.isOpen())
void DatabaseTracker::doneCreatingDatabase(Database* database)
{
- DeprecatedMutexLocker lockDatabase(m_databaseGuard);
+ MutexLocker lockDatabase(m_databaseGuard);
doneCreatingDatabase(database->securityOrigin(), database->stringIdentifier());
}
return;
{
- DeprecatedMutexLocker openDatabaseMapLock(m_openDatabaseMapGuard);
+ MutexLocker openDatabaseMapLock(m_openDatabaseMapGuard);
if (!m_openDatabaseMap)
m_openDatabaseMap = std::make_unique<DatabaseOriginMap>();
return;
{
- DeprecatedMutexLocker openDatabaseMapLock(m_openDatabaseMapGuard);
+ MutexLocker openDatabaseMapLock(m_openDatabaseMapGuard);
if (!m_openDatabaseMap) {
ASSERT_NOT_REACHED();
void DatabaseTracker::getOpenDatabases(SecurityOrigin* origin, const String& name, HashSet<RefPtr<Database>>* databases)
{
- DeprecatedMutexLocker openDatabaseMapLock(m_openDatabaseMapGuard);
+ MutexLocker openDatabaseMapLock(m_openDatabaseMapGuard);
if (!m_openDatabaseMap)
return;
RefPtr<OriginLock> DatabaseTracker::originLockFor(SecurityOrigin* origin)
{
- DeprecatedMutexLocker lockDatabase(m_databaseGuard);
+ MutexLocker lockDatabase(m_databaseGuard);
String databaseIdentifier = origin->databaseIdentifier();
// The originLockMap is accessed from multiple DatabaseThreads since
unsigned long long DatabaseTracker::quotaForOrigin(SecurityOrigin* origin)
{
- DeprecatedMutexLocker lockDatabase(m_databaseGuard);
+ MutexLocker lockDatabase(m_databaseGuard);
return quotaForOriginNoLock(origin);
}
void DatabaseTracker::setQuota(SecurityOrigin* origin, unsigned long long quota)
{
- DeprecatedMutexLocker lockDatabase(m_databaseGuard);
+ MutexLocker lockDatabase(m_databaseGuard);
if (quotaForOriginNoLock(origin) == quota)
return;
{
Vector<String> databaseNames;
{
- DeprecatedMutexLocker lockDatabase(m_databaseGuard);
+ MutexLocker lockDatabase(m_databaseGuard);
openTrackerDatabase(DontCreateIfDoesNotExist);
if (!m_database.isOpen())
return false;
}
{
- DeprecatedMutexLocker lockDatabase(m_databaseGuard);
+ MutexLocker lockDatabase(m_databaseGuard);
deleteOriginLockFor(origin);
doneDeletingOrigin(origin);
bool DatabaseTracker::deleteDatabase(SecurityOrigin* origin, const String& name)
{
{
- DeprecatedMutexLocker lockDatabase(m_databaseGuard);
+ MutexLocker lockDatabase(m_databaseGuard);
openTrackerDatabase(DontCreateIfDoesNotExist);
if (!m_database.isOpen())
return false;
// We drop the lock here because holding locks during a call to deleteDatabaseFile will deadlock.
if (!deleteDatabaseFile(origin, name)) {
LOG_ERROR("Unable to delete file for database %s in origin %s", name.ascii().data(), origin->databaseIdentifier().ascii().data());
- DeprecatedMutexLocker lockDatabase(m_databaseGuard);
+ MutexLocker lockDatabase(m_databaseGuard);
doneDeletingDatabase(origin, name);
return false;
}
- DeprecatedMutexLocker lockDatabase(m_databaseGuard);
+ MutexLocker lockDatabase(m_databaseGuard);
SQLiteStatement statement(m_database, "DELETE FROM Databases WHERE origin=? AND name=?");
if (statement.prepare() != SQLITE_OK) {
#ifndef NDEBUG
{
- DeprecatedMutexLocker lockDatabase(m_databaseGuard);
+ MutexLocker lockDatabase(m_databaseGuard);
ASSERT(isDeletingDatabaseOrOriginFor(origin, name));
}
#endif
// Database::markAsDeletedAndClose(), since that can cause a deadlock
// during the synchronous DatabaseThread call it triggers.
{
- DeprecatedMutexLocker openDatabaseMapLock(m_openDatabaseMapGuard);
+ MutexLocker openDatabaseMapLock(m_openDatabaseMapGuard);
if (m_openDatabaseMap) {
// There are some open databases, lets check if they are for this origin.
DatabaseNameMap* nameMap = m_openDatabaseMap->get(origin);
{
// Acquire the lock before calling openTrackerDatabase.
- DeprecatedMutexLocker lockDatabase(m_databaseGuard);
+ MutexLocker lockDatabase(m_databaseGuard);
openTrackerDatabase(DontCreateIfDoesNotExist);
}
// Database::markAsDeletedAndClose(), since that can cause a deadlock
// during the synchronous DatabaseThread call it triggers.
{
- DeprecatedMutexLocker openDatabaseMapLock(m_openDatabaseMapGuard);
+ MutexLocker openDatabaseMapLock(m_openDatabaseMapGuard);
if (m_openDatabaseMap) {
for (auto& openDatabase : *m_openDatabaseMap) {
auto& origin = openDatabase.key;
return SQLiteFileSystem::deleteDatabaseFile(path);
}
-DeprecatedMutex& DatabaseTracker::openDatabaseMutex()
+Mutex& DatabaseTracker::openDatabaseMutex()
{
- static NeverDestroyed<DeprecatedMutex> mutex;
+ static NeverDestroyed<Mutex> mutex;
return mutex;
}
m_client = client;
}
-static DeprecatedMutex& notificationMutex()
+static Mutex& notificationMutex()
{
- static NeverDestroyed<DeprecatedMutex> mutex;
+ static NeverDestroyed<Mutex> mutex;
return mutex;
}
void DatabaseTracker::scheduleNotifyDatabaseChanged(SecurityOrigin* origin, const String& name)
{
- DeprecatedMutexLocker locker(notificationMutex());
+ MutexLocker locker(notificationMutex());
notificationQueue().append(std::pair<RefPtr<SecurityOrigin>, String>(origin->isolatedCopy(), name.isolatedCopy()));
scheduleForNotification();
NotificationQueue notifications;
{
- DeprecatedMutexLocker locker(notificationMutex());
+ MutexLocker locker(notificationMutex());
notifications.swap(notificationQueue());
// MobileSafari will grab this mutex on the main thread before dispatching the task to
// clean up zero byte database files. Any operations to open new database will have to
// wait for that task to finish by waiting on this mutex.
- static DeprecatedMutex& openDatabaseMutex();
+ static Mutex& openDatabaseMutex();
WEBCORE_EXPORT static void emptyDatabaseFilesRemovalTaskWillBeScheduled();
WEBCORE_EXPORT static void emptyDatabaseFilesRemovalTaskDidFinish();
typedef HashMap<String, DatabaseSet*> DatabaseNameMap;
typedef HashMap<RefPtr<SecurityOrigin>, DatabaseNameMap*> DatabaseOriginMap;
- DeprecatedMutex m_openDatabaseMapGuard;
+ Mutex m_openDatabaseMapGuard;
mutable std::unique_ptr<DatabaseOriginMap> m_openDatabaseMap;
// This lock protects m_database, m_originLockMap, m_databaseDirectoryPath, m_originsBeingDeleted, m_beingCreated, and m_beingDeleted.
- DeprecatedMutex m_databaseGuard;
+ Mutex m_databaseGuard;
SQLiteDatabase m_database;
typedef HashMap<String, RefPtr<OriginLock>> OriginLockMap;
static String lockFileNameForPath(String originPath);
String m_lockFileName;
- DeprecatedMutex m_mutex;
+ Mutex m_mutex;
#if USE(FILE_LOCK)
PlatformFileHandle m_lockHandle;
#endif
ScriptExecutionContext* scriptExecutionContextPtr;
T* callback;
{
- DeprecatedMutexLocker locker(m_mutex);
+ MutexLocker locker(m_mutex);
if (!m_callback) {
ASSERT(!m_scriptExecutionContext);
return;
PassRefPtr<T> unwrap()
{
- DeprecatedMutexLocker locker(m_mutex);
+ MutexLocker locker(m_mutex);
ASSERT(!m_callback || m_scriptExecutionContext->isContextThread());
m_scriptExecutionContext = nullptr;
return m_callback.release();
bool hasCallback() const { return m_callback; }
private:
- DeprecatedMutex m_mutex;
+ Mutex m_mutex;
RefPtr<T> m_callback;
RefPtr<ScriptExecutionContext> m_scriptExecutionContext;
};
releaseOriginLockIfNeeded();
- DeprecatedMutexLocker locker(m_statementMutex);
+ MutexLocker locker(m_statementMutex);
m_statementQueue.clear();
if (m_sqliteTransaction) {
void SQLTransactionBackend::enqueueStatementBackend(PassRefPtr<SQLStatementBackend> statementBackend)
{
- DeprecatedMutexLocker locker(m_statementMutex);
+ MutexLocker locker(m_statementMutex);
m_statementQueue.append(statementBackend);
}
{
m_currentStatementBackend = nullptr;
- DeprecatedMutexLocker locker(m_statementMutex);
+ MutexLocker locker(m_statementMutex);
if (!m_statementQueue.isEmpty())
m_currentStatementBackend = m_statementQueue.takeFirst();
}
bool m_readOnly;
bool m_hasVersionMismatch;
- DeprecatedMutex m_statementMutex;
+ Mutex m_statementMutex;
Deque<RefPtr<SQLStatementBackend>> m_statementQueue;
std::unique_ptr<SQLiteTransaction> m_sqliteTransaction;
// The mutex provides a memory barrier to ensure that once
// termination is scheduled, isExecutionTerminating will
// accurately reflect that state when called from another thread.
- DeprecatedMutexLocker locker(m_scheduledTerminationMutex);
+ MutexLocker locker(m_scheduledTerminationMutex);
if (m_vm->watchdog)
m_vm->watchdog->fire();
}
bool WorkerScriptController::isExecutionTerminating() const
{
// See comments in scheduleExecutionTermination regarding mutex usage.
- DeprecatedMutexLocker locker(m_scheduledTerminationMutex);
+ MutexLocker locker(m_scheduledTerminationMutex);
if (m_vm->watchdog)
return m_vm->watchdog->didFire();
return false;
WorkerGlobalScope* m_workerGlobalScope;
JSC::Strong<JSWorkerGlobalScope> m_workerGlobalScopeWrapper;
bool m_executionForbidden;
- mutable DeprecatedMutex m_scheduledTerminationMutex;
+ mutable Mutex m_scheduledTerminationMutex;
};
} // namespace WebCore
void MessagePortChannel::postMessageToRemote(PassRefPtr<SerializedScriptValue> message, std::unique_ptr<MessagePortChannelArray> channels)
{
- DeprecatedMutexLocker lock(m_channel->m_mutex);
+ MutexLocker lock(m_channel->m_mutex);
if (!m_channel->m_outgoingQueue)
return;
bool wasEmpty = m_channel->m_outgoingQueue->appendAndCheckEmpty(std::make_unique<PlatformMessagePortChannel::EventData>(message, WTF::move(channels)));
bool MessagePortChannel::tryGetMessageFromRemote(RefPtr<SerializedScriptValue>& message, std::unique_ptr<MessagePortChannelArray>& channels)
{
- DeprecatedMutexLocker lock(m_channel->m_mutex);
+ MutexLocker lock(m_channel->m_mutex);
auto result = m_channel->m_incomingQueue->tryGetMessage();
if (!result)
return false;
bool MessagePortChannel::isConnectedTo(MessagePort* port)
{
// FIXME: What guarantees that the result remains the same after we release the lock?
- DeprecatedMutexLocker lock(m_channel->m_mutex);
+ MutexLocker lock(m_channel->m_mutex);
return m_channel->m_remotePort == port;
}
bool MessagePortChannel::hasPendingActivity()
{
// FIXME: What guarantees that the result remains the same after we release the lock?
- DeprecatedMutexLocker lock(m_channel->m_mutex);
+ MutexLocker lock(m_channel->m_mutex);
return !m_channel->m_incomingQueue->isEmpty();
}
MessagePort* MessagePortChannel::locallyEntangledPort(const ScriptExecutionContext* context)
{
- DeprecatedMutexLocker lock(m_channel->m_mutex);
+ MutexLocker lock(m_channel->m_mutex);
// See if both contexts are run by the same thread (are the same context, or are both documents).
if (m_channel->m_remotePort) {
// The remote port's ScriptExecutionContext is guaranteed not to change here - MessagePort::contextDestroyed()
void PlatformMessagePortChannel::setRemotePort(MessagePort* port)
{
- DeprecatedMutexLocker lock(m_mutex);
+ MutexLocker lock(m_mutex);
// Should never set port if it is already set.
ASSERT(!port || !m_remotePort);
m_remotePort = port;
// FIXME: What guarantees that the result remains the same after we release the lock?
// This lock only guarantees that the returned pointer will not be pointing to released memory,
// but not that it will still be pointing to this object's entangled port channel.
- DeprecatedMutexLocker lock(m_mutex);
+ MutexLocker lock(m_mutex);
return m_entangledChannel;
}
void PlatformMessagePortChannel::closeInternal()
{
- DeprecatedMutexLocker lock(m_mutex);
+ MutexLocker lock(m_mutex);
// Disentangle ourselves from the other end. We still maintain a reference to our incoming queue, since previously-existing messages should still be delivered.
m_remotePort = nullptr;
m_entangledChannel = nullptr;
void setRemotePort(MessagePort*);
void closeInternal();
- // DeprecatedMutex used to ensure exclusive access to the object internals.
- DeprecatedMutex m_mutex;
+ // Mutex used to ensure exclusive access to the object internals.
+ Mutex m_mutex;
// Pointer to our entangled pair - cleared when close() is called.
RefPtr<PlatformMessagePortChannel> m_entangledChannel;
// Clear the in-memory record of every IconRecord, anything waiting to be read from disk, and anything waiting to be written to disk
{
- DeprecatedMutexLocker locker(m_urlAndIconLock);
+ MutexLocker locker(m_urlAndIconLock);
// Clear the IconRecords for every page URL - RefCounting will cause the IconRecords themselves to be deleted
// We don't delete the actual PageRecords because we have the "retain icon for url" count to keep track of
// Clear all in-memory records of things that need to be synced out to disk
{
- DeprecatedMutexLocker locker(m_pendingSyncLock);
+ MutexLocker locker(m_pendingSyncLock);
m_pageURLsPendingSync.clear();
m_iconsPendingSync.clear();
}
// Clear all in-memory records of things that need to be read in from disk
{
- DeprecatedMutexLocker locker(m_pendingReadingLock);
+ MutexLocker locker(m_pendingReadingLock);
m_pageURLsPendingImport.clear();
m_pageURLsInterestedInIcons.clear();
m_iconsPendingReading.clear();
if (!isOpen() || !documentCanHaveIcon(pageURLOriginal))
return 0;
- DeprecatedMutexLocker locker(m_urlAndIconLock);
+ MutexLocker locker(m_urlAndIconLock);
performPendingRetainAndReleaseOperations();
// 1 - The initial url import is incomplete and this pageURL was marked to be notified once it is complete if an iconURL exists
// 2 - The initial url import IS complete and this pageURL has no icon
if (!pageRecord) {
- DeprecatedMutexLocker locker(m_pendingReadingLock);
+ MutexLocker locker(m_pendingReadingLock);
// Import is ongoing, there might be an icon. In this case, register to be notified when the icon comes in
// If we ever reach this condition, we know we've already made the pageURL copy
if (pageURLCopy.isNull())
pageURLCopy = pageURLOriginal.isolatedCopy();
- DeprecatedMutexLocker locker(m_pendingReadingLock);
+ MutexLocker locker(m_pendingReadingLock);
m_pageURLsInterestedInIcons.add(pageURLCopy);
m_iconsPendingReading.add(iconRecord);
wakeSyncThread();
if (!icon)
return 0;
- DeprecatedMutexLocker locker(m_urlAndIconLock);
+ MutexLocker locker(m_urlAndIconLock);
return icon->nativeImageForCurrentFrame();
}
if (!isOpen() || !documentCanHaveIcon(pageURLOriginal))
return String();
- DeprecatedMutexLocker locker(m_urlAndIconLock);
+ MutexLocker locker(m_urlAndIconLock);
PageURLRecord* pageRecord = m_pageURLToRecordMap.get(pageURLOriginal);
if (!pageRecord)
return;
{
- DeprecatedMutexLocker locker(m_urlsToRetainOrReleaseLock);
+ MutexLocker locker(m_urlsToRetainOrReleaseLock);
m_urlsToRetain.add(pageURL.isolatedCopy());
m_retainOrReleaseIconRequested = true;
}
if (!m_iconURLImportComplete)
return;
- DeprecatedMutexLocker locker(m_pendingSyncLock);
+ MutexLocker locker(m_pendingSyncLock);
// If this pageURL waiting to be sync'ed, update the sync record
// This saves us in the case where a page was ready to be deleted from the database but was just retained - so theres no need to delete it!
if (!m_privateBrowsingEnabled && m_pageURLsPendingSync.contains(pageURL)) {
return;
{
- DeprecatedMutexLocker locker(m_urlsToRetainOrReleaseLock);
+ MutexLocker locker(m_urlsToRetainOrReleaseLock);
m_urlsToRelease.add(pageURL.isolatedCopy());
m_retainOrReleaseIconRequested = true;
}
ASSERT(!iconRecord || (iconRecord && m_iconURLToRecordMap.get(iconRecord->iconURL()) == iconRecord));
{
- DeprecatedMutexLocker locker(m_pendingReadingLock);
+ MutexLocker locker(m_pendingReadingLock);
// Since this pageURL is going away, there's no reason anyone would ever be interested in its read results
if (!m_iconURLImportComplete)
// Mark stuff for deletion from the database only if we're not in private browsing
if (!m_privateBrowsingEnabled) {
- DeprecatedMutexLocker locker(m_pendingSyncLock);
+ MutexLocker locker(m_pendingSyncLock);
m_pageURLsPendingSync.set(pageURLOriginal.isolatedCopy(), pageRecord->snapshot(true));
// If this page is the last page to refer to a particular IconRecord, that IconRecord needs to
Vector<String> pageURLs;
{
- DeprecatedMutexLocker locker(m_urlAndIconLock);
+ MutexLocker locker(m_urlAndIconLock);
// If this icon was pending a read, remove it from that set because this new data should override what is on disk
RefPtr<IconRecord> icon = m_iconURLToRecordMap.get(iconURL);
if (icon) {
- DeprecatedMutexLocker locker(m_pendingReadingLock);
+ MutexLocker locker(m_pendingReadingLock);
m_iconsPendingReading.remove(icon.get());
} else
icon = getOrCreateIconRecord(iconURL);
// Mark the IconRecord as requiring an update to the database only if private browsing is disabled
if (!m_privateBrowsingEnabled) {
- DeprecatedMutexLocker locker(m_pendingSyncLock);
+ MutexLocker locker(m_pendingSyncLock);
m_iconsPendingSync.set(iconURL, icon->snapshot());
}
String iconURL, pageURL;
{
- DeprecatedMutexLocker locker(m_urlAndIconLock);
+ MutexLocker locker(m_urlAndIconLock);
PageURLRecord* pageRecord = m_pageURLToRecordMap.get(pageURLOriginal);
ASSERT(iconRecord->retainingPageURLs().size() == 0);
LOG(IconDatabase, "Icon for icon url %s is about to be destroyed - removing mapping for it", urlForLogging(iconRecord->iconURL()).ascii().data());
m_iconURLToRecordMap.remove(iconRecord->iconURL());
- DeprecatedMutexLocker locker(m_pendingReadingLock);
+ MutexLocker locker(m_pendingReadingLock);
m_iconsPendingReading.remove(iconRecord.get());
}
// And mark this mapping to be added to the database
if (!m_privateBrowsingEnabled) {
- DeprecatedMutexLocker locker(m_pendingSyncLock);
+ MutexLocker locker(m_pendingSyncLock);
m_pageURLsPendingSync.set(pageURL, pageRecord->snapshot());
// If the icon is on its last ref, mark it for deletion
// 1 - When we read the icon urls from disk, getting the timeStamp at the same time
// 2 - When we get a new icon from the loader, in which case the timestamp is set at that time
{
- DeprecatedMutexLocker locker(m_urlAndIconLock);
+ MutexLocker locker(m_urlAndIconLock);
if (IconRecord* icon = m_iconURLToRecordMap.get(iconURL)) {
LOG(IconDatabase, "Found expiration time on a present icon based on existing IconRecord");
return static_cast<int>(currentTime()) - static_cast<int>(icon->getTimestamp()) > iconExpirationTime ? IconLoadYes : IconLoadNo;
}
// If we don't have a record for it, but we *have* imported all iconURLs from disk, then we should load it now
- DeprecatedMutexLocker readingLocker(m_pendingReadingLock);
+ MutexLocker readingLocker(m_pendingReadingLock);
if (m_iconURLImportComplete)
return IconLoadYes;
{
ASSERT_NOT_SYNC_THREAD();
- DeprecatedMutexLocker locker(m_urlAndIconLock);
+ MutexLocker locker(m_urlAndIconLock);
if (IconRecord* icon = m_iconURLToRecordMap.get(iconURL))
return icon->imageDataStatus() != ImageDataStatusUnknown;
size_t IconDatabase::pageURLMappingCount()
{
- DeprecatedMutexLocker locker(m_urlAndIconLock);
+ MutexLocker locker(m_urlAndIconLock);
return m_pageURLToRecordMap.size();
}
size_t IconDatabase::retainedPageURLCount()
{
- DeprecatedMutexLocker locker(m_urlAndIconLock);
+ MutexLocker locker(m_urlAndIconLock);
performPendingRetainAndReleaseOperations();
return m_retainedPageURLs.size();
}
size_t IconDatabase::iconRecordCount()
{
- DeprecatedMutexLocker locker(m_urlAndIconLock);
+ MutexLocker locker(m_urlAndIconLock);
return m_iconURLToRecordMap.size();
}
size_t IconDatabase::iconRecordCountWithData()
{
- DeprecatedMutexLocker locker(m_urlAndIconLock);
+ MutexLocker locker(m_urlAndIconLock);
size_t result = 0;
HashMap<String, IconRecord*>::iterator i = m_iconURLToRecordMap.begin();
void IconDatabase::wakeSyncThread()
{
- DeprecatedMutexLocker locker(m_syncLock);
+ MutexLocker locker(m_syncLock);
if (!m_disableSuddenTerminationWhileSyncThreadHasWorkToDo)
m_disableSuddenTerminationWhileSyncThreadHasWorkToDo = std::make_unique<SuddenTerminationDisabler>();
bool IconDatabase::isOpenBesidesMainThreadCallbacks() const
{
- DeprecatedMutexLocker locker(m_syncLock);
+ MutexLocker locker(m_syncLock);
return m_syncThreadRunning || m_syncDB.isOpen();
}
String IconDatabase::databasePath() const
{
- DeprecatedMutexLocker locker(m_syncLock);
+ MutexLocker locker(m_syncLock);
return m_completeDatabasePath.isolatedCopy();
}
PageURLRecord* pageRecord = m_pageURLToRecordMap.get(pageURL);
- DeprecatedMutexLocker locker(m_pendingReadingLock);
+ MutexLocker locker(m_pendingReadingLock);
if (!m_iconURLImportComplete) {
// If the initial import of all URLs hasn't completed and we have no page record, we assume we *might* know about this later and create a record for it
if (!pageRecord) {
}
{
- DeprecatedMutexLocker locker(m_syncLock);
+ MutexLocker locker(m_syncLock);
if (!m_syncDB.open(m_completeDatabasePath)) {
LOG_ERROR("Unable to open icon database at path %s - %s", m_completeDatabasePath.ascii().data(), m_syncDB.lastErrorMsg());
return;
m_syncDB.close();
{
- DeprecatedMutexLocker locker(m_syncLock);
+ MutexLocker locker(m_syncLock);
// Should've been consumed by SQLite, delete just to make sure we don't see it again in the future;
deleteFile(m_completeDatabasePath + "-journal");
deleteFile(m_completeDatabasePath);
String iconURL = query.getColumnText(1);
{
- DeprecatedMutexLocker locker(m_urlAndIconLock);
+ MutexLocker locker(m_urlAndIconLock);
PageURLRecord* pageRecord = m_pageURLToRecordMap.get(pageURL);
// one for the URL and one for the Image itself
// Note that WebIconDatabase is not neccessarily API so we might be able to make this change
{
- DeprecatedMutexLocker locker(m_pendingReadingLock);
+ MutexLocker locker(m_pendingReadingLock);
if (m_pageURLsPendingImport.contains(pageURL)) {
dispatchDidImportIconURLForPageURLOnMainThread(pageURL);
m_pageURLsPendingImport.remove(pageURL);
// but after m_iconURLImportComplete is set to true, we don't care about this set anymore
Vector<String> urls;
{
- DeprecatedMutexLocker locker(m_pendingReadingLock);
+ MutexLocker locker(m_pendingReadingLock);
urls.appendRange(m_pageURLsPendingImport.begin(), m_pageURLsPendingImport.end());
m_pageURLsPendingImport.clear();
// Remove unretained ones if database cleanup is allowed
// Keep a set of ones that are retained and pending notification
{
- DeprecatedMutexLocker locker(m_urlAndIconLock);
+ MutexLocker locker(m_urlAndIconLock);
performPendingRetainAndReleaseOperations();
m_iconURLToRecordMap.remove(iconRecord->iconURL());
{
- DeprecatedMutexLocker locker(m_pendingReadingLock);
+ MutexLocker locker(m_pendingReadingLock);
m_pageURLsInterestedInIcons.remove(urls[i]);
m_iconsPendingReading.remove(iconRecord);
}
{
- DeprecatedMutexLocker locker(m_pendingSyncLock);
+ MutexLocker locker(m_pendingSyncLock);
m_iconsPendingSync.set(iconRecord->iconURL(), iconRecord->snapshot(true));
}
}
break;
{
- DeprecatedMutexLocker locker(m_urlAndIconLock);
+ MutexLocker locker(m_urlAndIconLock);
performPendingRetainAndReleaseOperations();
}
HashCountedSet<String> toRelease;
{
- DeprecatedMutexLocker pendingWorkLocker(m_urlsToRetainOrReleaseLock);
+ MutexLocker pendingWorkLocker(m_urlsToRetainOrReleaseLock);
if (!m_retainOrReleaseIconRequested)
return;
// This way we won't hold the lock for a long period of time
Vector<IconRecord*> icons;
{
- DeprecatedMutexLocker locker(m_pendingReadingLock);
+ MutexLocker locker(m_pendingReadingLock);
icons.appendRange(m_iconsPendingReading.begin(), m_iconsPendingReading.end());
}
// Verify this icon still wants to be read from disk
{
- DeprecatedMutexLocker urlLocker(m_urlAndIconLock);
+ MutexLocker urlLocker(m_urlAndIconLock);
{
- DeprecatedMutexLocker readLocker(m_pendingReadingLock);
+ MutexLocker readLocker(m_pendingReadingLock);
if (m_iconsPendingReading.contains(icons[i])) {
// Set the new data
// we'll pick it up on the next pass. This greatly simplifies the locking strategy for this method and remains cohesive with changes
// asked for by the database on the main thread
{
- DeprecatedMutexLocker locker(m_urlAndIconLock);
+ MutexLocker locker(m_urlAndIconLock);
Vector<IconSnapshot> iconSnapshots;
Vector<PageURLSnapshot> pageSnapshots;
{
- DeprecatedMutexLocker locker(m_pendingSyncLock);
+ MutexLocker locker(m_pendingSyncLock);
iconSnapshots.appendRange(m_iconsPendingSync.begin().values(), m_iconsPendingSync.end().values());
m_iconsPendingSync.clear();
int result;
while ((result = pageSQL.step()) == SQLITE_ROW) {
- DeprecatedMutexLocker locker(m_urlAndIconLock);
+ MutexLocker locker(m_urlAndIconLock);
if (!m_pageURLToRecordMap.contains(pageSQL.getColumnText(1)))
pageIDsToDelete.append(pageSQL.getColumnInt64(0));
}
writeToDatabase();
// Close the database
- DeprecatedMutexLocker locker(m_syncLock);
+ MutexLocker locker(m_syncLock);
m_databaseDirectory = String();
m_completeDatabasePath = String();
bool m_isEnabled;
bool m_privateBrowsingEnabled;
- mutable DeprecatedMutex m_syncLock;
+ mutable Mutex m_syncLock;
ThreadCondition m_syncCondition;
String m_databaseDirectory;
// Holding m_syncLock is required when accessing m_completeDatabasePath
bool m_syncThreadHasWorkToDo;
std::unique_ptr<SuddenTerminationDisabler> m_disableSuddenTerminationWhileSyncThreadHasWorkToDo;
- DeprecatedMutex m_urlAndIconLock;
+ Mutex m_urlAndIconLock;
// Holding m_urlAndIconLock is required when accessing any of the following data structures or the objects they contain
HashMap<String, IconRecord*> m_iconURLToRecordMap;
HashMap<String, PageURLRecord*> m_pageURLToRecordMap;
HashSet<String> m_retainedPageURLs;
- DeprecatedMutex m_pendingSyncLock;
+ Mutex m_pendingSyncLock;
// Holding m_pendingSyncLock is required when accessing any of the following data structures
HashMap<String, PageURLSnapshot> m_pageURLsPendingSync;
HashMap<String, IconSnapshot> m_iconsPendingSync;
- DeprecatedMutex m_pendingReadingLock;
+ Mutex m_pendingReadingLock;
// Holding m_pendingSyncLock is required when accessing any of the following data structures - when dealing with IconRecord*s, holding m_urlAndIconLock is also required
HashSet<String> m_pageURLsPendingImport;
HashSet<String> m_pageURLsInterestedInIcons;
HashSet<IconRecord*> m_iconsPendingReading;
- DeprecatedMutex m_urlsToRetainOrReleaseLock;
+ Mutex m_urlsToRetainOrReleaseLock;
// Holding m_urlsToRetainOrReleaseLock is required when accessing any of the following data structures.
HashCountedSet<String> m_urlsToRetain;
HashCountedSet<String> m_urlsToRelease;
bool ScrollingTree::shouldHandleWheelEventSynchronously(const PlatformWheelEvent& wheelEvent)
{
// This method is invoked by the event handling thread
- DeprecatedMutexLocker lock(m_mutex);
+ MutexLocker lock(m_mutex);
bool shouldSetLatch = wheelEvent.shouldConsiderLatching();
&& (rootStateNodeChanged
|| rootNode->hasChangedProperty(ScrollingStateFrameScrollingNode::NonFastScrollableRegion)
|| rootNode->hasChangedProperty(ScrollingStateNode::ScrollLayer))) {
- DeprecatedMutexLocker lock(m_mutex);
+ MutexLocker lock(m_mutex);
if (rootStateNodeChanged || rootNode->hasChangedProperty(ScrollingStateNode::ScrollLayer))
m_mainFrameScrollPosition = FloatPoint();
void ScrollingTree::setMainFramePinState(bool pinnedToTheLeft, bool pinnedToTheRight, bool pinnedToTheTop, bool pinnedToTheBottom)
{
- DeprecatedMutexLocker locker(m_swipeStateMutex);
+ MutexLocker locker(m_swipeStateMutex);
m_mainFramePinnedToTheLeft = pinnedToTheLeft;
m_mainFramePinnedToTheRight = pinnedToTheRight;
FloatPoint ScrollingTree::mainFrameScrollPosition()
{
- DeprecatedMutexLocker lock(m_mutex);
+ MutexLocker lock(m_mutex);
return m_mainFrameScrollPosition;
}
void ScrollingTree::setMainFrameScrollPosition(FloatPoint position)
{
- DeprecatedMutexLocker lock(m_mutex);
+ MutexLocker lock(m_mutex);
m_mainFrameScrollPosition = position;
}
bool ScrollingTree::isPointInNonFastScrollableRegion(IntPoint p)
{
- DeprecatedMutexLocker lock(m_mutex);
+ MutexLocker lock(m_mutex);
return m_nonFastScrollableRegion.contains(p);
}
bool ScrollingTree::isRubberBandInProgress()
{
- DeprecatedMutexLocker lock(m_mutex);
+ MutexLocker lock(m_mutex);
return m_mainFrameIsRubberBanding;
}
void ScrollingTree::setMainFrameIsRubberBanding(bool isRubberBanding)
{
- DeprecatedMutexLocker locker(m_mutex);
+ MutexLocker locker(m_mutex);
m_mainFrameIsRubberBanding = isRubberBanding;
}
bool ScrollingTree::isScrollSnapInProgress()
{
- DeprecatedMutexLocker lock(m_mutex);
+ MutexLocker lock(m_mutex);
return m_mainFrameIsScrollSnapping;
}
void ScrollingTree::setMainFrameIsScrollSnapping(bool isScrollSnapping)
{
- DeprecatedMutexLocker locker(m_mutex);
+ MutexLocker locker(m_mutex);
m_mainFrameIsScrollSnapping = isScrollSnapping;
}
void ScrollingTree::setCanRubberBandState(bool canRubberBandAtLeft, bool canRubberBandAtRight, bool canRubberBandAtTop, bool canRubberBandAtBottom)
{
- DeprecatedMutexLocker locker(m_swipeStateMutex);
+ MutexLocker locker(m_swipeStateMutex);
m_rubberBandsAtLeft = canRubberBandAtLeft;
m_rubberBandsAtRight = canRubberBandAtRight;
bool ScrollingTree::rubberBandsAtLeft()
{
- DeprecatedMutexLocker lock(m_swipeStateMutex);
+ MutexLocker lock(m_swipeStateMutex);
return m_rubberBandsAtLeft;
}
bool ScrollingTree::rubberBandsAtRight()
{
- DeprecatedMutexLocker lock(m_swipeStateMutex);
+ MutexLocker lock(m_swipeStateMutex);
return m_rubberBandsAtRight;
}
bool ScrollingTree::rubberBandsAtBottom()
{
- DeprecatedMutexLocker lock(m_swipeStateMutex);
+ MutexLocker lock(m_swipeStateMutex);
return m_rubberBandsAtBottom;
}
bool ScrollingTree::rubberBandsAtTop()
{
- DeprecatedMutexLocker lock(m_swipeStateMutex);
+ MutexLocker lock(m_swipeStateMutex);
return m_rubberBandsAtTop;
}
void ScrollingTree::setScrollPinningBehavior(ScrollPinningBehavior pinning)
{
- DeprecatedMutexLocker locker(m_swipeStateMutex);
+ MutexLocker locker(m_swipeStateMutex);
m_scrollPinningBehavior = pinning;
}
ScrollPinningBehavior ScrollingTree::scrollPinningBehavior()
{
- DeprecatedMutexLocker lock(m_swipeStateMutex);
+ MutexLocker lock(m_swipeStateMutex);
return m_scrollPinningBehavior;
}
if (wheelEvent.phase() != PlatformWheelEventPhaseBegan)
return false;
- DeprecatedMutexLocker lock(m_swipeStateMutex);
+ MutexLocker lock(m_swipeStateMutex);
if (wheelEvent.deltaX() > 0 && m_mainFramePinnedToTheLeft && !m_rubberBandsAtLeft)
return true;
ScrollingNodeID ScrollingTree::latchedNode()
{
- DeprecatedMutexLocker locker(m_mutex);
+ MutexLocker locker(m_mutex);
return m_latchedNode;
}
void ScrollingTree::setLatchedNode(ScrollingNodeID node)
{
- DeprecatedMutexLocker locker(m_mutex);
+ MutexLocker locker(m_mutex);
m_latchedNode = node;
}
void ScrollingTree::clearLatchedNode()
{
- DeprecatedMutexLocker locker(m_mutex);
+ MutexLocker locker(m_mutex);
m_latchedNode = 0;
}
typedef HashMap<ScrollingNodeID, ScrollingTreeNode*> ScrollingTreeNodeMap;
ScrollingTreeNodeMap m_nodeMap;
- DeprecatedMutex m_mutex;
+ Mutex m_mutex;
Region m_nonFastScrollableRegion;
FloatPoint m_mainFrameScrollPosition;
- DeprecatedMutex m_swipeStateMutex;
+ Mutex m_swipeStateMutex;
ScrollPinningBehavior m_scrollPinningBehavior { DoNotPin };
ScrollingNodeID m_latchedNode { 0 };
bool m_clearPressureOnMemoryRelease;
void (^m_releaseMemoryBlock)();
CFRunLoopObserverRef m_observer;
- DeprecatedMutex m_observerMutex;
+ Mutex m_observerMutex;
#elif OS(LINUX)
int m_eventFD;
int m_pressureLevelFD;
{
ASSERT(isMainThread());
- DeprecatedMutexLocker locker(m_threadLock);
+ MutexLocker locker(m_threadLock);
if (!m_hrtfDatabase.get() && !m_databaseLoaderThread) {
// Start the asynchronous database loading process.
void HRTFDatabaseLoader::waitForLoaderThreadCompletion()
{
- DeprecatedMutexLocker locker(m_threadLock);
+ MutexLocker locker(m_threadLock);
// waitForThreadCompletion() should not be called twice for the same thread.
if (m_databaseLoaderThread)
std::unique_ptr<HRTFDatabase> m_hrtfDatabase;
// Holding a m_threadLock is required when accessing m_databaseLoaderThread.
- DeprecatedMutex m_threadLock;
+ Mutex m_threadLock;
ThreadIdentifier m_databaseLoaderThread;
float m_databaseSampleRate;
m_underMemoryPressure = true;
{
- DeprecatedMutexLocker locker(m_observerMutex);
+ MutexLocker locker(m_observerMutex);
if (!m_observer) {
m_observer = CFRunLoopObserverCreate(NULL, kCFRunLoopBeforeWaiting | kCFRunLoopExit, NO /* don't repeat */,
0, WebCore::respondToMemoryPressureCallback, NULL);
m_underMemoryPressure = false;
{
- DeprecatedMutexLocker locker(m_observerMutex);
+ MutexLocker locker(m_observerMutex);
m_memoryPressureReason = MemoryPressureReasonNone;
}
}
bool MemoryPressureHandler::shouldWaitForMemoryClearMessage()
{
- DeprecatedMutexLocker locker(m_observerMutex);
+ MutexLocker locker(m_observerMutex);
return m_memoryPressureReason & MemoryPressureReasonVMStatus;
}
ASSERT(WebThreadIsLockedOrDisabled());
{
- DeprecatedMutexLocker locker(m_observerMutex);
+ MutexLocker locker(m_observerMutex);
m_observer = 0;
}
double monotonicAnimationStartTime;
{
- DeprecatedMutexLocker lock(m_mutex);
+ MutexLocker lock(m_mutex);
if (!m_scheduled)
++m_unscheduledFireCount;
else
m_clientsToBeNotified = nullptr;
{
- DeprecatedMutexLocker lock(m_mutex);
+ MutexLocker lock(m_mutex);
m_previousFrameDone = true;
}
void setMonotonicAnimationStartTime(double startTime) { m_monotonicAnimationStartTime = startTime; }
- DeprecatedMutex& mutex() { return m_mutex; }
+ Mutex& mutex() { return m_mutex; }
static RefPtr<DisplayRefreshMonitor> createDefaultDisplayRefreshMonitor(PlatformDisplayID);
bool m_previousFrameDone;
int m_unscheduledFireCount; // Number of times the display link has fired with no clients.
PlatformDisplayID m_displayID;
- DeprecatedMutex m_mutex;
+ Mutex m_mutex;
HashSet<DisplayRefreshMonitorClient*> m_clients;
HashSet<DisplayRefreshMonitorClient*>* m_clientsToBeNotified;
void MediaPlayerPrivateAVFoundation::setDelayCallbacks(bool delay) const
{
- DeprecatedMutexLocker lock(m_queueMutex);
+ MutexLocker lock(m_queueMutex);
if (delay)
++m_delayCallbacks;
else {
void MediaPlayerPrivateAVFoundation::clearMainThreadPendingFlag()
{
- DeprecatedMutexLocker lock(m_queueMutex);
+ MutexLocker lock(m_queueMutex);
m_mainThreadCallPending = false;
}
Notification notification = Notification();
{
- DeprecatedMutexLocker lock(m_queueMutex);
+ MutexLocker lock(m_queueMutex);
if (m_queuedNotifications.isEmpty())
return;
std::function<void()> m_pendingSeek;
Vector<Notification> m_queuedNotifications;
- mutable DeprecatedMutex m_queueMutex;
+ mutable Mutex m_queueMutex;
mutable std::unique_ptr<PlatformTimeRanges> m_cachedLoadedTimeRanges;
private:
inline void* callbackContext() const { return reinterpret_cast<void*>(m_objectID); }
- static DeprecatedMutex& mapLock();
+ static Mutex& mapLock();
static HashMap<uintptr_t, AVFWrapper*>& map();
static AVFWrapper* avfWrapperForCallbackContext(void*);
void addToMap();
m_avPlayer = 0;
}
-DeprecatedMutex& AVFWrapper::mapLock()
+Mutex& AVFWrapper::mapLock()
{
- static DeprecatedMutex mapLock;
+ static Mutex mapLock;
return mapLock;
}
void AVFWrapper::addToMap()
{
- DeprecatedMutexLocker locker(mapLock());
+ MutexLocker locker(mapLock());
// HashMap doesn't like a key of 0, and also make sure we aren't
// using an object ID that's already in use.
{
LOG(Media, "AVFWrapper::removeFromMap(%p %d)", this, m_objectID);
- DeprecatedMutexLocker locker(mapLock());
+ MutexLocker locker(mapLock());
map().remove(m_objectID);
}
void AVFWrapper::periodicTimeObserverCallback(AVCFPlayerRef, CMTime cmTime, void* context)
{
- DeprecatedMutexLocker locker(mapLock());
+ MutexLocker locker(mapLock());
AVFWrapper* self = avfWrapperForCallbackContext(context);
if (!self) {
LOG(Media, "AVFWrapper::periodicTimeObserverCallback invoked for deleted AVFWrapper %d", reinterpret_cast<uintptr_t>(context));
std::unique_ptr<NotificationCallbackData> notificationData { static_cast<NotificationCallbackData*>(context) };
- DeprecatedMutexLocker locker(mapLock());
+ MutexLocker locker(mapLock());
AVFWrapper* self = avfWrapperForCallbackContext(notificationData->m_context);
if (!self) {
LOG(Media, "AVFWrapper::processNotification invoked for deleted AVFWrapper %d", reinterpret_cast<uintptr_t>(context));
void AVFWrapper::loadPlayableCompletionCallback(AVCFAssetRef, void* context)
{
- DeprecatedMutexLocker locker(mapLock());
+ MutexLocker locker(mapLock());
AVFWrapper* self = avfWrapperForCallbackContext(context);
if (!self) {
LOG(Media, "AVFWrapper::loadPlayableCompletionCallback invoked for deleted AVFWrapper %d", reinterpret_cast<uintptr_t>(context));
void AVFWrapper::loadMetadataCompletionCallback(AVCFAssetRef, void* context)
{
- DeprecatedMutexLocker locker(mapLock());
+ MutexLocker locker(mapLock());
AVFWrapper* self = avfWrapperForCallbackContext(context);
if (!self) {
LOG(Media, "AVFWrapper::loadMetadataCompletionCallback invoked for deleted AVFWrapper %d", reinterpret_cast<uintptr_t>(context));
void AVFWrapper::seekCompletedCallback(AVCFPlayerItemRef, Boolean finished, void* context)
{
- DeprecatedMutexLocker locker(mapLock());
+ MutexLocker locker(mapLock());
AVFWrapper* self = avfWrapperForCallbackContext(context);
if (!self) {
LOG(Media, "AVFWrapper::seekCompletedCallback invoked for deleted AVFWrapper %d", reinterpret_cast<uintptr_t>(context));
std::unique_ptr<LegibleOutputData> legibleOutputData(reinterpret_cast<LegibleOutputData*>(context));
- DeprecatedMutexLocker locker(mapLock());
+ MutexLocker locker(mapLock());
AVFWrapper* self = avfWrapperForCallbackContext(legibleOutputData->m_context);
if (!self) {
LOG(Media, "AVFWrapper::processCue invoked for deleted AVFWrapper %d", reinterpret_cast<uintptr_t>(context));
void AVFWrapper::legibleOutputCallback(void* context, AVCFPlayerItemLegibleOutputRef legibleOutput, CFArrayRef attributedStrings, CFArrayRef nativeSampleBuffers, CMTime itemTime)
{
ASSERT(!isMainThread());
- DeprecatedMutexLocker locker(mapLock());
+ MutexLocker locker(mapLock());
AVFWrapper* self = avfWrapperForCallbackContext(context);
if (!self) {
LOG(Media, "AVFWrapper::legibleOutputCallback invoked for deleted AVFWrapper %d", reinterpret_cast<uintptr_t>(context));
std::unique_ptr<LoadRequestData> loadRequestData(reinterpret_cast<LoadRequestData*>(context));
- DeprecatedMutexLocker locker(mapLock());
+ MutexLocker locker(mapLock());
AVFWrapper* self = avfWrapperForCallbackContext(loadRequestData->m_context);
if (!self) {
LOG(Media, "AVFWrapper::processShouldWaitForLoadingOfResource invoked for deleted AVFWrapper %d", reinterpret_cast<uintptr_t>(context));
Boolean AVFWrapper::resourceLoaderShouldWaitForLoadingOfRequestedResource(AVCFAssetResourceLoaderRef resourceLoader, AVCFAssetResourceLoadingRequestRef loadingRequest, void *context)
{
ASSERT(dispatch_get_main_queue() != dispatch_get_current_queue());
- DeprecatedMutexLocker locker(mapLock());
+ MutexLocker locker(mapLock());
AVFWrapper* self = avfWrapperForCallbackContext(context);
if (!self) {
LOG(Media, "AVFWrapper::resourceLoaderShouldWaitForLoadingOfRequestedResource invoked for deleted AVFWrapper %d", reinterpret_cast<uintptr_t>(context));
{
m_sampleTimerHandler.cancel();
{
- DeprecatedMutexLocker lock(m_sampleMutex);
+ MutexLocker lock(m_sampleMutex);
m_pendingSamples.append(sample);
}
m_sampleTimerHandler.schedule("[WebKit] InbandTextTrackPrivateGStreamer::notifyTrackOfSample", std::function<void()>(std::bind(&InbandTextTrackPrivateGStreamer::notifyTrackOfSample, this)));
{
Vector<GRefPtr<GstSample> > samples;
{
- DeprecatedMutexLocker lock(m_sampleMutex);
+ MutexLocker lock(m_sampleMutex);
m_pendingSamples.swap(samples);
}
gulong m_eventProbe;
Vector<GRefPtr<GstSample> > m_pendingSamples;
String m_streamId;
- DeprecatedMutex m_sampleMutex;
+ Mutex m_sampleMutex;
};
} // namespace WebCore
GRefPtr<GstTagList> tags;
g_object_get(m_pad.get(), "tags", &tags.outPtr(), NULL);
{
- DeprecatedMutexLocker lock(m_tagMutex);
+ MutexLocker lock(m_tagMutex);
m_tags.swap(tags);
}
GRefPtr<GstTagList> tags;
{
- DeprecatedMutexLocker lock(m_tagMutex);
+ MutexLocker lock(m_tagMutex);
tags.swap(m_tags);
}
if (!tags)
GThreadSafeMainLoopSource m_activeTimerHandler;
GThreadSafeMainLoopSource m_tagTimerHandler;
- DeprecatedMutex m_tagMutex;
+ Mutex m_tagMutex;
GRefPtr<GstTagList> m_tags;
};
setIsActive(true);
}
- DeprecatedMutexLocker lock(mutex());
+ MutexLocker lock(mutex());
setIsScheduled(true);
return true;
}
void DisplayRefreshMonitorMac::displayLinkFired(double nowSeconds, double outputTimeSeconds)
{
- DeprecatedMutexLocker lock(mutex());
+ MutexLocker lock(mutex());
if (!isPreviousFrameDone())
return;
void MediaPlayerPrivateMediaFoundation::addListener(MediaPlayerListener* listener)
{
- DeprecatedMutexLocker locker(m_mutexListeners);
+ MutexLocker locker(m_mutexListeners);
m_listeners.add(listener);
}
void MediaPlayerPrivateMediaFoundation::removeListener(MediaPlayerListener* listener)
{
- DeprecatedMutexLocker locker(m_mutexListeners);
+ MutexLocker locker(m_mutexListeners);
m_listeners.remove(listener);
}
void MediaPlayerPrivateMediaFoundation::notifyDeleted()
{
- DeprecatedMutexLocker locker(m_mutexListeners);
+ MutexLocker locker(m_mutexListeners);
for (HashSet<MediaPlayerListener*>::const_iterator it = m_listeners.begin(); it != m_listeners.end(); ++it)
(*it)->onMediaPlayerDeleted();
HRESULT STDMETHODCALLTYPE MediaPlayerPrivateMediaFoundation::AsyncCallback::Invoke(__RPC__in_opt IMFAsyncResult *pAsyncResult)
{
- DeprecatedMutexLocker locker(m_mutex);
+ MutexLocker locker(m_mutex);
if (!m_mediaPlayer)
return S_OK;
void MediaPlayerPrivateMediaFoundation::AsyncCallback::onMediaPlayerDeleted()
{
- DeprecatedMutexLocker locker(m_mutex);
+ MutexLocker locker(m_mutex);
m_mediaPlayer = nullptr;
}
class MediaPlayerListener;
HashSet<MediaPlayerListener*> m_listeners;
- DeprecatedMutex m_mutexListeners;
+ Mutex m_mutexListeners;
COMPtr<IMFMediaSession> m_mediaSession;
COMPtr<IMFSourceResolver> m_sourceResolver;
ULONG m_refCount;
MediaPlayerPrivateMediaFoundation* m_mediaPlayer;
bool m_event;
- DeprecatedMutex m_mutex;
+ Mutex m_mutex;
};
};
float m_pendingScale;
float m_pendingZoomedOutScale;
- mutable DeprecatedMutex m_tileMutex;
- mutable DeprecatedMutex m_savedDisplayRectMutex;
- mutable DeprecatedMutex m_contentReplacementImageMutex;
+ mutable Mutex m_tileMutex;
+ mutable Mutex m_savedDisplayRectMutex;
+ mutable Mutex m_contentReplacementImageMutex;
bool m_tileControllerShouldUseLowScaleTiles;
};
if (m_tilesOpaque == opaque)
return;
- DeprecatedMutexLocker locker(m_tileMutex);
+ MutexLocker locker(m_tileMutex);
m_tilesOpaque = opaque;
m_zoomedOutTileGrid->updateTileOpacity();
if (isTileCreationSuspended())
return;
- DeprecatedMutexLocker locker(m_tileMutex);
+ MutexLocker locker(m_tileMutex);
LegacyTileGrid* activeGrid = activeTileGrid();
// Even though we aren't actually creating tiles in the inactive grid, we
// still need to drop invalid tiles in response to a layout.
if (!keepsZoomedOutTiles() && !isTileInvalidationSuspended()) {
// Tile invalidation is normally suspended during zooming by UIKit but some applications
// using custom scrollviews may zoom without triggering the callbacks. Invalidate the tiles explicitly.
- DeprecatedMutexLocker locker(m_tileMutex);
+ MutexLocker locker(m_tileMutex);
activeTileGrid()->dropAllTiles();
activeTileGrid()->createTiles(CoverVisibleOnly);
}
ASSERT(m_pendingZoomedOutScale || m_pendingScale);
ASSERT(m_tilingMode != Disabled);
- DeprecatedMutexLocker locker(m_tileMutex);
+ MutexLocker locker(m_tileMutex);
if (m_pendingZoomedOutScale) {
m_zoomedOutTileGrid->setScale(m_pendingZoomedOutScale);
if (m_tilingMode == Zooming)
m_tilingMode = Minimal;
- DeprecatedMutexLocker locker(m_tileMutex);
+ MutexLocker locker(m_tileMutex);
LegacyTileGrid* activeGrid = activeTileGrid();
if (activeGrid->checkDoSingleTileLayout()) {
m_tilingMode = savedTilingMode;
void LegacyTileCache::layoutTilesNowForRect(const IntRect& rect)
{
ASSERT(WebThreadIsLockedOrDisabled());
- DeprecatedMutexLocker locker(m_tileMutex);
+ MutexLocker locker(m_tileMutex);
activeTileGrid()->addTilesCoveringRect(rect);
}
void LegacyTileCache::removeAllNonVisibleTiles()
{
- DeprecatedMutexLocker locker(m_tileMutex);
+ MutexLocker locker(m_tileMutex);
removeAllNonVisibleTilesInternal();
}
void LegacyTileCache::removeAllTiles()
{
- DeprecatedMutexLocker locker(m_tileMutex);
+ MutexLocker locker(m_tileMutex);
m_zoomedOutTileGrid->dropAllTiles();
if (m_zoomedInTileGrid)
m_zoomedInTileGrid->dropAllTiles();
void LegacyTileCache::removeForegroundTiles()
{
- DeprecatedMutexLocker locker(m_tileMutex);
+ MutexLocker locker(m_tileMutex);
if (!keepsZoomedOutTiles())
m_zoomedOutTileGrid->dropAllTiles();
if (m_zoomedInTileGrid)
void LegacyTileCache::setContentReplacementImage(RetainPtr<CGImageRef> contentReplacementImage)
{
- DeprecatedMutexLocker locker(m_contentReplacementImageMutex);
+ MutexLocker locker(m_contentReplacementImageMutex);
m_contentReplacementImage = contentReplacementImage;
}
RetainPtr<CGImageRef> LegacyTileCache::contentReplacementImage() const
{
- DeprecatedMutexLocker locker(m_contentReplacementImageMutex);
+ MutexLocker locker(m_contentReplacementImageMutex);
return m_contentReplacementImage;
}
{
if (isTileCreationSuspended())
return;
- DeprecatedMutexLocker locker(m_tileMutex);
+ MutexLocker locker(m_tileMutex);
createTilesInActiveGrid(CoverSpeculative);
}
void LegacyTileCache::setNeedsDisplayInRect(const IntRect& dirtyRect)
{
- DeprecatedMutexLocker locker(m_savedDisplayRectMutex);
+ MutexLocker locker(m_savedDisplayRectMutex);
bool addedFirstRect = m_savedDisplayRects.isEmpty();
m_savedDisplayRects.append(dirtyRect);
if (!addedFirstRect)
if (m_tilingMode == Disabled)
return;
- DeprecatedMutexLocker locker(m_tileMutex);
+ MutexLocker locker(m_tileMutex);
createTilesInActiveGrid(CoverVisibleOnly);
if (!m_savedDisplayRects.isEmpty())
if ((m_pendingZoomedOutScale || m_pendingScale) && m_tilingMode != Disabled)
commitScaleChange();
else if (wasZooming) {
- DeprecatedMutexLocker locker(m_tileMutex);
+ MutexLocker locker(m_tileMutex);
bringActiveTileGridToFront();
}
return;
if (isTileInvalidationSuspended())
return;
- DeprecatedMutexLocker locker(m_tileMutex);
+ MutexLocker locker(m_tileMutex);
flushSavedDisplayRects();
}
Vector<IntRect> rects;
{
- DeprecatedMutexLocker locker(m_savedDisplayRectMutex);
+ MutexLocker locker(m_savedDisplayRectMutex);
m_savedDisplayRects.swap(rects);
}
size_t size = rects.size();
[[m_window contentView] viewWillDraw];
if (!m_savedDisplayRects.isEmpty()) {
- DeprecatedMutexLocker locker(m_tileMutex);
+ MutexLocker locker(m_tileMutex);
flushSavedDisplayRects();
}
}
Vector<IntSize> m_sizesInPruneOrder;
unsigned m_totalBytes;
unsigned m_capacity;
- DeprecatedMutex m_layerPoolMutex;
+ Mutex m_layerPoolMutex;
double m_lastAddTime;
bool m_needsPrune;
return;
}
- DeprecatedMutexLocker locker(m_layerPoolMutex);
+ MutexLocker locker(m_layerPoolMutex);
listOfLayersWithSize(layerSize).prepend(layer);
m_totalBytes += bytesBackingLayerWithPixelSize(layerSize);
{
if (!canReuseLayerWithSize(size))
return nil;
- DeprecatedMutexLocker locker(m_layerPoolMutex);
+ MutexLocker locker(m_layerPoolMutex);
LayerList& reuseList = listOfLayersWithSize(size, MarkAsUsed);
if (reuseList.isEmpty())
return nil;
void LegacyTileLayerPool::setCapacity(unsigned capacity)
{
- DeprecatedMutexLocker reuseLocker(m_layerPoolMutex);
+ MutexLocker reuseLocker(m_layerPoolMutex);
if (capacity < m_capacity)
schedulePrune();
m_capacity = capacity;
void LegacyTileLayerPool::prune()
{
- DeprecatedMutexLocker locker(m_layerPoolMutex);
+ MutexLocker locker(m_layerPoolMutex);
ASSERT(m_needsPrune);
m_needsPrune = false;
unsigned shrinkTo = decayedCapacity();
void LegacyTileLayerPool::drain()
{
- DeprecatedMutexLocker reuseLocker(m_layerPoolMutex);
+ MutexLocker reuseLocker(m_layerPoolMutex);
m_reuseLists.clear();
m_sizesInPruneOrder.clear();
m_totalBytes = 0;
bool CurlDownloadManager::add(CURL* curlHandle)
{
- DeprecatedMutexLocker locker(m_mutex);
+ MutexLocker locker(m_mutex);
m_pendingHandleList.append(curlHandle);
startThreadIfNeeded();
bool CurlDownloadManager::remove(CURL* curlHandle)
{
- DeprecatedMutexLocker locker(m_mutex);
+ MutexLocker locker(m_mutex);
m_removedHandleList.append(curlHandle);
int CurlDownloadManager::getActiveDownloadCount() const
{
- DeprecatedMutexLocker locker(m_mutex);
+ MutexLocker locker(m_mutex);
return m_activeHandleList.size();
}
int CurlDownloadManager::getPendingDownloadCount() const
{
- DeprecatedMutexLocker locker(m_mutex);
+ MutexLocker locker(m_mutex);
return m_pendingHandleList.size();
}
void CurlDownloadManager::stopThreadIfIdle()
{
- DeprecatedMutexLocker locker(m_mutex);
+ MutexLocker locker(m_mutex);
if (!getActiveDownloadCount() && !getPendingDownloadCount())
setRunThread(false);
void CurlDownloadManager::updateHandleList()
{
- DeprecatedMutexLocker locker(m_mutex);
+ MutexLocker locker(m_mutex);
// Remove curl easy handles from multi list
int size = m_removedHandleList.size();
CurlDownload::~CurlDownload()
{
- DeprecatedMutexLocker locker(m_mutex);
+ MutexLocker locker(m_mutex);
if (m_url)
fastFree(m_url);
if (!listener)
return;
- DeprecatedMutexLocker locker(m_mutex);
+ MutexLocker locker(m_mutex);
m_curlHandle = curl_easy_init();
if (!listener)
return;
- DeprecatedMutexLocker locker(m_mutex);
+ MutexLocker locker(m_mutex);
URL url(ParsedURLString, request.url());
String CurlDownload::getTempPath() const
{
- DeprecatedMutexLocker locker(m_mutex);
+ MutexLocker locker(m_mutex);
return m_tempPath;
}
String CurlDownload::getUrl() const
{
- DeprecatedMutexLocker locker(m_mutex);
+ MutexLocker locker(m_mutex);
return String(m_url);
}
ResourceResponse CurlDownload::getResponse() const
{
- DeprecatedMutexLocker locker(m_mutex);
+ MutexLocker locker(m_mutex);
return m_response;
}
void CurlDownload::closeFile()
{
- DeprecatedMutexLocker locker(m_mutex);
+ MutexLocker locker(m_mutex);
if (m_tempHandle != invalidPlatformFileHandle) {
WebCore::closeFile(m_tempHandle);
void CurlDownload::didReceiveHeader(const String& header)
{
- DeprecatedMutexLocker locker(m_mutex);
+ MutexLocker locker(m_mutex);
if (header == "\r\n" || header == "\n") {
void CurlDownload::didReceiveData(void* data, int size)
{
- DeprecatedMutexLocker locker(m_mutex);
+ MutexLocker locker(m_mutex);
RefPtr<CurlDownload> protectedDownload(this);
void CurlDownload::didFail()
{
- DeprecatedMutexLocker locker(m_mutex);
+ MutexLocker locker(m_mutex);
closeFile();
Vector<CURL*> m_pendingHandleList;
Vector<CURL*> m_activeHandleList;
Vector<CURL*> m_removedHandleList;
- mutable DeprecatedMutex m_mutex;
+ mutable Mutex m_mutex;
bool m_runThread;
};
WebCore::PlatformFileHandle m_tempHandle;
WebCore::ResourceResponse m_response;
bool m_deletesFileUponFailure;
- mutable DeprecatedMutex m_mutex;
+ mutable Mutex m_mutex;
CurlDownloadListener *m_listener;
static CurlDownloadManager m_downloadManager;
#endif
}
-static DeprecatedMutex* sharedResourceMutex(curl_lock_data data)
-{
- DEPRECATED_DEFINE_STATIC_LOCAL(DeprecatedMutex, cookieMutex, ());
- DEPRECATED_DEFINE_STATIC_LOCAL(DeprecatedMutex, dnsMutex, ());
- DEPRECATED_DEFINE_STATIC_LOCAL(DeprecatedMutex, shareMutex, ());
+static Mutex* sharedResourceMutex(curl_lock_data data) {
+ DEPRECATED_DEFINE_STATIC_LOCAL(Mutex, cookieMutex, ());
+ DEPRECATED_DEFINE_STATIC_LOCAL(Mutex, dnsMutex, ());
+ DEPRECATED_DEFINE_STATIC_LOCAL(Mutex, shareMutex, ());
switch (data) {
case CURL_LOCK_DATA_COOKIE:
// cache.
static void curl_lock_callback(CURL* /* handle */, curl_lock_data data, curl_lock_access /* access */, void* /* userPtr */)
{
- if (DeprecatedMutex* mutex = sharedResourceMutex(data))
+ if (Mutex* mutex = sharedResourceMutex(data))
mutex->lock();
}
static void curl_unlock_callback(CURL* /* handle */, curl_lock_data data, void* /* userPtr */)
{
- if (DeprecatedMutex* mutex = sharedResourceMutex(data))
+ if (Mutex* mutex = sharedResourceMutex(data))
mutex->unlock();
}
return dictionary;
}
-static DeprecatedMutex& qlPreviewConverterDictionaryMutex()
+static Mutex& qlPreviewConverterDictionaryMutex()
{
- static NeverDestroyed<DeprecatedMutex> mutex;
+ static NeverDestroyed<Mutex> mutex;
return mutex;
}
{
ASSERT(url);
ASSERT(converter);
- DeprecatedMutexLocker lock(qlPreviewConverterDictionaryMutex());
+ MutexLocker lock(qlPreviewConverterDictionaryMutex());
[QLPreviewConverterDictionary() setObject:converter forKey:url];
[QLContentDictionary() setObject:(fileName ? fileName : @"") forKey:url];
}
{
id converter = nil;
{
- DeprecatedMutexLocker lock(qlPreviewConverterDictionaryMutex());
+ MutexLocker lock(qlPreviewConverterDictionaryMutex());
converter = [QLPreviewConverterDictionary() objectForKey:url];
}
if (!converter)
void WebCore::removeQLPreviewConverterForURL(NSURL *url)
{
- DeprecatedMutexLocker lock(qlPreviewConverterDictionaryMutex());
+ MutexLocker lock(qlPreviewConverterDictionaryMutex());
[QLPreviewConverterDictionary() removeObjectForKey:url];
// Delete the file when we remove the preview converter
id converter = nil;
NSURL *nsDocumentURL = documentURL;
{
- DeprecatedMutexLocker lock(qlPreviewConverterDictionaryMutex());
+ MutexLocker lock(qlPreviewConverterDictionaryMutex());
converter = [QLPreviewConverterDictionary() objectForKey:nsDocumentURL];
}
// ASSERT(currentThread() == m_openingThread);
sqlite3* db = m_db;
{
- DeprecatedMutexLocker locker(m_databaseClosingMutex);
+ MutexLocker locker(m_databaseClosingMutex);
m_db = 0;
}
sqlite3_close(db);
int64_t maxPageCount = 0;
{
- DeprecatedMutexLocker locker(m_authorizerLock);
+ MutexLocker locker(m_authorizerLock);
enableAuthorizer(false);
SQLiteStatement statement(*this, ASCIILiteral("PRAGMA max_page_count"));
maxPageCount = statement.getColumnInt64(0);
ASSERT(currentPageSize || !m_db);
int64_t newMaxPageCount = currentPageSize ? size / currentPageSize : 0;
- DeprecatedMutexLocker locker(m_authorizerLock);
+ MutexLocker locker(m_authorizerLock);
enableAuthorizer(false);
SQLiteStatement statement(*this, "PRAGMA max_page_count = " + String::number(newMaxPageCount));
// Since the page size of a database is locked in at creation and therefore cannot be dynamic,
// we can cache the value for future use
if (m_pageSize == -1) {
- DeprecatedMutexLocker locker(m_authorizerLock);
+ MutexLocker locker(m_authorizerLock);
enableAuthorizer(false);
SQLiteStatement statement(*this, ASCIILiteral("PRAGMA page_size"));
int64_t freelistCount = 0;
{
- DeprecatedMutexLocker locker(m_authorizerLock);
+ MutexLocker locker(m_authorizerLock);
enableAuthorizer(false);
// Note: freelist_count was added in SQLite 3.4.1.
SQLiteStatement statement(*this, ASCIILiteral("PRAGMA freelist_count"));
int64_t pageCount = 0;
{
- DeprecatedMutexLocker locker(m_authorizerLock);
+ MutexLocker locker(m_authorizerLock);
enableAuthorizer(false);
SQLiteStatement statement(*this, ASCIILiteral("PRAGMA page_count"));
pageCount = statement.getColumnInt64(0);
int SQLiteDatabase::runIncrementalVacuumCommand()
{
- DeprecatedMutexLocker locker(m_authorizerLock);
+ MutexLocker locker(m_authorizerLock);
enableAuthorizer(false);
if (!executeCommand(ASCIILiteral("PRAGMA incremental_vacuum")))
return;
}
- DeprecatedMutexLocker locker(m_authorizerLock);
+ MutexLocker locker(m_authorizerLock);
m_authorizer = auth;
void setAuthorizer(PassRefPtr<DatabaseAuthorizer>);
- DeprecatedMutex& databaseMutex() { return m_lockingMutex; }
+ Mutex& databaseMutex() { return m_lockingMutex; }
bool isAutoCommitOn() const;
// The SQLite AUTO_VACUUM pragma can be either NONE, FULL, or INCREMENTAL.
bool m_transactionInProgress;
bool m_sharable;
- DeprecatedMutex m_authorizerLock;
+ Mutex m_authorizerLock;
RefPtr<DatabaseAuthorizer> m_authorizer;
- DeprecatedMutex m_lockingMutex;
+ Mutex m_lockingMutex;
ThreadIdentifier m_openingThread;
- DeprecatedMutex m_databaseClosingMutex;
+ Mutex m_databaseClosingMutex;
int m_openError;
CString m_openErrorMessage;
{
ASSERT(!m_isPrepared);
- DeprecatedMutexLocker databaseLock(m_database.databaseMutex());
+ MutexLocker databaseLock(m_database.databaseMutex());
CString query = m_query.stripWhiteSpace().utf8();
int SQLiteStatement::step()
{
- DeprecatedMutexLocker databaseLock(m_database.databaseMutex());
+ MutexLocker databaseLock(m_database.databaseMutex());
if (!m_statement)
return SQLITE_OK;
bool WorkerThread::start()
{
// Mutex protection is necessary to ensure that m_threadID is initialized when the thread starts.
- DeprecatedMutexLocker lock(m_threadCreationMutex);
+ MutexLocker lock(m_threadCreationMutex);
if (m_threadID)
return true;
#endif
{
- DeprecatedMutexLocker lock(m_threadCreationMutex);
+ MutexLocker lock(m_threadCreationMutex);
m_workerGlobalScope = createWorkerGlobalScope(m_startupData->m_scriptURL, m_startupData->m_userAgent, m_startupData->m_contentSecurityPolicy, m_startupData->m_contentSecurityPolicyType, m_startupData->m_topOrigin.release());
if (m_runLoop.terminated()) {
void WorkerThread::stop()
{
// Mutex protection is necessary because stop() can be called before the context is fully created.
- DeprecatedMutexLocker lock(m_threadCreationMutex);
+ MutexLocker lock(m_threadCreationMutex);
// Ensure that tasks are being handled by thread event loop. If script execution weren't forbidden, a while(1) loop in JS could keep the thread alive forever.
if (m_workerGlobalScope) {
WorkerReportingProxy& m_workerReportingProxy;
RefPtr<WorkerGlobalScope> m_workerGlobalScope;
- DeprecatedMutex m_threadCreationMutex;
+ Mutex m_threadCreationMutex;
std::unique_ptr<WorkerThreadStartupData> m_startupData;
+2015-08-05 Filip Pizlo <fpizlo@apple.com>
+
+ Unreviewed, roll out http://trac.webkit.org/changeset/187972.
+
+ * Storage/StorageAreaSync.cpp:
+ (WebCore::StorageAreaSync::syncTimerFired):
+ (WebCore::StorageAreaSync::markImported):
+ (WebCore::StorageAreaSync::blockUntilImportComplete):
+ (WebCore::StorageAreaSync::performSync):
+ * Storage/StorageAreaSync.h:
+ * Storage/StorageTracker.cpp:
+ (WebCore::StorageTracker::setDatabaseDirectoryPath):
+ (WebCore::StorageTracker::finishedImportingOriginIdentifiers):
+ (WebCore::StorageTracker::syncImportOriginIdentifiers):
+ (WebCore::StorageTracker::syncFileSystemAndTrackerDatabase):
+ (WebCore::StorageTracker::setOriginDetails):
+ (WebCore::StorageTracker::syncSetOriginDetails):
+ (WebCore::StorageTracker::origins):
+ (WebCore::StorageTracker::deleteAllOrigins):
+ (WebCore::StorageTracker::syncDeleteAllOrigins):
+ (WebCore::StorageTracker::deleteOrigin):
+ (WebCore::StorageTracker::syncDeleteOrigin):
+ (WebCore::StorageTracker::canDeleteOrigin):
+ (WebCore::StorageTracker::cancelDeletingOrigin):
+ (WebCore::StorageTracker::diskUsageForOrigin):
+ * Storage/StorageTracker.h:
+
2015-08-05 Alex Christensen <achristensen@webkit.org>
Build DumpRenderTree with CMake.
bool partialSync = false;
{
- DeprecatedMutexLocker locker(m_syncLock);
+ MutexLocker locker(m_syncLock);
// Do not schedule another sync if we're still trying to complete the
// previous one. But, if we're shutting down, schedule it anyway.
void StorageAreaSync::markImported()
{
- DeprecatedMutexLocker locker(m_importLock);
+ MutexLocker locker(m_importLock);
m_importComplete = true;
m_importCondition.signal();
}
if (!m_storageArea)
return;
- DeprecatedMutexLocker locker(m_importLock);
+ MutexLocker locker(m_importLock);
while (!m_importComplete)
m_importCondition.wait(m_importLock);
m_storageArea = nullptr;
bool clearItems;
HashMap<String, String> items;
{
- DeprecatedMutexLocker locker(m_syncLock);
+ MutexLocker locker(m_syncLock);
ASSERT(m_syncScheduled);
sync(clearItems, items);
{
- DeprecatedMutexLocker locker(m_syncLock);
+ MutexLocker locker(m_syncLock);
m_syncInProgress = false;
}
const String m_databaseIdentifier;
- DeprecatedMutex m_syncLock;
+ Mutex m_syncLock;
HashMap<String, String> m_itemsPendingSync;
bool m_clearItemsWhileSyncing;
bool m_syncScheduled;
bool m_syncCloseDatabase;
- mutable DeprecatedMutex m_importLock;
+ mutable Mutex m_importLock;
ThreadCondition m_importCondition;
bool m_importComplete;
void markImported();
void StorageTracker::setDatabaseDirectoryPath(const String& path)
{
- DeprecatedMutexLocker locker(m_databaseMutex);
+ MutexLocker locker(m_databaseMutex);
if (m_database.isOpen())
m_database.close();
m_storageDirectoryPath = path.isolatedCopy();
{
- DeprecatedMutexLocker locker(m_originSetMutex);
+ MutexLocker locker(m_originSetMutex);
m_originSet.clear();
}
void StorageTracker::finishedImportingOriginIdentifiers()
{
- DeprecatedMutexLocker locker(m_databaseMutex);
+ MutexLocker locker(m_databaseMutex);
if (m_client)
m_client->didFinishLoadingOrigins();
}
ASSERT(!isMainThread());
{
- DeprecatedMutexLocker locker(m_databaseMutex);
+ MutexLocker locker(m_databaseMutex);
// Don't force creation of StorageTracker's db just because a tracker
// was initialized. It will be created if local storage dbs are found
int result;
{
- DeprecatedMutexLocker lockOrigins(m_originSetMutex);
+ MutexLocker lockOrigins(m_originSetMutex);
while ((result = statement.step()) == SQLITE_ROW)
m_originSet.add(statement.getColumnText(0).isolatedCopy());
}
syncFileSystemAndTrackerDatabase();
{
- DeprecatedMutexLocker locker(m_clientMutex);
+ MutexLocker locker(m_clientMutex);
if (m_client) {
- DeprecatedMutexLocker locker(m_originSetMutex);
+ MutexLocker locker(m_originSetMutex);
OriginSet::const_iterator end = m_originSet.end();
for (OriginSet::const_iterator it = m_originSet.begin(); it != end; ++it)
m_client->dispatchDidModifyOrigin(*it);
Vector<String> paths;
{
- DeprecatedMutexLocker locker(m_databaseMutex);
+ MutexLocker locker(m_databaseMutex);
paths = listDirectory(m_storageDirectoryPath, "*.localstorage");
}
// deletions from disk and from m_originSet.
OriginSet originSetCopy;
{
- DeprecatedMutexLocker locker(m_originSetMutex);
+ MutexLocker locker(m_originSetMutex);
for (OriginSet::const_iterator it = m_originSet.begin(), end = m_originSet.end(); it != end; ++it)
originSetCopy.add((*it).isolatedCopy());
}
return;
{
- DeprecatedMutexLocker locker(m_originSetMutex);
+ MutexLocker locker(m_originSetMutex);
if (m_originSet.contains(originIdentifier))
return;
SQLiteTransactionInProgressAutoCounter transactionCounter;
- DeprecatedMutexLocker locker(m_databaseMutex);
+ MutexLocker locker(m_databaseMutex);
openTrackerDatabase(true);
LOG_ERROR("Unable to establish origin '%s' in the tracker", originIdentifier.ascii().data());
{
- DeprecatedMutexLocker locker(m_originSetMutex);
+ MutexLocker locker(m_originSetMutex);
if (!m_originSet.contains(originIdentifier))
m_originSet.add(originIdentifier);
}
{
- DeprecatedMutexLocker locker(m_clientMutex);
+ MutexLocker locker(m_clientMutex);
if (m_client)
m_client->dispatchDidModifyOrigin(originIdentifier);
}
if (!m_isActive)
return;
- DeprecatedMutexLocker locker(m_originSetMutex);
+ MutexLocker locker(m_originSetMutex);
for (OriginSet::const_iterator it = m_originSet.begin(), end = m_originSet.end(); it != end; ++it)
result.append(SecurityOrigin::createFromDatabaseIdentifier(*it));
return;
{
- DeprecatedMutexLocker locker(m_originSetMutex);
+ MutexLocker locker(m_originSetMutex);
willDeleteAllOrigins();
m_originSet.clear();
}
SQLiteTransactionInProgressAutoCounter transactionCounter;
- DeprecatedMutexLocker locker(m_databaseMutex);
+ MutexLocker locker(m_databaseMutex);
openTrackerDatabase(false);
if (!m_database.isOpen())
deleteFile(statement.getColumnText(1));
{
- DeprecatedMutexLocker locker(m_clientMutex);
+ MutexLocker locker(m_clientMutex);
if (m_client)
m_client->dispatchDidModifyOrigin(statement.getColumnText(0));
}
String originId = origin->databaseIdentifier();
{
- DeprecatedMutexLocker locker(m_originSetMutex);
+ MutexLocker locker(m_originSetMutex);
willDeleteOrigin(originId);
m_originSet.remove(originId);
}
SQLiteTransactionInProgressAutoCounter transactionCounter;
- DeprecatedMutexLocker locker(m_databaseMutex);
+ MutexLocker locker(m_databaseMutex);
if (!canDeleteOrigin(originIdentifier)) {
LOG_ERROR("Attempted to delete origin '%s' while it was being created\n", originIdentifier.ascii().data());
bool shouldDeleteTrackerFiles = false;
{
- DeprecatedMutexLocker locker(m_originSetMutex);
+ MutexLocker locker(m_originSetMutex);
m_originSet.remove(originIdentifier);
shouldDeleteTrackerFiles = m_originSet.isEmpty();
}
}
{
- DeprecatedMutexLocker locker(m_clientMutex);
+ MutexLocker locker(m_clientMutex);
if (m_client)
m_client->dispatchDidModifyOrigin(originIdentifier);
}
bool StorageTracker::canDeleteOrigin(const String& originIdentifier)
{
ASSERT(!m_databaseMutex.tryLock());
- DeprecatedMutexLocker locker(m_originSetMutex);
+ MutexLocker locker(m_originSetMutex);
return m_originsBeingDeleted.contains(originIdentifier);
}
if (!m_isActive)
return;
- DeprecatedMutexLocker locker(m_databaseMutex);
+ MutexLocker locker(m_databaseMutex);
{
- DeprecatedMutexLocker locker(m_originSetMutex);
+ MutexLocker locker(m_originSetMutex);
if (!m_originsBeingDeleted.isEmpty())
m_originsBeingDeleted.remove(originIdentifier);
}
if (!m_isActive)
return 0;
- DeprecatedMutexLocker locker(m_databaseMutex);
+ MutexLocker locker(m_databaseMutex);
String path = databasePathForOrigin(origin->databaseIdentifier());
if (path.isEmpty())
void syncImportOriginIdentifiers();
// Mutex for m_database and m_storageDirectoryPath.
- DeprecatedMutex m_databaseMutex;
+ Mutex m_databaseMutex;
SQLiteDatabase m_database;
String m_storageDirectoryPath;
- DeprecatedMutex m_clientMutex;
+ Mutex m_clientMutex;
StorageTrackerClient* m_client;
// Guard for m_originSet and m_originsBeingDeleted.
- DeprecatedMutex m_originSetMutex;
+ Mutex m_originSetMutex;
typedef HashSet<String> OriginSet;
OriginSet m_originSet;
OriginSet m_originsBeingDeleted;
+2015-08-05 Filip Pizlo <fpizlo@apple.com>
+
+ Unreviewed, roll out http://trac.webkit.org/changeset/187972.
+
+ * WebCoreSupport/WebFixedPositionContent.mm:
+ (WebFixedPositionContentDataLock):
+ (-[WebFixedPositionContent scrollOrZoomChanged:]):
+ (-[WebFixedPositionContent overflowScrollPositionForLayer:changedTo:]):
+ (-[WebFixedPositionContent setViewportConstrainedLayers:stickyContainerMap:]):
+ (-[WebFixedPositionContent hasFixedOrStickyPositionLayers]):
+ (-[WebFixedPositionContent minimumOffsetFromFixedPositionLayersToAnchorEdge:ofRect:inLayer:]):
+
2015-08-04 Filip Pizlo <fpizlo@apple.com>
Rename Mutex to DeprecatedMutex
using namespace WebCore;
using namespace std;
-static DeprecatedMutex& WebFixedPositionContentDataLock()
+static Mutex& WebFixedPositionContentDataLock()
{
- DEPRECATED_DEFINE_STATIC_LOCAL(DeprecatedMutex, mutex, ());
+ DEPRECATED_DEFINE_STATIC_LOCAL(Mutex, mutex, ());
return mutex;
}
- (void)scrollOrZoomChanged:(CGRect)positionedObjectsRect
{
- DeprecatedMutexLocker lock(WebFixedPositionContentDataLock());
+ MutexLocker lock(WebFixedPositionContentDataLock());
LayerInfoMap::const_iterator end = _private->m_viewportConstrainedLayers.end();
for (LayerInfoMap::const_iterator it = _private->m_viewportConstrainedLayers.begin(); it != end; ++it) {
- (void)overflowScrollPositionForLayer:(CALayer *)scrollLayer changedTo:(CGPoint)scrollPosition
{
- DeprecatedMutexLocker lock(WebFixedPositionContentDataLock());
+ MutexLocker lock(WebFixedPositionContentDataLock());
LayerInfoMap::const_iterator end = _private->m_viewportConstrainedLayers.end();
for (LayerInfoMap::const_iterator it = _private->m_viewportConstrainedLayers.begin(); it != end; ++it) {
- (void)setViewportConstrainedLayers:(WTF::HashMap<CALayer *, std::unique_ptr<WebCore::ViewportConstraints>>&)layerMap stickyContainerMap:(WTF::HashMap<CALayer*, CALayer*>&)stickyContainers
{
- DeprecatedMutexLocker lock(WebFixedPositionContentDataLock());
+ MutexLocker lock(WebFixedPositionContentDataLock());
_private->m_viewportConstrainedLayers.clear();
- (BOOL)hasFixedOrStickyPositionLayers
{
- DeprecatedMutexLocker lock(WebFixedPositionContentDataLock());
+ MutexLocker lock(WebFixedPositionContentDataLock());
return !_private->m_viewportConstrainedLayers.isEmpty();
}
- (CGFloat)minimumOffsetFromFixedPositionLayersToAnchorEdge:(WebFixedPositionAnchorEdge)anchorEdge ofRect:(CGRect)rect inLayer:(CALayer *)layer
{
- DeprecatedMutexLocker lock(WebFixedPositionContentDataLock());
+ MutexLocker lock(WebFixedPositionContentDataLock());
ViewportConstraints::AnchorEdgeFlags anchorEdgeFlags = anchorEdgeFlagsForAnchorEdge(anchorEdge);
CGFloat minimumOffset = CGFLOAT_MAX;
LayerInfoMap::const_iterator end = _private->m_viewportConstrainedLayers.end();
+2015-08-05 Filip Pizlo <fpizlo@apple.com>
+
+ Unreviewed, roll out http://trac.webkit.org/changeset/187972.
+
+ * Storage/WebDatabaseManager.mm:
+ (transactionBackgroundTaskIdentifierLock):
+ (+[WebDatabaseManager startBackgroundTask]):
+ (+[WebDatabaseManager endBackgroundTask]):
+ * WebView/WebView.mm:
+ (-[WebView _synchronizeCustomFixedPositionLayoutRect]):
+ (-[WebView _setCustomFixedPositionLayoutRectInWebThread:synchronize:]):
+ (-[WebView _setCustomFixedPositionLayoutRect:]):
+ (-[WebView _fetchCustomFixedPositionLayoutRect:]):
+ * WebView/WebViewData.h:
+
2015-08-04 Filip Pizlo <fpizlo@apple.com>
Rename Mutex to DeprecatedMutex
#if PLATFORM(IOS)
@implementation WebDatabaseManager (WebDatabaseManagerInternal)
-static DeprecatedMutex& transactionBackgroundTaskIdentifierLock()
+static Mutex& transactionBackgroundTaskIdentifierLock()
{
- DEPRECATED_DEFINE_STATIC_LOCAL(DeprecatedMutex, mutex, ());
+ DEPRECATED_DEFINE_STATIC_LOCAL(Mutex, mutex, ());
return mutex;
}
+ (void)startBackgroundTask
{
- DeprecatedMutexLocker lock(transactionBackgroundTaskIdentifierLock());
+ MutexLocker lock(transactionBackgroundTaskIdentifierLock());
// If there's already an existing background task going on, there's no need to start a new one.
if (getTransactionBackgroundTaskIdentifier() != invalidWebBackgroundTaskIdentifier())
+ (void)endBackgroundTask
{
- DeprecatedMutexLocker lock(transactionBackgroundTaskIdentifierLock());
+ MutexLocker lock(transactionBackgroundTaskIdentifierLock());
// It is possible that we were unable to start the background task when the first transaction began.
// Don't try to end the task in that case.
IntRect newRect;
{
- DeprecatedMutexLocker locker(_private->pendingFixedPositionLayoutRectMutex);
+ MutexLocker locker(_private->pendingFixedPositionLayoutRectMutex);
if (CGRectIsNull(_private->pendingFixedPositionLayoutRect))
return;
newRect = enclosingIntRect(_private->pendingFixedPositionLayoutRect);
- (void)_setCustomFixedPositionLayoutRectInWebThread:(CGRect)rect synchronize:(BOOL)synchronize
{
{
- DeprecatedMutexLocker locker(_private->pendingFixedPositionLayoutRectMutex);
+ MutexLocker locker(_private->pendingFixedPositionLayoutRectMutex);
_private->pendingFixedPositionLayoutRect = rect;
}
if (!synchronize)
{
ASSERT(WebThreadIsLocked());
{
- DeprecatedMutexLocker locker(_private->pendingFixedPositionLayoutRectMutex);
+ MutexLocker locker(_private->pendingFixedPositionLayoutRectMutex);
_private->pendingFixedPositionLayoutRect = rect;
}
[self _synchronizeCustomFixedPositionLayoutRect];
- (BOOL)_fetchCustomFixedPositionLayoutRect:(NSRect*)rect
{
- DeprecatedMutexLocker locker(_private->pendingFixedPositionLayoutRectMutex);
+ MutexLocker locker(_private->pendingFixedPositionLayoutRectMutex);
if (CGRectIsNull(_private->pendingFixedPositionLayoutRect))
return false;
CGSize fixedLayoutSize;
BOOL mainViewIsScrollingOrZooming;
int32_t didDrawTiles;
- WTF::DeprecatedMutex pendingFixedPositionLayoutRectMutex;
+ WTF::Mutex pendingFixedPositionLayoutRectMutex;
CGRect pendingFixedPositionLayoutRect;
#endif
+2015-08-05 Filip Pizlo <fpizlo@apple.com>
+
+ Unreviewed, roll out http://trac.webkit.org/changeset/187972.
+
+ * Plugins/PluginMainThreadScheduler.cpp:
+ (WebCore::PluginMainThreadScheduler::scheduleCall):
+ (WebCore::PluginMainThreadScheduler::registerPlugin):
+ (WebCore::PluginMainThreadScheduler::unregisterPlugin):
+ (WebCore::PluginMainThreadScheduler::dispatchCallsForPlugin):
+ * Plugins/PluginMainThreadScheduler.h:
+ * WebIconDatabase.cpp:
+ (WebIconDatabase::didRemoveAllIcons):
+ (WebIconDatabase::didImportIconURLForPageURL):
+ (WebIconDatabase::deliverNotifications):
+ * WebLocalizableStrings.cpp:
+ (mainBundleLocStrings):
+ (frameworkLocStringsMutex):
+ (findCachedString):
+ (cacheString):
+
2015-08-05 Alex Christensen <achristensen@webkit.org>
Build DumpRenderTree with CMake.
void PluginMainThreadScheduler::scheduleCall(NPP npp, MainThreadFunction function, void* userData)
{
- DeprecatedMutexLocker lock(m_queueMutex);
+ MutexLocker lock(m_queueMutex);
CallQueueMap::iterator it = m_callQueueMap.find(npp);
if (it == m_callQueueMap.end())
void PluginMainThreadScheduler::registerPlugin(NPP npp)
{
- DeprecatedMutexLocker lock(m_queueMutex);
+ MutexLocker lock(m_queueMutex);
ASSERT(!m_callQueueMap.contains(npp));
m_callQueueMap.set(npp, Deque<Call>());
void PluginMainThreadScheduler::unregisterPlugin(NPP npp)
{
- DeprecatedMutexLocker lock(m_queueMutex);
+ MutexLocker lock(m_queueMutex);
ASSERT(m_callQueueMap.contains(npp));
m_callQueueMap.remove(npp);
for (auto& call : calls) {
// Check if the plug-in has been destroyed.
{
- DeprecatedMutexLocker lock(m_queueMutex);
+ MutexLocker lock(m_queueMutex);
if (!m_callQueueMap.contains(npp))
return;
}
bool m_callPending;
CallQueueMap m_callQueueMap;
- DeprecatedMutex m_queueMutex;
+ Mutex m_queueMutex;
};
} // namespace WebCore
void WebIconDatabase::didRemoveAllIcons()
{
// Queueing the empty string is a special way of saying "this queued notification is the didRemoveAllIcons notification"
- DeprecatedMutexLocker locker(m_notificationMutex);
+ MutexLocker locker(m_notificationMutex);
m_notificationQueue.append(String());
scheduleNotificationDelivery();
}
void WebIconDatabase::didImportIconURLForPageURL(const WTF::String& pageURL)
{
- DeprecatedMutexLocker locker(m_notificationMutex);
+ MutexLocker locker(m_notificationMutex);
m_notificationQueue.append(pageURL.isolatedCopy());
scheduleNotificationDelivery();
}
Vector<String> queue;
{
- DeprecatedMutexLocker locker(m_sharedWebIconDatabase->m_notificationMutex);
+ MutexLocker locker(m_sharedWebIconDatabase->m_notificationMutex);
queue.swap(m_sharedWebIconDatabase->m_notificationQueue);
m_sharedWebIconDatabase->m_deliveryRequested = false;
}
typedef HashMap<String, LocalizedString*> LocalizedStringMap;
-static DeprecatedMutex& mainBundleLocStringsMutex()
+static Mutex& mainBundleLocStringsMutex()
{
- DEPRECATED_DEFINE_STATIC_LOCAL(DeprecatedMutex, mutex, ());
+ DEPRECATED_DEFINE_STATIC_LOCAL(Mutex, mutex, ());
return mutex;
}
return map;
}
-static DeprecatedMutex& frameworkLocStringsMutex()
+static Mutex& frameworkLocStringsMutex()
{
- DEPRECATED_DEFINE_STATIC_LOCAL(DeprecatedMutex, mutex, ());
+ DEPRECATED_DEFINE_STATIC_LOCAL(Mutex, mutex, ());
return mutex;
}
static LocalizedString* findCachedString(WebLocalizableStringsBundle* stringsBundle, const String& key)
{
if (!stringsBundle) {
- DeprecatedMutexLocker lock(mainBundleLocStringsMutex());
+ MutexLocker lock(mainBundleLocStringsMutex());
return mainBundleLocStrings().get(key);
}
if (stringsBundle->bundle == WebKitLocalizableStringsBundle.bundle) {
- DeprecatedMutexLocker lock(frameworkLocStringsMutex());
+ MutexLocker lock(frameworkLocStringsMutex());
return frameworkLocStrings().get(key);
}
static void cacheString(WebLocalizableStringsBundle* stringsBundle, const String& key, LocalizedString* value)
{
if (!stringsBundle) {
- DeprecatedMutexLocker lock(mainBundleLocStringsMutex());
+ MutexLocker lock(mainBundleLocStringsMutex());
mainBundleLocStrings().set(key, value);
return;
}
- DeprecatedMutexLocker lock(frameworkLocStringsMutex());
+ MutexLocker lock(frameworkLocStringsMutex());
frameworkLocStrings().set(key, value);
}
+2015-08-05 Filip Pizlo <fpizlo@apple.com>
+
+ Unreviewed, roll out http://trac.webkit.org/changeset/187972.
+
+ * DatabaseProcess/DatabaseProcess.cpp:
+ (WebKit::DatabaseProcess::postDatabaseTask):
+ (WebKit::DatabaseProcess::performNextDatabaseTask):
+ * DatabaseProcess/DatabaseProcess.h:
+ * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
+ (WebKit::UniqueIDBDatabase::shutdown):
+ (WebKit::UniqueIDBDatabase::postMainThreadTask):
+ (WebKit::UniqueIDBDatabase::performNextMainThreadTask):
+ (WebKit::UniqueIDBDatabase::postDatabaseTask):
+ (WebKit::UniqueIDBDatabase::performNextDatabaseTask):
+ * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:
+ * Platform/IPC/Connection.cpp:
+ (IPC::Connection::sendSyncMessage):
+ (IPC::Connection::sendSyncMessageFromSecondaryThread):
+ (IPC::Connection::waitForSyncReply):
+ (IPC::Connection::processIncomingSyncReply):
+ (IPC::Connection::connectionDidClose):
+ * Platform/IPC/Connection.h:
+ * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
+ (WebKit::CoordinatedGraphicsScene::appendUpdate):
+ * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
+ * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
+ (WebKit::ThreadedCompositor::createCompositingThread):
+ (WebKit::ThreadedCompositor::runCompositingThread):
+ (WebKit::ThreadedCompositor::terminateCompositingThread):
+ * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
+ * Shared/Network/CustomProtocols/Cocoa/CustomProtocolManagerCocoa.mm:
+ (WebKit::CustomProtocolManager::addCustomProtocol):
+ (WebKit::CustomProtocolManager::removeCustomProtocol):
+ (WebKit::CustomProtocolManager::registerScheme):
+ (WebKit::CustomProtocolManager::unregisterScheme):
+ (WebKit::CustomProtocolManager::supportsScheme):
+ (WebKit::CustomProtocolManager::protocolForID):
+ * Shared/Network/CustomProtocols/CustomProtocolManager.h:
+ * Shared/linux/SeccompFilters/SeccompBroker.cpp:
+ * WebProcess/Plugins/PluginProcessConnectionManager.cpp:
+ (WebKit::PluginProcessConnectionManager::getPluginProcessConnection):
+ (WebKit::PluginProcessConnectionManager::removePluginProcessConnection):
+ (WebKit::PluginProcessConnectionManager::pluginProcessCrashed):
+ * WebProcess/Plugins/PluginProcessConnectionManager.h:
+ * WebProcess/WebPage/EventDispatcher.cpp:
+ (WebKit::EventDispatcher::addScrollingTreeForPage):
+ (WebKit::EventDispatcher::removeScrollingTreeForPage):
+ (WebKit::EventDispatcher::wheelEvent):
+ * WebProcess/WebPage/EventDispatcher.h:
+ * WebProcess/soup/WebKitSoupRequestInputStream.cpp:
+ (webkitSoupRequestInputStreamReadAsync):
+ (webkitSoupRequestInputStreamAddData):
+
2015-08-05 Ryosuke Niwa <rniwa@webkit.org>
WebInspectorProxy should make WKWebView first responder
{
ASSERT(RunLoop::isMain());
- DeprecatedMutexLocker locker(m_databaseTaskMutex);
+ MutexLocker locker(m_databaseTaskMutex);
m_databaseTasks.append(WTF::move(task));
std::unique_ptr<AsyncTask> task;
{
- DeprecatedMutexLocker locker(m_databaseTaskMutex);
+ MutexLocker locker(m_databaseTaskMutex);
ASSERT(!m_databaseTasks.isEmpty());
task = m_databaseTasks.takeFirst();
}
HashMap<UniqueIDBDatabaseIdentifier, RefPtr<UniqueIDBDatabase>> m_idbDatabases;
Deque<std::unique_ptr<AsyncTask>> m_databaseTasks;
- DeprecatedMutex m_databaseTaskMutex;
+ Mutex m_databaseTaskMutex;
};
} // namespace WebKit
ref();
{
- DeprecatedMutexLocker locker(m_databaseTaskMutex);
+ MutexLocker locker(m_databaseTaskMutex);
m_databaseTasks.clear();
}
if (!m_acceptingNewRequests && taskType == DatabaseTaskType::Normal)
return;
- DeprecatedMutexLocker locker(m_mainThreadTaskMutex);
+ MutexLocker locker(m_mainThreadTaskMutex);
m_mainThreadTasks.append(WTF::move(task));
std::unique_ptr<AsyncTask> task;
{
- DeprecatedMutexLocker locker(m_mainThreadTaskMutex);
+ MutexLocker locker(m_mainThreadTaskMutex);
// This database might be shutting down, in which case the task queue might be empty.
if (m_mainThreadTasks.isEmpty())
if (!m_acceptingNewRequests && taskType == DatabaseTaskType::Normal)
return;
- DeprecatedMutexLocker locker(m_databaseTaskMutex);
+ MutexLocker locker(m_databaseTaskMutex);
m_databaseTasks.append(WTF::move(task));
std::unique_ptr<AsyncTask> task;
{
- DeprecatedMutexLocker locker(m_databaseTaskMutex);
+ MutexLocker locker(m_databaseTaskMutex);
// This database might be shutting down on the main thread, in which case the task queue might be empty.
if (m_databaseTasks.isEmpty())
RefPtr<UniqueIDBDatabaseBackingStore> m_backingStore;
Deque<std::unique_ptr<AsyncTask>> m_databaseTasks;
- DeprecatedMutex m_databaseTaskMutex;
+ Mutex m_databaseTaskMutex;
Deque<std::unique_ptr<AsyncTask>> m_mainThreadTasks;
- DeprecatedMutex m_mainThreadTaskMutex;
+ Mutex m_mainThreadTaskMutex;
};
} // namespace WebKit
// Push the pending sync reply information on our stack.
{
- DeprecatedMutexLocker locker(m_syncReplyStateMutex);
+ MutexLocker locker(m_syncReplyStateMutex);
if (!m_shouldWaitForSyncReplies) {
didFailToSendSyncMessage();
return nullptr;
// Finally, pop the pending sync reply information.
{
- DeprecatedMutexLocker locker(m_syncReplyStateMutex);
+ MutexLocker locker(m_syncReplyStateMutex);
ASSERT(m_pendingSyncReplies.last().syncRequestID == syncRequestID);
m_pendingSyncReplies.removeLast();
}
// Push the pending sync reply information on our stack.
{
- DeprecatedMutexLocker locker(m_syncReplyStateMutex);
+ MutexLocker locker(m_syncReplyStateMutex);
if (!m_shouldWaitForSyncReplies)
return nullptr;
// Finally, pop the pending sync reply information.
{
- DeprecatedMutexLocker locker(m_syncReplyStateMutex);
+ MutexLocker locker(m_syncReplyStateMutex);
ASSERT(m_secondaryThreadPendingSyncReplyMap.contains(syncRequestID));
m_secondaryThreadPendingSyncReplyMap.remove(syncRequestID);
}
SyncMessageState::singleton().dispatchMessages(nullptr);
{
- DeprecatedMutexLocker locker(m_syncReplyStateMutex);
+ MutexLocker locker(m_syncReplyStateMutex);
// Second, check if there is a sync reply at the top of the stack.
ASSERT(!m_pendingSyncReplies.isEmpty());
void Connection::processIncomingSyncReply(std::unique_ptr<MessageDecoder> decoder)
{
- DeprecatedMutexLocker locker(m_syncReplyStateMutex);
+ MutexLocker locker(m_syncReplyStateMutex);
// Go through the stack of sync requests that have pending replies and see which one
// this reply is for.
platformInvalidate();
{
- DeprecatedMutexLocker locker(m_syncReplyStateMutex);
+ MutexLocker locker(m_syncReplyStateMutex);
ASSERT(m_shouldWaitForSyncReplies);
m_shouldWaitForSyncReplies = false;
class SyncMessageState;
friend class SyncMessageState;
- DeprecatedMutex m_syncReplyStateMutex;
+ Mutex m_syncReplyStateMutex;
bool m_shouldWaitForSyncReplies;
Vector<PendingSyncReply> m_pendingSyncReplies;
return;
ASSERT(isMainThread());
- DeprecatedMutexLocker locker(m_renderQueueMutex);
+ MutexLocker locker(m_renderQueueMutex);
m_renderQueue.append(WTF::move(function));
}
// Render queue can be accessed ony from main thread or updatePaintNode call stack!
Vector<std::function<void()>> m_renderQueue;
- DeprecatedMutex m_renderQueueMutex;
+ Mutex m_renderQueueMutex;
std::unique_ptr<WebCore::TextureMapper> m_textureMapper;
if (m_threadIdentifier)
return;
- DeprecatedMutexLocker locker(m_initializeRunLoopConditionMutex);
+ MutexLocker locker(m_initializeRunLoopConditionMutex);
m_threadIdentifier = createThread(compositingThreadEntry, this, "WebCore: ThreadedCompositor");
m_initializeRunLoopCondition.wait(m_initializeRunLoopConditionMutex);
void ThreadedCompositor::runCompositingThread()
{
{
- DeprecatedMutexLocker locker(m_initializeRunLoopConditionMutex);
+ MutexLocker locker(m_initializeRunLoopConditionMutex);
m_compositingRunLoop = std::make_unique<CompositingRunLoop>([&] {
renderLayerTree();
m_scene->purgeGLResources();
{
- DeprecatedMutexLocker locker(m_terminateRunLoopConditionMutex);
+ MutexLocker locker(m_terminateRunLoopConditionMutex);
m_compositingRunLoop = nullptr;
m_context = nullptr;
m_terminateRunLoopCondition.signal();
void ThreadedCompositor::terminateCompositingThread()
{
- DeprecatedMutexLocker locker(m_terminateRunLoopConditionMutex);
+ MutexLocker locker(m_terminateRunLoopConditionMutex);
m_scene->detach();
m_compositingRunLoop->runLoop().stop();
ThreadIdentifier m_threadIdentifier;
ThreadCondition m_initializeRunLoopCondition;
- DeprecatedMutex m_initializeRunLoopConditionMutex;
+ Mutex m_initializeRunLoopConditionMutex;
ThreadCondition m_terminateRunLoopCondition;
- DeprecatedMutex m_terminateRunLoopConditionMutex;
+ Mutex m_terminateRunLoopConditionMutex;
};
} // namespace WebKit
void CustomProtocolManager::addCustomProtocol(WKCustomProtocol *customProtocol)
{
ASSERT(customProtocol);
- DeprecatedMutexLocker locker(m_customProtocolMapMutex);
+ MutexLocker locker(m_customProtocolMapMutex);
m_customProtocolMap.add(customProtocol.customProtocolID, customProtocol);
}
void CustomProtocolManager::removeCustomProtocol(WKCustomProtocol *customProtocol)
{
ASSERT(customProtocol);
- DeprecatedMutexLocker locker(m_customProtocolMapMutex);
+ MutexLocker locker(m_customProtocolMapMutex);
m_customProtocolMap.remove(customProtocol.customProtocolID);
}
void CustomProtocolManager::registerScheme(const String& scheme)
{
ASSERT(!scheme.isNull());
- DeprecatedMutexLocker locker(m_registeredSchemesMutex);
+ MutexLocker locker(m_registeredSchemesMutex);
m_registeredSchemes.add(scheme);
}
void CustomProtocolManager::unregisterScheme(const String& scheme)
{
ASSERT(!scheme.isNull());
- DeprecatedMutexLocker locker(m_registeredSchemesMutex);
+ MutexLocker locker(m_registeredSchemesMutex);
m_registeredSchemes.remove(scheme);
}
if (scheme.isNull())
return false;
- DeprecatedMutexLocker locker(m_registeredSchemesMutex);
+ MutexLocker locker(m_registeredSchemesMutex);
return m_registeredSchemes.contains(scheme);
}
RetainPtr<WKCustomProtocol> CustomProtocolManager::protocolForID(uint64_t customProtocolID)
{
- DeprecatedMutexLocker locker(m_customProtocolMapMutex);
+ MutexLocker locker(m_customProtocolMapMutex);
CustomProtocolMap::const_iterator it = m_customProtocolMap.find(customProtocolID);
if (it == m_customProtocolMap.end())
#if PLATFORM(COCOA)
HashSet<String> m_registeredSchemes;
- DeprecatedMutex m_registeredSchemesMutex;
+ Mutex m_registeredSchemesMutex;
typedef HashMap<uint64_t, RetainPtr<WKCustomProtocol>> CustomProtocolMap;
CustomProtocolMap m_customProtocolMap;
- DeprecatedMutex m_customProtocolMapMutex;
+ Mutex m_customProtocolMapMutex;
// WKCustomProtocol objects can be removed from the m_customProtocolMap from multiple threads.
// We return a RetainPtr here because it is unsafe to return a raw pointer since the object might immediately be destroyed from a different thread.
int m_socket;
- mutable DeprecatedMutex m_socketLock;
+ mutable Mutex m_socketLock;
// Maps files that may be read by malloc() to open file descriptors.
HashMap<String, int> m_fileDescriptorCache;
m_pluginProcessConnections.append(pluginProcessConnection);
{
- DeprecatedMutexLocker locker(m_tokensAndConnectionsMutex);
+ MutexLocker locker(m_tokensAndConnectionsMutex);
ASSERT(!m_tokensAndConnections.contains(pluginProcessToken));
m_tokensAndConnections.set(pluginProcessToken, pluginProcessConnection->connection());
ASSERT(vectorIndex != notFound);
{
- DeprecatedMutexLocker locker(m_tokensAndConnectionsMutex);
+ MutexLocker locker(m_tokensAndConnectionsMutex);
ASSERT(m_tokensAndConnections.contains(pluginProcessConnection->pluginProcessToken()));
m_tokensAndConnections.remove(pluginProcessConnection->pluginProcessToken());
void PluginProcessConnectionManager::pluginProcessCrashed(uint64_t pluginProcessToken)
{
- DeprecatedMutexLocker locker(m_tokensAndConnectionsMutex);
+ MutexLocker locker(m_tokensAndConnectionsMutex);
IPC::Connection* connection = m_tokensAndConnections.get(pluginProcessToken);
// It's OK for connection to be null here; it will happen if this web process doesn't know
Vector<RefPtr<PluginProcessConnection>> m_pluginProcessConnections;
- DeprecatedMutex m_tokensAndConnectionsMutex;
+ Mutex m_tokensAndConnectionsMutex;
HashMap<uint64_t, RefPtr<IPC::Connection>> m_tokensAndConnections;
};
#if ENABLE(ASYNC_SCROLLING)
void EventDispatcher::addScrollingTreeForPage(WebPage* webPage)
{
- DeprecatedMutexLocker locker(m_scrollingTreesMutex);
+ MutexLocker locker(m_scrollingTreesMutex);
ASSERT(webPage->corePage()->scrollingCoordinator());
ASSERT(!m_scrollingTrees.contains(webPage->pageID()));
void EventDispatcher::removeScrollingTreeForPage(WebPage* webPage)
{
- DeprecatedMutexLocker locker(m_scrollingTreesMutex);
+ MutexLocker locker(m_scrollingTreesMutex);
ASSERT(m_scrollingTrees.contains(webPage->pageID()));
m_scrollingTrees.remove(webPage->pageID());
#endif
#if ENABLE(ASYNC_SCROLLING)
- DeprecatedMutexLocker locker(m_scrollingTreesMutex);
+ MutexLocker locker(m_scrollingTreesMutex);
if (RefPtr<ThreadedScrollingTree> scrollingTree = m_scrollingTrees.get(pageID)) {
// FIXME: It's pretty horrible that we're updating the back/forward state here.
// WebCore should always know the current state and know when it changes so the
Ref<WorkQueue> m_queue;
#if ENABLE(ASYNC_SCROLLING)
- DeprecatedMutex m_scrollingTreesMutex;
+ Mutex m_scrollingTreesMutex;
HashMap<uint64_t, RefPtr<WebCore::ThreadedScrollingTree>> m_scrollingTrees;
#endif
std::unique_ptr<WebCore::WheelEventDeltaTracker> m_recentWheelEventDeltaTracker;
uint64_t bytesReceived;
uint64_t bytesRead;
- DeprecatedMutex readLock;
+ Mutex readLock;
std::unique_ptr<AsyncReadData> pendingAsyncRead;
};
WebKitSoupRequestInputStream* stream = WEBKIT_SOUP_REQUEST_INPUT_STREAM(inputStream);
GRefPtr<GTask> task = adoptGRef(g_task_new(stream, cancellable, callback, userData));
- DeprecatedMutexLocker locker(stream->priv->readLock);
+ MutexLocker locker(stream->priv->readLock);
if (!webkitSoupRequestInputStreamHasDataToRead(stream) && !webkitSoupRequestInputStreamIsWaitingForData(stream)) {
g_task_return_int(task.get(), 0);
if (webkitSoupRequestInputStreamFinished(stream))
return;
- DeprecatedMutexLocker locker(stream->priv->readLock);
+ MutexLocker locker(stream->priv->readLock);
if (dataLength) {
// Truncate the dataLength to the contentLength if it's known.
+2015-08-05 Filip Pizlo <fpizlo@apple.com>
+
+ Unreviewed, roll out http://trac.webkit.org/changeset/187972.
+
+ * DumpRenderTree/JavaScriptThreading.cpp:
+ (javaScriptThreadsMutex):
+ (runJavaScriptThread):
+ (startJavaScriptThreads):
+ (stopJavaScriptThreads):
+ * TestWebKitAPI/Tests/WTF/WorkQueue.cpp:
+ (TestWebKitAPI::TEST):
+ * TestWebKitAPI/Tests/WTF/glib/WorkQueueGLib.cpp:
+ (TestWebKitAPI::TEST):
+
2015-08-05 Alex Christensen <achristensen@webkit.org>
Build DumpRenderTree with CMake.
static bool javaScriptThreadsShouldTerminate;
static JSContextGroupRef javaScriptThreadsGroup;
-static DeprecatedMutex& javaScriptThreadsMutex()
+static Mutex& javaScriptThreadsMutex()
{
- DEPRECATED_DEFINE_STATIC_LOCAL(DeprecatedMutex, staticMutex, ());
+ DEPRECATED_DEFINE_STATIC_LOCAL(Mutex, staticMutex, ());
return staticMutex;
}
JSGlobalContextRef ctx;
{
- DeprecatedMutexLocker locker(javaScriptThreadsMutex());
+ MutexLocker locker(javaScriptThreadsMutex());
ctx = JSGlobalContextCreateInGroup(javaScriptThreadsGroup, 0);
}
JSStringRef scriptRef;
{
- DeprecatedMutexLocker locker(javaScriptThreadsMutex());
+ MutexLocker locker(javaScriptThreadsMutex());
scriptRef = JSStringCreateWithUTF8CString(script);
}
while (true) {
{
- DeprecatedMutexLocker locker(javaScriptThreadsMutex());
+ MutexLocker locker(javaScriptThreadsMutex());
JSValueRef exception = 0;
JSEvaluateScript(ctx, scriptRef, 0, 0, 1, &exception);
ASSERT(!exception);
}
{
- DeprecatedMutexLocker locker(javaScriptThreadsMutex());
+ MutexLocker locker(javaScriptThreadsMutex());
const size_t valuesCount = 1024;
JSValueRef values[valuesCount];
for (size_t i = 0; i < valuesCount; ++i)
}
{
- DeprecatedMutexLocker locker(javaScriptThreadsMutex());
+ MutexLocker locker(javaScriptThreadsMutex());
if (javaScriptThreadsShouldTerminate)
break;
}
if (rand() % 5)
continue;
- DeprecatedMutexLocker locker(javaScriptThreadsMutex());
+ MutexLocker locker(javaScriptThreadsMutex());
ThreadIdentifier thread = currentThread();
detachThread(thread);
javaScriptThreads().remove(thread);
break;
}
- DeprecatedMutexLocker locker(javaScriptThreadsMutex());
+ MutexLocker locker(javaScriptThreadsMutex());
JSStringRelease(scriptRef);
JSGarbageCollect(ctx);
JSGlobalContextRelease(ctx);
{
javaScriptThreadsGroup = JSContextGroupCreate();
- DeprecatedMutexLocker locker(javaScriptThreadsMutex());
+ MutexLocker locker(javaScriptThreadsMutex());
for (size_t i = 0; i < javaScriptThreadsCount; ++i)
javaScriptThreads().add(createThread(&runJavaScriptThread, 0, 0));
void stopJavaScriptThreads()
{
{
- DeprecatedMutexLocker locker(javaScriptThreadsMutex());
+ MutexLocker locker(javaScriptThreadsMutex());
javaScriptThreadsShouldTerminate = true;
}
Vector<ThreadIdentifier, javaScriptThreadsCount> threads;
{
- DeprecatedMutexLocker locker(javaScriptThreadsMutex());
+ MutexLocker locker(javaScriptThreadsMutex());
copyToVector(javaScriptThreads(), threads);
ASSERT(threads.size() == javaScriptThreadsCount);
}
waitForThreadCompletion(threads[i]);
{
- DeprecatedMutexLocker locker(javaScriptThreadsMutex());
+ MutexLocker locker(javaScriptThreadsMutex());
javaScriptThreads().clear();
}
TEST(WTF_WorkQueue, Simple)
{
- DeprecatedMutex m_lock;
+ Mutex m_lock;
ThreadCondition m_testCompleted;
Vector<std::string> m_functionCallOrder;
int initialRefCount = queue->refCount();
EXPECT_EQ(1, initialRefCount);
- DeprecatedMutexLocker locker(m_lock);
+ MutexLocker locker(m_lock);
queue->dispatch([&](void) {
m_functionCallOrder.append(simpleTestLabel);
calledSimpleTest = true;
});
queue->dispatch([&](void) {
- DeprecatedMutexLocker locker(m_lock);
+ MutexLocker locker(m_lock);
m_functionCallOrder.append(thirdTestLabel);
calledThirdTest = true;
TEST(WTF_WorkQueue, TwoQueues)
{
- DeprecatedMutex m_lock;
+ Mutex m_lock;
ThreadCondition m_testQueue1Completed, m_testQueue2Completed;
Vector<std::string> m_functionCallOrder;
EXPECT_EQ(1, queue1->refCount());
EXPECT_EQ(1, queue2->refCount());
- DeprecatedMutexLocker locker(m_lock);
+ MutexLocker locker(m_lock);
queue1->dispatch([&](void) {
m_functionCallOrder.append(simpleTestLabel);
queue2->dispatch([&](void) {
std::this_thread::sleep_for(std::chrono::milliseconds(50));
- DeprecatedMutexLocker locker(m_lock);
+ MutexLocker locker(m_lock);
// Will fail if queue2 took the mutex before queue1.
EXPECT_TRUE(calledThirdTest);
});
queue1->dispatch([&](void) {
- DeprecatedMutexLocker locker(m_lock);
+ MutexLocker locker(m_lock);
m_functionCallOrder.append(thirdTestLabel);
calledThirdTest = true;
TEST(WTF_WorkQueue, DispatchAfter)
{
- DeprecatedMutex m_lock;
+ Mutex m_lock;
ThreadCondition m_testCompleted, m_dispatchAfterTestCompleted;
Vector<std::string> m_functionCallOrder;
auto queue = WorkQueue::create("com.apple.WebKit.Test.dispatchAfter");
- DeprecatedMutexLocker locker(m_lock);
+ MutexLocker locker(m_lock);
queue->dispatch([&](void) {
- DeprecatedMutexLocker locker(m_lock);
+ MutexLocker locker(m_lock);
m_functionCallOrder.append(simpleTestLabel);
calledSimpleTest = true;
m_testCompleted.signal();
});
queue->dispatchAfter(std::chrono::milliseconds(500), [&](void) {
- DeprecatedMutexLocker locker(m_lock);
+ MutexLocker locker(m_lock);
m_functionCallOrder.append(dispatchAfterLabel);
calledDispatchAfterTest = true;
m_dispatchAfterTestCompleted.signal();
TEST(WTF_WorkQueue, AsyncIO)
{
struct TestingContext {
- DeprecatedMutex m_lock;
+ Mutex m_lock;
ThreadCondition m_testCompleted;
GMainContext* m_mainContext;
} context;
GUniquePtr<char> currentDirectory(g_get_current_dir());
GRefPtr<GFile> file = adoptGRef(g_file_new_for_path(currentDirectory.get()));
- DeprecatedMutexLocker locker(context.m_lock);
+ MutexLocker locker(context.m_lock);
queue->dispatch([&](void) {
EXPECT_TRUE(g_main_context_get_thread_default());
EXPECT_TRUE(g_main_context_get_thread_default() != context.m_mainContext);
g_file_query_info_async(file.get(), G_FILE_ATTRIBUTE_STANDARD_SIZE, G_FILE_QUERY_INFO_NONE, G_PRIORITY_DEFAULT, nullptr,
[](GObject*, GAsyncResult*, gpointer userData) {
TestingContext* context = static_cast<TestingContext*>(userData);
- DeprecatedMutexLocker locker(context->m_lock);
+ MutexLocker locker(context->m_lock);
EXPECT_EQ(g_main_context_get_thread_default(), context->m_mainContext);
context->m_testCompleted.signal();
}, &context);