Diff
Modified: trunk/Source/_javascript_Core/API/JSVirtualMachine.mm (257687 => 257688)
--- trunk/Source/_javascript_Core/API/JSVirtualMachine.mm 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Source/_javascript_Core/API/JSVirtualMachine.mm 2020-03-01 05:01:30 UTC (rev 257688)
@@ -70,13 +70,13 @@
+ (void)addWrapper:(JSVirtualMachine *)wrapper forJSContextGroupRef:(JSContextGroupRef)group
{
- std::lock_guard<Lock> lock(wrapperCacheMutex);
+ auto locker = holdLock(wrapperCacheMutex);
NSMapInsert(wrapperCache(), group, (__bridge void*)wrapper);
}
+ (JSVirtualMachine *)wrapperForJSContextGroupRef:(JSContextGroupRef)group
{
- std::lock_guard<Lock> lock(wrapperCacheMutex);
+ auto locker = holdLock(wrapperCacheMutex);
return (__bridge JSVirtualMachine *)NSMapGet(wrapperCache(), group);
}
Modified: trunk/Source/_javascript_Core/API/glib/JSCVirtualMachine.cpp (257687 => 257688)
--- trunk/Source/_javascript_Core/API/glib/JSCVirtualMachine.cpp 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Source/_javascript_Core/API/glib/JSCVirtualMachine.cpp 2020-03-01 05:01:30 UTC (rev 257688)
@@ -57,7 +57,7 @@
static void addWrapper(JSContextGroupRef group, JSCVirtualMachine* vm)
{
- std::lock_guard<Lock> lock(wrapperCacheMutex);
+ auto locker = holdLock(wrapperCacheMutex);
ASSERT(!wrapperMap().contains(group));
wrapperMap().set(group, vm);
}
@@ -64,7 +64,7 @@
static void removeWrapper(JSContextGroupRef group)
{
- std::lock_guard<Lock> lock(wrapperCacheMutex);
+ auto locker = holdLock(wrapperCacheMutex);
ASSERT(wrapperMap().contains(group));
wrapperMap().remove(group);
}
Modified: trunk/Source/_javascript_Core/ChangeLog (257687 => 257688)
--- trunk/Source/_javascript_Core/ChangeLog 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Source/_javascript_Core/ChangeLog 2020-03-01 05:01:30 UTC (rev 257688)
@@ -1,3 +1,28 @@
+2020-02-29 Yusuke Suzuki <[email protected]>
+
+ Remove std::lock_guard
+ https://bugs.webkit.org/show_bug.cgi?id=206451
+
+ Reviewed by Anders Carlsson.
+
+ * API/JSVirtualMachine.mm:
+ (+[JSVMWrapperCache addWrapper:forJSContextGroupRef:]):
+ (+[JSVMWrapperCache wrapperForJSContextGroupRef:]):
+ * API/glib/JSCVirtualMachine.cpp:
+ (addWrapper):
+ (removeWrapper):
+ * heap/HeapSnapshotBuilder.cpp:
+ (JSC::HeapSnapshotBuilder::analyzeNode):
+ (JSC::HeapSnapshotBuilder::analyzeEdge):
+ (JSC::HeapSnapshotBuilder::analyzePropertyNameEdge):
+ (JSC::HeapSnapshotBuilder::analyzeVariableNameEdge):
+ (JSC::HeapSnapshotBuilder::analyzeIndexEdge):
+ (JSC::HeapSnapshotBuilder::setOpaqueRootReachabilityReasonForCell):
+ * heap/MachineStackMarker.cpp:
+ (JSC::MachineThreads::tryCopyOtherThreadStacks):
+ * runtime/JSRunLoopTimer.cpp:
+ (JSC::JSRunLoopTimer::timerDidFire):
+
2020-02-28 Yusuke Suzuki <[email protected]>
[JSC] BuiltinNames' HashMap should be small
Modified: trunk/Source/_javascript_Core/heap/HeapSnapshotBuilder.cpp (257687 => 257688)
--- trunk/Source/_javascript_Core/heap/HeapSnapshotBuilder.cpp 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Source/_javascript_Core/heap/HeapSnapshotBuilder.cpp 2020-03-01 05:01:30 UTC (rev 257688)
@@ -88,7 +88,7 @@
if (previousSnapshotHasNodeForCell(cell, identifier))
return;
- std::lock_guard<Lock> lock(m_buildingNodeMutex);
+ auto locker = holdLock(m_buildingNodeMutex);
m_snapshot->appendNode(HeapSnapshotNode(cell, getNextObjectIdentifier()));
}
@@ -101,7 +101,7 @@
if (from == to)
return;
- std::lock_guard<Lock> lock(m_buildingEdgeMutex);
+ auto locker = holdLock(m_buildingEdgeMutex);
if (m_snapshotType == SnapshotType::GCDebuggingSnapshot && !from) {
if (rootMarkReason == SlotVisitor::RootMarkReason::None && m_snapshotType == SnapshotType::GCDebuggingSnapshot)
@@ -120,7 +120,7 @@
ASSERT(m_profiler.activeHeapAnalyzer() == this);
ASSERT(to);
- std::lock_guard<Lock> lock(m_buildingEdgeMutex);
+ auto locker = holdLock(m_buildingEdgeMutex);
m_edges.append(HeapSnapshotEdge(from, to, EdgeType::Property, propertyName));
}
@@ -130,7 +130,7 @@
ASSERT(m_profiler.activeHeapAnalyzer() == this);
ASSERT(to);
- std::lock_guard<Lock> lock(m_buildingEdgeMutex);
+ auto locker = holdLock(m_buildingEdgeMutex);
m_edges.append(HeapSnapshotEdge(from, to, EdgeType::Variable, variableName));
}
@@ -140,7 +140,7 @@
ASSERT(m_profiler.activeHeapAnalyzer() == this);
ASSERT(to);
- std::lock_guard<Lock> lock(m_buildingEdgeMutex);
+ auto locker = holdLock(m_buildingEdgeMutex);
m_edges.append(HeapSnapshotEdge(from, to, index));
}
@@ -150,7 +150,7 @@
if (!reason || !*reason || m_snapshotType != SnapshotType::GCDebuggingSnapshot)
return;
- std::lock_guard<Lock> lock(m_buildingEdgeMutex);
+ auto locker = holdLock(m_buildingEdgeMutex);
m_rootData.ensure(cell, [] () -> RootData {
return { };
Modified: trunk/Source/_javascript_Core/heap/MachineStackMarker.cpp (257687 => 257688)
--- trunk/Source/_javascript_Core/heap/MachineStackMarker.cpp 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Source/_javascript_Core/heap/MachineStackMarker.cpp 2020-03-01 05:01:30 UTC (rev 257688)
@@ -137,8 +137,8 @@
{
// Prevent two VMs from suspending each other's threads at the same time,
// which can cause deadlock: <rdar://problem/20300842>.
- static Lock mutex;
- std::lock_guard<Lock> lock(mutex);
+ static Lock suspendLock;
+ auto suspendLocker = holdLock(suspendLock);
*size = 0;
Modified: trunk/Source/_javascript_Core/runtime/JSRunLoopTimer.cpp (257687 => 257688)
--- trunk/Source/_javascript_Core/runtime/JSRunLoopTimer.cpp 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Source/_javascript_Core/runtime/JSRunLoopTimer.cpp 2020-03-01 05:01:30 UTC (rev 257688)
@@ -295,7 +295,7 @@
}
}
- std::lock_guard<JSLock> lock(m_apiLock.get());
+ auto locker = holdLock(m_apiLock.get());
RefPtr<VM> vm = m_apiLock->vm();
if (!vm) {
// The VM has been destroyed, so we should just give up.
Modified: trunk/Source/WTF/ChangeLog (257687 => 257688)
--- trunk/Source/WTF/ChangeLog 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Source/WTF/ChangeLog 2020-03-01 05:01:30 UTC (rev 257688)
@@ -1,3 +1,51 @@
+2020-02-29 Yusuke Suzuki <[email protected]>
+
+ Remove std::lock_guard
+ https://bugs.webkit.org/show_bug.cgi?id=206451
+
+ Reviewed by Anders Carlsson.
+
+ Remove use of std::lock_guard. This is deprecated in C++17.
+
+ 1. For particularly low-level usage (like, bmalloc, std::mutex), use std::scoped_lock.
+ 2. For the other purpose, use holdLock.
+
+ * benchmarks/ConditionSpeedTest.cpp:
+ * wtf/CryptographicallyRandomNumber.cpp:
+ * wtf/HashTable.cpp:
+ (WTF::HashTableStats::recordCollisionAtCount):
+ (WTF::HashTableStats::dumpStats):
+ * wtf/HashTable.h:
+ (WTF::KeyTraits>::invalidateIterators):
+ (WTF::addIterator):
+ (WTF::removeIterator):
+ * wtf/Language.cpp:
+ (WTF::userPreferredLanguages):
+ * wtf/MainThread.cpp:
+ (WTF::dispatchFunctionsFromMainThread):
+ (WTF::callOnMainThread):
+ (WTF::callOnMainAndWait):
+ * wtf/StackStats.cpp:
+ (WTF::StackStats::CheckPoint::CheckPoint):
+ (WTF::StackStats::CheckPoint::~CheckPoint):
+ (WTF::StackStats::probe):
+ (WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint):
+ (WTF::StackStats::LayoutCheckPoint::~LayoutCheckPoint):
+ * wtf/WordLock.cpp:
+ (WTF::WordLock::unlockSlow):
+ * wtf/cf/LanguageCF.cpp:
+ (WTF::languagePreferencesDidChange):
+ (WTF::platformUserPreferredLanguages):
+ * wtf/text/StringView.cpp:
+ (WTF::StringView::invalidate):
+ (WTF::StringView::adoptUnderlyingString):
+ (WTF::StringView::setUnderlyingString):
+ * wtf/unicode/icu/CollatorICU.cpp:
+ (WTF::Collator::Collator):
+ (WTF::Collator::~Collator):
+ * wtf/win/LanguageWin.cpp:
+ (WTF::platformLanguage):
+
2020-02-28 Yusuke Suzuki <[email protected]>
[JSC] BuiltinNames' HashMap should be small
Modified: trunk/Source/WTF/benchmarks/ConditionSpeedTest.cpp (257687 => 257688)
--- trunk/Source/WTF/benchmarks/ConditionSpeedTest.cpp 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Source/WTF/benchmarks/ConditionSpeedTest.cpp 2020-03-01 05:01:30 UTC (rev 257688)
@@ -118,7 +118,7 @@
notify(fullCondition, mustNotify);
{
- std::lock_guard<LockType> locker(receivedLock);
+ auto locker = holdLock(receivedLock);
received.append(result);
}
}
@@ -152,7 +152,7 @@
thread->waitForCompletion();
{
- std::lock_guard<LockType> locker(lock);
+ auto locker = holdLock(lock);
shouldContinue = false;
}
notifyAll(emptyCondition);
Modified: trunk/Source/WTF/wtf/CryptographicallyRandomNumber.cpp (257687 => 257688)
--- trunk/Source/WTF/wtf/CryptographicallyRandomNumber.cpp 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Source/WTF/wtf/CryptographicallyRandomNumber.cpp 2020-03-01 05:01:30 UTC (rev 257688)
@@ -138,7 +138,7 @@
uint32_t ARC4RandomNumberGenerator::randomNumber()
{
- std::lock_guard<Lock> lock(m_mutex);
+ auto locker = holdLock(m_mutex);
m_count -= 4;
stirIfNeeded();
@@ -147,7 +147,7 @@
void ARC4RandomNumberGenerator::randomValues(void* buffer, size_t length)
{
- std::lock_guard<Lock> lock(m_mutex);
+ auto locker = holdLock(m_mutex);
unsigned char* result = reinterpret_cast<unsigned char*>(buffer);
stirIfNeeded();
Modified: trunk/Source/WTF/wtf/HashTable.cpp (257687 => 257688)
--- trunk/Source/WTF/wtf/HashTable.cpp 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Source/WTF/wtf/HashTable.cpp 2020-03-01 05:01:30 UTC (rev 257688)
@@ -43,7 +43,7 @@
void HashTableStats::recordCollisionAtCount(unsigned count)
{
- std::lock_guard<Lock> lock(hashTableStatsMutex);
+ auto locker = holdLock(hashTableStatsMutex);
if (count > maxCollisions)
maxCollisions = count;
@@ -53,7 +53,7 @@
void HashTableStats::dumpStats()
{
- std::lock_guard<Lock> lock(hashTableStatsMutex);
+ auto locker = holdLock(hashTableStatsMutex);
dataLogF("\nWTF::HashTable statistics\n\n");
dataLogF("%u accesses\n", numAccesses.load());
Modified: trunk/Source/WTF/wtf/HashTable.h (257687 => 257688)
--- trunk/Source/WTF/wtf/HashTable.h 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Source/WTF/wtf/HashTable.h 2020-03-01 05:01:30 UTC (rev 257688)
@@ -1495,7 +1495,7 @@
template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits>
void HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::invalidateIterators()
{
- std::lock_guard<Lock> lock(*m_mutex);
+ auto locker = holdLock(*m_mutex);
const_iterator* next;
for (const_iterator* p = m_iterators; p; p = next) {
next = p->m_next;
@@ -1517,7 +1517,7 @@
if (!table) {
it->m_next = 0;
} else {
- std::lock_guard<Lock> lock(*table->m_mutex);
+ auto locker = holdLock(*table->m_mutex);
ASSERT(table->m_iterators != it);
it->m_next = table->m_iterators;
table->m_iterators = it;
@@ -1536,7 +1536,7 @@
ASSERT(!it->m_next);
ASSERT(!it->m_previous);
} else {
- std::lock_guard<Lock> lock(*it->m_table->m_mutex);
+ auto locker = holdLock(*it->m_table->m_mutex);
if (it->m_next) {
ASSERT(it->m_next->m_previous == it);
it->m_next->m_previous = it->m_previous;
Modified: trunk/Source/WTF/wtf/Language.cpp (257687 => 257688)
--- trunk/Source/WTF/wtf/Language.cpp 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Source/WTF/wtf/Language.cpp 2020-03-01 05:01:30 UTC (rev 257688)
@@ -103,7 +103,7 @@
Vector<String> userPreferredLanguages()
{
{
- std::lock_guard<Lock> lock(userPreferredLanguagesMutex);
+ auto locker = holdLock(userPreferredLanguagesMutex);
Vector<String>& override = preferredLanguagesOverride();
if (!override.isEmpty())
return isolatedCopy(override);
Modified: trunk/Source/WTF/wtf/MainThread.cpp (257687 => 257688)
--- trunk/Source/WTF/wtf/MainThread.cpp 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Source/WTF/wtf/MainThread.cpp 2020-03-01 05:01:30 UTC (rev 257688)
@@ -84,7 +84,7 @@
while (true) {
{
- std::lock_guard<Lock> lock(mainThreadFunctionQueueMutex);
+ auto locker = holdLock(mainThreadFunctionQueueMutex);
if (!functionQueue().size())
break;
@@ -124,7 +124,7 @@
bool needToSchedule = false;
{
- std::lock_guard<Lock> lock(mainThreadFunctionQueueMutex);
+ auto locker = holdLock(mainThreadFunctionQueueMutex);
needToSchedule = functionQueue().size() == 0;
functionQueue().append(WTFMove(function));
}
@@ -175,7 +175,7 @@
auto functionImpl = [&, function = WTFMove(function)] {
function();
- std::lock_guard<Lock> lock(mutex);
+ auto locker = holdLock(mutex);
isFinished = true;
conditionVariable.notifyOne();
};
Modified: trunk/Source/WTF/wtf/StackStats.cpp (257687 => 257688)
--- trunk/Source/WTF/wtf/StackStats.cpp 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Source/WTF/wtf/StackStats.cpp 2020-03-01 05:01:30 UTC (rev 257688)
@@ -68,7 +68,7 @@
StackStats::CheckPoint::CheckPoint()
{
- std::lock_guard<Lock> lock(StackStats::s_sharedMutex);
+ auto locker = holdLock(StackStats::s_sharedMutex);
Thread& thread = Thread::current();
StackStats::PerThreadStats& t = thread.stackStats();
const StackBounds& stack = thread.stack();
@@ -121,7 +121,7 @@
StackStats::CheckPoint::~CheckPoint()
{
- std::lock_guard<Lock> lock(StackStats::s_sharedMutex);
+ auto locker = holdLock(StackStats::s_sharedMutex);
Thread& thread = Thread::current();
StackStats::PerThreadStats& t = thread.stackStats();
@@ -148,7 +148,7 @@
void StackStats::probe()
{
- std::lock_guard<Lock> lock(StackStats::s_sharedMutex);
+ auto locker = holdLock(StackStats::s_sharedMutex);
Thread& thread = Thread::current();
StackStats::PerThreadStats& t = thread.stackStats();
const StackBounds& stack = thread.stack();
@@ -203,7 +203,7 @@
// probe first, we can avoid re-entering the lock.
StackStats::probe();
- std::lock_guard<Lock> lock(StackStats::s_sharedMutex);
+ auto locker = holdLock(StackStats::s_sharedMutex);
Thread& thread = Thread::current();
StackStats::PerThreadStats& t = thread.stackStats();
const StackBounds& stack = thread.stack();
@@ -264,7 +264,7 @@
StackStats::LayoutCheckPoint::~LayoutCheckPoint()
{
- std::lock_guard<Lock> lock(StackStats::s_sharedMutex);
+ auto locker = holdLock(StackStats::s_sharedMutex);
// Pop to the previous layout checkpoint:
StackStats::s_topLayoutCheckPoint = m_prev;
Modified: trunk/Source/WTF/wtf/WordLock.cpp (257687 => 257688)
--- trunk/Source/WTF/wtf/WordLock.cpp 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Source/WTF/wtf/WordLock.cpp 2020-03-01 05:01:30 UTC (rev 257688)
@@ -236,7 +236,7 @@
{
// Be sure to hold the lock across our call to notify_one() because a spurious wakeup could
// cause the thread at the head of the queue to exit and delete queueHead.
- std::lock_guard<std::mutex> locker(queueHead->parkingLock);
+ std::scoped_lock<std::mutex> locker(queueHead->parkingLock);
queueHead->shouldPark = false;
// Doesn't matter if we notify_all() or notify_one() here since the only thread that could be
Modified: trunk/Source/WTF/wtf/cf/LanguageCF.cpp (257687 => 257688)
--- trunk/Source/WTF/wtf/cf/LanguageCF.cpp 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Source/WTF/wtf/cf/LanguageCF.cpp 2020-03-01 05:01:30 UTC (rev 257688)
@@ -83,7 +83,7 @@
static void languagePreferencesDidChange(CFNotificationCenterRef, void*, CFStringRef, const void*, CFDictionaryRef)
{
{
- std::lock_guard<Lock> lock(preferredLanguagesMutex);
+ auto locker = holdLock(preferredLanguagesMutex);
preferredLanguages().clear();
}
@@ -100,7 +100,7 @@
});
#endif
- std::lock_guard<Lock> lock(preferredLanguagesMutex);
+ auto locker = holdLock(preferredLanguagesMutex);
Vector<String>& userPreferredLanguages = preferredLanguages();
if (userPreferredLanguages.isEmpty()) {
Modified: trunk/Source/WTF/wtf/text/StringView.cpp (257687 => 257688)
--- trunk/Source/WTF/wtf/text/StringView.cpp 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Source/WTF/wtf/text/StringView.cpp 2020-03-01 05:01:30 UTC (rev 257688)
@@ -308,7 +308,7 @@
{
UnderlyingString* underlyingString;
{
- std::lock_guard<Lock> lock(underlyingStringsMutex);
+ auto locker = holdLock(underlyingStringsMutex);
underlyingString = underlyingStrings().take(&stringToBeDestroyed);
if (!underlyingString)
return;
@@ -325,7 +325,7 @@
void StringView::adoptUnderlyingString(UnderlyingString* underlyingString)
{
if (m_underlyingString) {
- std::lock_guard<Lock> lock(underlyingStringsMutex);
+ auto locker = holdLock(underlyingStringsMutex);
if (!--m_underlyingString->refCount) {
if (m_underlyingString->isValid) {
underlyingStrings().remove(&m_underlyingString->string);
@@ -342,7 +342,7 @@
if (!string)
underlyingString = nullptr;
else {
- std::lock_guard<Lock> lock(underlyingStringsMutex);
+ auto locker = holdLock(underlyingStringsMutex);
auto result = underlyingStrings().add(string, nullptr);
if (result.isNewEntry)
result.iterator->value = new UnderlyingString(*string);
Modified: trunk/Source/WTF/wtf/unicode/icu/CollatorICU.cpp (257687 => 257688)
--- trunk/Source/WTF/wtf/unicode/icu/CollatorICU.cpp 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Source/WTF/wtf/unicode/icu/CollatorICU.cpp 2020-03-01 05:01:30 UTC (rev 257688)
@@ -106,7 +106,7 @@
UErrorCode status = U_ZERO_ERROR;
{
- std::lock_guard<Lock> lock(cachedCollatorMutex);
+ auto locker = holdLock(cachedCollatorMutex);
if (cachedCollator && localesMatch(cachedCollatorLocale, locale) && cachedCollatorShouldSortLowercaseFirst == shouldSortLowercaseFirst) {
m_collator = cachedCollator;
m_locale = cachedCollatorLocale;
@@ -136,7 +136,7 @@
Collator::~Collator()
{
- std::lock_guard<Lock> lock(cachedCollatorMutex);
+ auto locker = holdLock(cachedCollatorMutex);
if (cachedCollator) {
ucol_close(cachedCollator);
fastFree(cachedCollatorLocale);
Modified: trunk/Source/WTF/wtf/win/LanguageWin.cpp (257687 => 257688)
--- trunk/Source/WTF/wtf/win/LanguageWin.cpp 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Source/WTF/wtf/win/LanguageWin.cpp 2020-03-01 05:01:30 UTC (rev 257688)
@@ -57,7 +57,7 @@
static String platformLanguage()
{
- std::lock_guard<Lock> lock(platformLanguageMutex);
+ auto locker = holdLock(platformLanguageMutex);
static String computedDefaultLanguage;
if (!computedDefaultLanguage.isEmpty())
Modified: trunk/Source/WebCore/ChangeLog (257687 => 257688)
--- trunk/Source/WebCore/ChangeLog 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Source/WebCore/ChangeLog 2020-03-01 05:01:30 UTC (rev 257688)
@@ -1,3 +1,87 @@
+2020-02-29 Yusuke Suzuki <[email protected]>
+
+ Remove std::lock_guard
+ https://bugs.webkit.org/show_bug.cgi?id=206451
+
+ Reviewed by Anders Carlsson.
+
+ * Modules/webaudio/AudioBufferSourceNode.cpp:
+ (WebCore::AudioBufferSourceNode::setBuffer):
+ * Modules/webaudio/AudioParamTimeline.cpp:
+ (WebCore::AudioParamTimeline::insertEvent):
+ (WebCore::AudioParamTimeline::cancelScheduledValues):
+ * Modules/webaudio/ConvolverNode.cpp:
+ (WebCore::ConvolverNode::reset):
+ (WebCore::ConvolverNode::setBuffer):
+ * Modules/webaudio/MediaElementAudioSourceNode.cpp:
+ (WebCore::MediaElementAudioSourceNode::setFormat):
+ * Modules/webaudio/MediaStreamAudioSourceNode.cpp:
+ (WebCore::MediaStreamAudioSourceNode::setFormat):
+ * Modules/webaudio/OscillatorNode.cpp:
+ (WebCore::OscillatorNode::setPeriodicWave):
+ * Modules/webaudio/PannerNode.cpp:
+ (WebCore::PannerNode::setPanningModel):
+ * Modules/webaudio/WaveShaperProcessor.cpp:
+ (WebCore::WaveShaperProcessor::setCurve):
+ (WebCore::WaveShaperProcessor::setOversample):
+ * Modules/webdatabase/Database.cpp:
+ (WebCore::Database::Database):
+ (WebCore::Database::performOpenAndVerify):
+ (WebCore::Database::closeDatabase):
+ (WebCore::Database::getCachedVersion const):
+ (WebCore::Database::setCachedVersion):
+ * Modules/webdatabase/DatabaseManager.cpp:
+ (WebCore::DatabaseManager::addProposedDatabase):
+ (WebCore::DatabaseManager::removeProposedDatabase):
+ (WebCore::DatabaseManager::fullPathForDatabase):
+ (WebCore::DatabaseManager::detailsForNameAndOrigin):
+ * crypto/CryptoAlgorithmRegistry.cpp:
+ (WebCore::CryptoAlgorithmRegistry::identifier):
+ (WebCore::CryptoAlgorithmRegistry::name):
+ (WebCore::CryptoAlgorithmRegistry::create):
+ (WebCore::CryptoAlgorithmRegistry::registerAlgorithm):
+ * inspector/agents/WebHeapAgent.cpp:
+ (WebCore::SendGarbageCollectionEventsTask::addGarbageCollection):
+ (WebCore::SendGarbageCollectionEventsTask::reset):
+ (WebCore::SendGarbageCollectionEventsTask::timerFired):
+ * page/scrolling/ScrollingThread.cpp:
+ (WebCore::ScrollingThread::dispatch):
+ (WebCore::ScrollingThread::dispatchFunctionsFromScrollingThread):
+ * page/scrolling/generic/ScrollingThreadGeneric.cpp:
+ (WebCore::ScrollingThread::initializeRunLoop):
+ * page/scrolling/mac/ScrollingThreadMac.mm:
+ (WebCore::ScrollingThread::initializeRunLoop):
+ * platform/audio/ReverbConvolver.cpp:
+ (WebCore::ReverbConvolver::~ReverbConvolver):
+ * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
+ (WebCore::AudioSourceProviderAVFObjC::~AudioSourceProviderAVFObjC):
+ (WebCore::AudioSourceProviderAVFObjC::finalizeCallback):
+ (WebCore::AudioSourceProviderAVFObjC::prepareCallback):
+ (WebCore::AudioSourceProviderAVFObjC::unprepareCallback):
+ (WebCore::AudioSourceProviderAVFObjC::processCallback):
+ * platform/graphics/cocoa/FontCacheCoreText.cpp:
+ (WebCore::FontDatabase::collectionForFamily):
+ (WebCore::FontDatabase::clear):
+ * platform/ios/wak/WebCoreThreadRun.cpp:
+ * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
+ (WebCore::WebAudioSourceProviderAVFObjC::~WebAudioSourceProviderAVFObjC):
+ (WebCore::WebAudioSourceProviderAVFObjC::prepare):
+ (WebCore::WebAudioSourceProviderAVFObjC::unprepare):
+ * platform/network/cf/LoaderRunLoopCF.cpp:
+ (WebCore::loaderRunLoop):
+ * platform/sql/SQLiteDatabase.cpp:
+ (WebCore::SQLiteDatabase::setIsDatabaseOpeningForbidden):
+ (WebCore::SQLiteDatabase::open):
+ * platform/sql/SQLiteDatabaseTracker.cpp:
+ (WebCore::SQLiteDatabaseTracker::setClient):
+ (WebCore::SQLiteDatabaseTracker::incrementTransactionInProgressCount):
+ (WebCore::SQLiteDatabaseTracker::decrementTransactionInProgressCount):
+ (WebCore::SQLiteDatabaseTracker::hasTransactionInProgress):
+ * platform/text/TextEncodingRegistry.cpp:
+ (WebCore::buildBaseTextCodecMaps):
+ (WebCore::newTextCodec):
+ (WebCore::atomCanonicalTextEncodingName):
+
2020-02-29 Per Arne Vollan <[email protected]>
[Cocoa] Mapping from MIME type to UTI type should be done in the UI process
Modified: trunk/Source/WebCore/Modules/webaudio/AudioBufferSourceNode.cpp (257687 => 257688)
--- trunk/Source/WebCore/Modules/webaudio/AudioBufferSourceNode.cpp 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Source/WebCore/Modules/webaudio/AudioBufferSourceNode.cpp 2020-03-01 05:01:30 UTC (rev 257688)
@@ -416,7 +416,7 @@
AudioContext::AutoLocker contextLocker(context());
// This synchronizes with process().
- std::lock_guard<Lock> lock(m_processMutex);
+ auto locker = holdLock(m_processMutex);
if (buffer) {
// Do any necesssary re-configuration to the buffer's number of channels.
Modified: trunk/Source/WebCore/Modules/webaudio/AudioParamTimeline.cpp (257687 => 257688)
--- trunk/Source/WebCore/Modules/webaudio/AudioParamTimeline.cpp 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Source/WebCore/Modules/webaudio/AudioParamTimeline.cpp 2020-03-01 05:01:30 UTC (rev 257688)
@@ -80,7 +80,7 @@
if (!isValid)
return;
- std::lock_guard<Lock> lock(m_eventsMutex);
+ auto locker = holdLock(m_eventsMutex);
unsigned i = 0;
float insertTime = event.time();
@@ -102,7 +102,7 @@
void AudioParamTimeline::cancelScheduledValues(float startTime)
{
- std::lock_guard<Lock> lock(m_eventsMutex);
+ auto locker = holdLock(m_eventsMutex);
// Remove all events starting at startTime.
for (unsigned i = 0; i < m_events.size(); ++i) {
Modified: trunk/Source/WebCore/Modules/webaudio/ConvolverNode.cpp (257687 => 257688)
--- trunk/Source/WebCore/Modules/webaudio/ConvolverNode.cpp 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Source/WebCore/Modules/webaudio/ConvolverNode.cpp 2020-03-01 05:01:30 UTC (rev 257688)
@@ -94,7 +94,7 @@
void ConvolverNode::reset()
{
- std::lock_guard<Lock> lock(m_processMutex);
+ auto locker = holdLock(m_processMutex);
if (m_reverb)
m_reverb->reset();
}
@@ -150,7 +150,7 @@
{
// Synchronize with process().
- std::lock_guard<Lock> lock(m_processMutex);
+ auto locker = holdLock(m_processMutex);
m_reverb = WTFMove(reverb);
m_buffer = buffer;
}
Modified: trunk/Source/WebCore/Modules/webaudio/MediaElementAudioSourceNode.cpp (257687 => 257688)
--- trunk/Source/WebCore/Modules/webaudio/MediaElementAudioSourceNode.cpp 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Source/WebCore/Modules/webaudio/MediaElementAudioSourceNode.cpp 2020-03-01 05:01:30 UTC (rev 257688)
@@ -85,7 +85,7 @@
m_sourceSampleRate = sourceSampleRate;
// Synchronize with process().
- std::lock_guard<MediaElementAudioSourceNode> lock(*this);
+ auto locker = holdLock(*this);
if (sourceSampleRate != sampleRate()) {
double scaleFactor = sourceSampleRate / sampleRate();
Modified: trunk/Source/WebCore/Modules/webaudio/MediaStreamAudioSourceNode.cpp (257687 => 257688)
--- trunk/Source/WebCore/Modules/webaudio/MediaStreamAudioSourceNode.cpp 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Source/WebCore/Modules/webaudio/MediaStreamAudioSourceNode.cpp 2020-03-01 05:01:30 UTC (rev 257688)
@@ -84,7 +84,7 @@
}
// Synchronize with process().
- std::lock_guard<Lock> lock(m_processMutex);
+ auto locker = holdLock(m_processMutex);
m_sourceNumberOfChannels = numberOfChannels;
m_sourceSampleRate = sourceSampleRate;
Modified: trunk/Source/WebCore/Modules/webaudio/OscillatorNode.cpp (257687 => 257688)
--- trunk/Source/WebCore/Modules/webaudio/OscillatorNode.cpp 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Source/WebCore/Modules/webaudio/OscillatorNode.cpp 2020-03-01 05:01:30 UTC (rev 257688)
@@ -306,7 +306,7 @@
ASSERT(isMainThread());
// This synchronizes with process().
- std::lock_guard<Lock> lock(m_processMutex);
+ auto locker = holdLock(m_processMutex);
m_periodicWave = periodicWave;
m_type = Type::Custom;
}
Modified: trunk/Source/WebCore/Modules/webaudio/PannerNode.cpp (257687 => 257688)
--- trunk/Source/WebCore/Modules/webaudio/PannerNode.cpp 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Source/WebCore/Modules/webaudio/PannerNode.cpp 2020-03-01 05:01:30 UTC (rev 257688)
@@ -182,7 +182,7 @@
{
if (!m_panner.get() || model != m_panningModel) {
// This synchronizes with process().
- std::lock_guard<Lock> lock(m_pannerMutex);
+ auto locker = holdLock(m_pannerMutex);
m_panner = Panner::create(model, sampleRate(), m_hrtfDatabaseLoader.get());
m_panningModel = model;
Modified: trunk/Source/WebCore/Modules/webaudio/WaveShaperProcessor.cpp (257687 => 257688)
--- trunk/Source/WebCore/Modules/webaudio/WaveShaperProcessor.cpp 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Source/WebCore/Modules/webaudio/WaveShaperProcessor.cpp 2020-03-01 05:01:30 UTC (rev 257688)
@@ -52,7 +52,7 @@
void WaveShaperProcessor::setCurve(Float32Array* curve)
{
// This synchronizes with process().
- std::lock_guard<Lock> lock(m_processMutex);
+ auto locker = holdLock(m_processMutex);
m_curve = curve;
}
@@ -60,7 +60,7 @@
void WaveShaperProcessor::setOversample(OverSampleType oversample)
{
// This synchronizes with process().
- std::lock_guard<Lock> lock(m_processMutex);
+ auto locker = holdLock(m_processMutex);
m_oversample = oversample;
Modified: trunk/Source/WebCore/Modules/webdatabase/Database.cpp (257687 => 257688)
--- trunk/Source/WebCore/Modules/webdatabase/Database.cpp 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Source/WebCore/Modules/webdatabase/Database.cpp 2020-03-01 05:01:30 UTC (rev 257688)
@@ -206,7 +206,7 @@
, m_databaseAuthorizer(DatabaseAuthorizer::create(unqualifiedInfoTableName))
{
{
- std::lock_guard<Lock> locker(guidMutex);
+ auto locker = holdLock(guidMutex);
m_guid = guidForOriginAndName(securityOrigin().securityOrigin()->toString(), name);
guidToDatabaseMap().ensure(m_guid, [] {
@@ -353,7 +353,7 @@
String currentVersion;
{
- std::lock_guard<Lock> locker(guidMutex);
+ auto locker = holdLock(guidMutex);
auto entry = guidToVersionMap().find(m_guid);
if (entry != guidToVersionMap().end()) {
@@ -442,7 +442,7 @@
DatabaseTracker::singleton().removeOpenDatabase(*this);
{
- std::lock_guard<Lock> locker(guidMutex);
+ auto locker = holdLock(guidMutex);
auto it = guidToDatabaseMap().find(m_guid);
ASSERT(it != guidToDatabaseMap().end());
@@ -500,7 +500,7 @@
String Database::getCachedVersion() const
{
- std::lock_guard<Lock> locker(guidMutex);
+ auto locker = holdLock(guidMutex);
return guidToVersionMap().get(m_guid).isolatedCopy();
}
@@ -507,7 +507,7 @@
void Database::setCachedVersion(const String& actualVersion)
{
- std::lock_guard<Lock> locker(guidMutex);
+ auto locker = holdLock(guidMutex);
updateGUIDVersionMap(m_guid, actualVersion);
}
Modified: trunk/Source/WebCore/Modules/webdatabase/DatabaseManager.cpp (257687 => 257688)
--- trunk/Source/WebCore/Modules/webdatabase/DatabaseManager.cpp 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Source/WebCore/Modules/webdatabase/DatabaseManager.cpp 2020-03-01 05:01:30 UTC (rev 257688)
@@ -181,13 +181,13 @@
void DatabaseManager::addProposedDatabase(ProposedDatabase& database)
{
- std::lock_guard<Lock> lock { m_proposedDatabasesMutex };
+ auto locker = holdLock(m_proposedDatabasesMutex);
m_proposedDatabases.add(&database);
}
void DatabaseManager::removeProposedDatabase(ProposedDatabase& database)
{
- std::lock_guard<Lock> lock { m_proposedDatabasesMutex };
+ auto locker = holdLock(m_proposedDatabasesMutex);
m_proposedDatabases.remove(&database);
}
@@ -237,7 +237,7 @@
String DatabaseManager::fullPathForDatabase(SecurityOrigin& origin, const String& name, bool createIfDoesNotExist)
{
{
- std::lock_guard<Lock> lock { m_proposedDatabasesMutex };
+ auto locker = holdLock(m_proposedDatabasesMutex);
for (auto* proposedDatabase : m_proposedDatabases) {
if (proposedDatabase->details().name() == name && proposedDatabase->origin().equal(&origin))
return String();
@@ -249,7 +249,7 @@
DatabaseDetails DatabaseManager::detailsForNameAndOrigin(const String& name, SecurityOrigin& origin)
{
{
- std::lock_guard<Lock> lock { m_proposedDatabasesMutex };
+ auto locker = holdLock(m_proposedDatabasesMutex);
for (auto* proposedDatabase : m_proposedDatabases) {
if (proposedDatabase->details().name() == name && proposedDatabase->origin().equal(&origin)) {
ASSERT(&proposedDatabase->details().thread() == &Thread::current() || isMainThread());
Modified: trunk/Source/WebCore/crypto/CryptoAlgorithmRegistry.cpp (257687 => 257688)
--- trunk/Source/WebCore/crypto/CryptoAlgorithmRegistry.cpp 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Source/WebCore/crypto/CryptoAlgorithmRegistry.cpp 2020-03-01 05:01:30 UTC (rev 257688)
@@ -52,7 +52,7 @@
if (name.isEmpty())
return WTF::nullopt;
- std::lock_guard<Lock> lock(registryMutex);
+ auto locker = holdLock(registryMutex);
// FIXME: How is it helpful to call isolatedCopy on the argument to find?
auto identifier = m_identifiers.find(name.isolatedCopy());
@@ -64,7 +64,7 @@
String CryptoAlgorithmRegistry::name(CryptoAlgorithmIdentifier identifier)
{
- std::lock_guard<Lock> lock(registryMutex);
+ auto locker = holdLock(registryMutex);
auto contructor = m_constructors.find(static_cast<unsigned>(identifier));
if (contructor == m_constructors.end())
@@ -75,7 +75,7 @@
RefPtr<CryptoAlgorithm> CryptoAlgorithmRegistry::create(CryptoAlgorithmIdentifier identifier)
{
- std::lock_guard<Lock> lock(registryMutex);
+ auto locker = holdLock(registryMutex);
auto contructor = m_constructors.find(static_cast<unsigned>(identifier));
if (contructor == m_constructors.end())
@@ -86,7 +86,7 @@
void CryptoAlgorithmRegistry::registerAlgorithm(const String& name, CryptoAlgorithmIdentifier identifier, CryptoAlgorithmConstructor constructor)
{
- std::lock_guard<Lock> lock(registryMutex);
+ auto locker = holdLock(registryMutex);
ASSERT(!m_identifiers.contains(name));
ASSERT(!m_constructors.contains(static_cast<unsigned>(identifier)));
Modified: trunk/Source/WebCore/inspector/agents/WebHeapAgent.cpp (257687 => 257688)
--- trunk/Source/WebCore/inspector/agents/WebHeapAgent.cpp 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Source/WebCore/inspector/agents/WebHeapAgent.cpp 2020-03-01 05:01:30 UTC (rev 257688)
@@ -64,7 +64,7 @@
void SendGarbageCollectionEventsTask::addGarbageCollection(GarbageCollectionData&& collection)
{
{
- std::lock_guard<Lock> lock(m_mutex);
+ auto locker = holdLock(m_mutex);
m_collections.append(WTFMove(collection));
}
@@ -75,7 +75,7 @@
void SendGarbageCollectionEventsTask::reset()
{
{
- std::lock_guard<Lock> lock(m_mutex);
+ auto locker = holdLock(m_mutex);
m_collections.clear();
}
@@ -87,7 +87,7 @@
Vector<GarbageCollectionData> collectionsToSend;
{
- std::lock_guard<Lock> lock(m_mutex);
+ auto locker = holdLock(m_mutex);
m_collections.swap(collectionsToSend);
}
Modified: trunk/Source/WebCore/page/scrolling/ScrollingThread.cpp (257687 => 257688)
--- trunk/Source/WebCore/page/scrolling/ScrollingThread.cpp 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Source/WebCore/page/scrolling/ScrollingThread.cpp 2020-03-01 05:01:30 UTC (rev 257688)
@@ -49,7 +49,7 @@
scrollingThread.createThreadIfNeeded();
{
- std::lock_guard<Lock> lock(scrollingThread.m_functionsMutex);
+ auto locker = holdLock(scrollingThread.m_functionsMutex);
scrollingThread.m_functions.append(WTFMove(function));
}
@@ -96,7 +96,7 @@
Vector<Function<void ()>> functions;
{
- std::lock_guard<Lock> lock(m_functionsMutex);
+ auto locker = holdLock(m_functionsMutex);
functions = WTFMove(m_functions);
}
Modified: trunk/Source/WebCore/page/scrolling/generic/ScrollingThreadGeneric.cpp (257687 => 257688)
--- trunk/Source/WebCore/page/scrolling/generic/ScrollingThreadGeneric.cpp 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Source/WebCore/page/scrolling/generic/ScrollingThreadGeneric.cpp 2020-03-01 05:01:30 UTC (rev 257688)
@@ -35,7 +35,7 @@
void ScrollingThread::initializeRunLoop()
{
{
- std::lock_guard<Lock> lock(m_initializeRunLoopMutex);
+ auto locker = holdLock(m_initializeRunLoopMutex);
m_runLoop = &RunLoop::current();
m_initializeRunLoopConditionVariable.notifyAll();
}
Modified: trunk/Source/WebCore/page/scrolling/mac/ScrollingThreadMac.mm (257687 => 257688)
--- trunk/Source/WebCore/page/scrolling/mac/ScrollingThreadMac.mm 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Source/WebCore/page/scrolling/mac/ScrollingThreadMac.mm 2020-03-01 05:01:30 UTC (rev 257688)
@@ -36,7 +36,7 @@
{
// Initialize the run loop.
{
- std::lock_guard<Lock> lock(m_initializeRunLoopMutex);
+ auto locker = holdLock(m_initializeRunLoopMutex);
m_threadRunLoop = CFRunLoopGetCurrent();
Modified: trunk/Source/WebCore/platform/audio/ReverbConvolver.cpp (257687 => 257688)
--- trunk/Source/WebCore/platform/audio/ReverbConvolver.cpp 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Source/WebCore/platform/audio/ReverbConvolver.cpp 2020-03-01 05:01:30 UTC (rev 257688)
@@ -135,7 +135,7 @@
// Wake up thread so it can return
{
- std::lock_guard<Lock> lock(m_backgroundThreadMutex);
+ auto locker = holdLock(m_backgroundThreadMutex);
m_moreInputBuffered = true;
m_backgroundThreadConditionVariable.notifyOne();
}
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm (257687 => 257688)
--- trunk/Source/WebCore/platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm 2020-03-01 05:01:30 UTC (rev 257688)
@@ -88,7 +88,7 @@
{
setClient(nullptr);
if (m_tapStorage) {
- std::lock_guard<Lock> lock(m_tapStorage->mutex);
+ auto locker = holdLock(m_tapStorage->mutex);
m_tapStorage->_this = nullptr;
}
@@ -254,7 +254,7 @@
TapStorage* tapStorage = static_cast<TapStorage*>(MTAudioProcessingTapGetStorage(tap));
{
- std::lock_guard<Lock> lock(tapStorage->mutex);
+ auto locker = holdLock(tapStorage->mutex);
if (tapStorage->_this)
tapStorage->_this->finalize();
}
@@ -266,7 +266,7 @@
ASSERT(tap);
TapStorage* tapStorage = static_cast<TapStorage*>(MTAudioProcessingTapGetStorage(tap));
- std::lock_guard<Lock> lock(tapStorage->mutex);
+ auto locker = holdLock(tapStorage->mutex);
if (tapStorage->_this)
tapStorage->_this->prepare(maxFrames, processingFormat);
@@ -277,7 +277,7 @@
ASSERT(tap);
TapStorage* tapStorage = static_cast<TapStorage*>(MTAudioProcessingTapGetStorage(tap));
- std::lock_guard<Lock> lock(tapStorage->mutex);
+ auto locker = holdLock(tapStorage->mutex);
if (tapStorage->_this)
tapStorage->_this->unprepare();
@@ -288,7 +288,7 @@
ASSERT(tap);
TapStorage* tapStorage = static_cast<TapStorage*>(MTAudioProcessingTapGetStorage(tap));
- std::lock_guard<Lock> lock(tapStorage->mutex);
+ auto locker = holdLock(tapStorage->mutex);
if (tapStorage->_this)
tapStorage->_this->process(tap, numberFrames, flags, bufferListInOut, numberFramesOut, flagsOut);
Modified: trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp (257687 => 257688)
--- trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp 2020-03-01 05:01:30 UTC (rev 257688)
@@ -934,7 +934,7 @@
{
auto folded = FontCascadeDescription::foldedFamilyName(familyName);
{
- std::lock_guard<Lock> locker(m_familyNameToFontDescriptorsLock);
+ auto locker = holdLock(m_familyNameToFontDescriptorsLock);
auto it = m_familyNameToFontDescriptors.find(folded);
if (it != m_familyNameToFontDescriptors.end())
return it->value;
@@ -960,7 +960,7 @@
return InstalledFontFamily();
}();
- std::lock_guard<Lock> locker(m_familyNameToFontDescriptorsLock);
+ auto locker = holdLock(m_familyNameToFontDescriptorsLock);
return m_familyNameToFontDescriptors.add(folded.isolatedCopy(), WTFMove(installedFontFamily)).iterator->value;
}
@@ -984,7 +984,7 @@
void clear()
{
{
- std::lock_guard<Lock> locker(m_familyNameToFontDescriptorsLock);
+ auto locker = holdLock(m_familyNameToFontDescriptorsLock);
m_familyNameToFontDescriptors.clear();
}
m_postScriptNameToFontDescriptors.clear();
Modified: trunk/Source/WebCore/platform/ios/wak/WebCoreThreadRun.cpp (257687 => 257688)
--- trunk/Source/WebCore/platform/ios/wak/WebCoreThreadRun.cpp 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Source/WebCore/platform/ios/wak/WebCoreThreadRun.cpp 2020-03-01 05:01:30 UTC (rev 257688)
@@ -52,7 +52,7 @@
void setCompleted()
{
- std::lock_guard<Lock> lock(m_stateMutex);
+ auto locker = holdLock(m_stateMutex);
ASSERT(!m_completed);
m_completed = true;
@@ -124,7 +124,7 @@
WebThreadRunQueue queueCopy;
{
- std::lock_guard<Lock> lock(runQueueMutex);
+ auto locker = holdLock(runQueueMutex);
queueCopy = *runQueue;
runQueue->clear();
}
@@ -148,7 +148,7 @@
state = new WebThreadBlockState;
{
- std::lock_guard<Lock> lock(runQueueMutex);
+ auto locker = holdLock(runQueueMutex);
runQueue->append(WebThreadBlock(block, state));
}
Modified: trunk/Source/WebCore/platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm (257687 => 257688)
--- trunk/Source/WebCore/platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Source/WebCore/platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm 2020-03-01 05:01:30 UTC (rev 257688)
@@ -59,7 +59,7 @@
WebAudioSourceProviderAVFObjC::~WebAudioSourceProviderAVFObjC()
{
- std::lock_guard<Lock> lock(m_mutex);
+ auto locker = holdLock(m_mutex);
if (m_connected && m_captureSource)
m_captureSource->removeObserver(*this);
@@ -122,7 +122,7 @@
void WebAudioSourceProviderAVFObjC::prepare(const AudioStreamBasicDescription& format)
{
- std::lock_guard<Lock> lock(m_mutex);
+ auto locker = holdLock(m_mutex);
LOG(Media, "WebAudioSourceProviderAVFObjC::prepare(%p)", this);
@@ -153,7 +153,7 @@
void WebAudioSourceProviderAVFObjC::unprepare()
{
- std::lock_guard<Lock> lock(m_mutex);
+ auto locker = holdLock(m_mutex);
m_inputDescription = WTF::nullopt;
m_outputDescription = WTF::nullopt;
Modified: trunk/Source/WebCore/platform/network/cf/LoaderRunLoopCF.cpp (257687 => 257688)
--- trunk/Source/WebCore/platform/network/cf/LoaderRunLoopCF.cpp 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Source/WebCore/platform/network/cf/LoaderRunLoopCF.cpp 2020-03-01 05:01:30 UTC (rev 257688)
@@ -57,7 +57,7 @@
if (!loaderRunLoopObject) {
Thread::create("WebCore: CFNetwork Loader", [] {
{
- std::lock_guard<Lock> lock(loaderRunLoopMutex);
+ auto locker = holdLock(loaderRunLoopMutex);
loaderRunLoopObject = CFRunLoopGetCurrent();
Modified: trunk/Source/WebCore/platform/sql/SQLiteDatabase.cpp (257687 => 257688)
--- trunk/Source/WebCore/platform/sql/SQLiteDatabase.cpp 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Source/WebCore/platform/sql/SQLiteDatabase.cpp 2020-03-01 05:01:30 UTC (rev 257688)
@@ -76,7 +76,7 @@
void SQLiteDatabase::setIsDatabaseOpeningForbidden(bool isForbidden)
{
- std::lock_guard<Lock> lock(isDatabaseOpeningForbiddenMutex);
+ auto locker = holdLock(isDatabaseOpeningForbiddenMutex);
isDatabaseOpeningForbidden = isForbidden;
}
@@ -94,7 +94,7 @@
close();
{
- std::lock_guard<Lock> lock(isDatabaseOpeningForbiddenMutex);
+ auto locker = holdLock(isDatabaseOpeningForbiddenMutex);
if (isDatabaseOpeningForbidden) {
m_openErrorMessage = "opening database is forbidden";
return false;
Modified: trunk/Source/WebCore/platform/sql/SQLiteDatabaseTracker.cpp (257687 => 257688)
--- trunk/Source/WebCore/platform/sql/SQLiteDatabaseTracker.cpp 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Source/WebCore/platform/sql/SQLiteDatabaseTracker.cpp 2020-03-01 05:01:30 UTC (rev 257688)
@@ -40,13 +40,13 @@
void setClient(SQLiteDatabaseTrackerClient* client)
{
- std::lock_guard<Lock> lock(transactionInProgressMutex);
+ auto locker = holdLock(transactionInProgressMutex);
s_staticSQLiteDatabaseTrackerClient = client;
}
void incrementTransactionInProgressCount()
{
- std::lock_guard<Lock> lock(transactionInProgressMutex);
+ auto locker = holdLock(transactionInProgressMutex);
if (!s_staticSQLiteDatabaseTrackerClient)
return;
@@ -57,7 +57,7 @@
void decrementTransactionInProgressCount()
{
- std::lock_guard<Lock> lock(transactionInProgressMutex);
+ auto locker = holdLock(transactionInProgressMutex);
if (!s_staticSQLiteDatabaseTrackerClient)
return;
@@ -70,7 +70,7 @@
bool hasTransactionInProgress()
{
- std::lock_guard<Lock> lock(transactionInProgressMutex);
+ auto locker = holdLock(transactionInProgressMutex);
return !s_staticSQLiteDatabaseTrackerClient || s_transactionInProgressCounter > 0;
}
Modified: trunk/Source/WebCore/platform/text/TextEncodingRegistry.cpp (257687 => 257688)
--- trunk/Source/WebCore/platform/text/TextEncodingRegistry.cpp 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Source/WebCore/platform/text/TextEncodingRegistry.cpp 2020-03-01 05:01:30 UTC (rev 257688)
@@ -155,7 +155,7 @@
}
}
-static void buildBaseTextCodecMaps(const std::lock_guard<Lock>&)
+static void buildBaseTextCodecMaps(const AbstractLocker&)
{
ASSERT(!textCodecMap);
ASSERT(!textEncodingNameMap);
@@ -243,7 +243,7 @@
std::unique_ptr<TextCodec> newTextCodec(const TextEncoding& encoding)
{
- std::lock_guard<Lock> lock(encodingRegistryMutex);
+ auto locker = holdLock(encodingRegistryMutex);
ASSERT(textCodecMap);
auto result = textCodecMap->find(encoding.name());
@@ -256,10 +256,10 @@
if (!name || !name[0])
return nullptr;
- std::lock_guard<Lock> lock(encodingRegistryMutex);
+ auto locker = holdLock(encodingRegistryMutex);
if (!textEncodingNameMap)
- buildBaseTextCodecMaps(lock);
+ buildBaseTextCodecMaps(locker);
if (const char* atomName = textEncodingNameMap->get(name))
return atomName;
Modified: trunk/Source/WebKit/ChangeLog (257687 => 257688)
--- trunk/Source/WebKit/ChangeLog 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Source/WebKit/ChangeLog 2020-03-01 05:01:30 UTC (rev 257688)
@@ -1,3 +1,39 @@
+2020-02-29 Yusuke Suzuki <[email protected]>
+
+ Remove std::lock_guard
+ https://bugs.webkit.org/show_bug.cgi?id=206451
+
+ Reviewed by Anders Carlsson.
+
+ * NetworkProcess/cache/NetworkCacheStorage.cpp:
+ (WebKit::NetworkCache::Storage::traverse):
+ * Platform/IPC/Connection.cpp:
+ (IPC::Connection::SyncMessageState::processIncomingMessage):
+ (IPC::Connection::SyncMessageState::dispatchMessages):
+ (IPC::Connection::SyncMessageState::dispatchMessagesAndResetDidScheduleDispatchMessagesForConnection):
+ (IPC::Connection::addWorkQueueMessageReceiver):
+ (IPC::Connection::removeWorkQueueMessageReceiver):
+ (IPC::Connection::addThreadMessageReceiver):
+ (IPC::Connection::removeThreadMessageReceiver):
+ (IPC::Connection::sendMessage):
+ (IPC::Connection::waitForMessage):
+ (IPC::Connection::processIncomingMessage):
+ (IPC::Connection::installIncomingSyncMessageCallback):
+ (IPC::Connection::uninstallIncomingSyncMessageCallback):
+ (IPC::Connection::hasIncomingSyncMessage):
+ (IPC::Connection::connectionDidClose):
+ (IPC::Connection::sendOutgoingMessages):
+ (IPC::Connection::enqueueIncomingMessage):
+ (IPC::Connection::dispatchMessageToWorkQueueReceiver):
+ (IPC::Connection::dispatchMessageToThreadReceiver):
+ (IPC::Connection::dispatchOneIncomingMessage):
+ (IPC::Connection::dispatchIncomingMessages):
+ * Shared/BlockingResponseMap.h:
+ (BlockingResponseMap::didReceiveResponse):
+ * UIProcess/mac/WKPrintingView.mm:
+ (-[WKPrintingView _preparePDFDataForPrintingOnSecondaryThread]):
+ (prepareDataForPrintingOnSecondaryThread):
+
2020-02-29 Per Arne Vollan <[email protected]>
[Cocoa] Mapping from MIME type to UTI type should be done in the UI process
Modified: trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheStorage.cpp (257687 => 257688)
--- trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheStorage.cpp 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheStorage.cpp 2020-03-01 05:01:30 UTC (rev 257688)
@@ -962,7 +962,7 @@
traverseOperation.handler(&record, info);
}
- std::lock_guard<Lock> lock(traverseOperation.activeMutex);
+ auto locker = holdLock(traverseOperation.activeMutex);
--traverseOperation.activeCount;
traverseOperation.activeCondition.notifyOne();
});
Modified: trunk/Source/WebKit/Platform/IPC/Connection.cpp (257687 => 257688)
--- trunk/Source/WebKit/Platform/IPC/Connection.cpp 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Source/WebKit/Platform/IPC/Connection.cpp 2020-03-01 05:01:30 UTC (rev 257688)
@@ -149,7 +149,7 @@
bool shouldDispatch;
{
- std::lock_guard<Lock> lock(m_mutex);
+ auto locker = holdLock(m_mutex);
shouldDispatch = m_didScheduleDispatchMessagesWorkSet.add(&connection).isNewEntry;
m_messagesToDispatchWhileWaitingForSyncReply.append(ConnectionAndIncomingMessage { connection, WTFMove(message) });
}
@@ -171,7 +171,7 @@
Vector<ConnectionAndIncomingMessage> messagesToDispatchWhileWaitingForSyncReply;
{
- std::lock_guard<Lock> lock(m_mutex);
+ auto locker = holdLock(m_mutex);
m_messagesToDispatchWhileWaitingForSyncReply.swap(messagesToDispatchWhileWaitingForSyncReply);
}
@@ -185,7 +185,7 @@
Vector<ConnectionAndIncomingMessage> messagesToDispatchWhileWaitingForSyncReply;
{
- std::lock_guard<Lock> lock(m_mutex);
+ auto locker = holdLock(m_mutex);
ASSERT(m_didScheduleDispatchMessagesWorkSet.contains(&connection));
m_didScheduleDispatchMessagesWorkSet.remove(&connection);
m_messagesToDispatchWhileWaitingForSyncReply.swap(messagesToDispatchWhileWaitingForSyncReply);
@@ -200,7 +200,7 @@
}
if (!messagesToPutBack.isEmpty()) {
- std::lock_guard<Lock> lock(m_mutex);
+ auto locker = holdLock(m_mutex);
messagesToPutBack.appendVector(WTFMove(m_messagesToDispatchWhileWaitingForSyncReply));
m_messagesToDispatchWhileWaitingForSyncReply = WTFMove(messagesToPutBack);
}
@@ -319,7 +319,7 @@
{
ASSERT(RunLoop::isMain());
- std::lock_guard<Lock> lock(m_workQueueMessageReceiversMutex);
+ auto locker = holdLock(m_workQueueMessageReceiversMutex);
ASSERT(!m_workQueueMessageReceivers.contains(messageReceiverName));
m_workQueueMessageReceivers.add(messageReceiverName, std::make_pair(&workQueue, workQueueMessageReceiver));
@@ -329,7 +329,7 @@
{
ASSERT(RunLoop::isMain());
- std::lock_guard<Lock> lock(m_workQueueMessageReceiversMutex);
+ auto locker = holdLock(m_workQueueMessageReceiversMutex);
ASSERT(m_workQueueMessageReceivers.contains(messageReceiverName));
m_workQueueMessageReceivers.remove(messageReceiverName);
}
@@ -365,7 +365,7 @@
{
ASSERT(RunLoop::isMain());
- std::lock_guard<Lock> lock(m_threadMessageReceiversLock);
+ auto locker = holdLock(m_threadMessageReceiversLock);
ASSERT(!m_threadMessageReceivers.contains(messageReceiverName));
m_threadMessageReceivers.add(messageReceiverName, threadMessageReceiver);
@@ -375,7 +375,7 @@
{
ASSERT(RunLoop::isMain());
- std::lock_guard<Lock> lock(m_threadMessageReceiversLock);
+ auto locker = holdLock(m_threadMessageReceiversLock);
ASSERT(m_threadMessageReceivers.contains(messageReceiverName));
m_threadMessageReceivers.remove(messageReceiverName);
@@ -469,7 +469,7 @@
encoder->setShouldDispatchMessageWhenWaitingForSyncReply(ShouldDispatchWhenWaitingForSyncReply::YesDuringUnboundedIPC);
{
- std::lock_guard<Lock> lock(m_outgoingMessagesMutex);
+ auto locker = holdLock(m_outgoingMessagesMutex);
m_outgoingMessages.append(WTFMove(encoder));
}
@@ -501,7 +501,7 @@
// First, check if this message is already in the incoming messages queue.
{
- std::lock_guard<Lock> lock(m_incomingMessagesMutex);
+ auto locker = holdLock(m_incomingMessagesMutex);
for (auto it = m_incomingMessages.begin(), end = m_incomingMessages.end(); it != end; ++it) {
std::unique_ptr<Decoder>& message = *it;
@@ -521,7 +521,7 @@
// Don't even start waiting if we have InterruptWaitingIfSyncMessageArrives and there's a sync message already in the queue.
if (hasIncomingSynchronousMessage && waitForOptions.contains(WaitForOption::InterruptWaitingIfSyncMessageArrives)) {
#if ASSERT_ENABLED
- std::lock_guard<Lock> lock(m_waitForMessageMutex);
+ auto locker = holdLock(m_waitForMessageMutex);
// We don't support having multiple clients waiting for messages.
ASSERT(!m_waitingForMessage);
#endif
@@ -531,7 +531,7 @@
WaitForMessageState waitingForMessage(messageReceiverName, messageName, destinationID, waitForOptions);
{
- std::lock_guard<Lock> lock(m_waitForMessageMutex);
+ auto locker = holdLock(m_waitForMessageMutex);
// We don't support having multiple clients waiting for messages.
ASSERT(!m_waitingForMessage);
@@ -746,7 +746,7 @@
#endif
if (message->isSyncMessage()) {
- std::lock_guard<Lock> lock(m_incomingSyncMessageCallbackMutex);
+ auto locker = holdLock(m_incomingSyncMessageCallbackMutex);
for (auto& callback : m_incomingSyncMessageCallbacks.values())
m_incomingSyncMessageCallbackQueue->dispatch(WTFMove(callback));
@@ -756,7 +756,7 @@
// Check if we're waiting for this message, or if we need to interrupt waiting due to an incoming sync message.
{
- std::lock_guard<Lock> lock(m_waitForMessageMutex);
+ auto locker = holdLock(m_waitForMessageMutex);
if (m_waitingForMessage && !m_waitingForMessage->decoder) {
if (m_waitingForMessage->messageReceiverName == message->messageReceiverName() && m_waitingForMessage->messageName == message->messageName() && m_waitingForMessage->destinationID == message->destinationID()) {
@@ -786,7 +786,7 @@
uint64_t Connection::installIncomingSyncMessageCallback(WTF::Function<void ()>&& callback)
{
- std::lock_guard<Lock> lock(m_incomingSyncMessageCallbackMutex);
+ auto locker = holdLock(m_incomingSyncMessageCallbackMutex);
m_nextIncomingSyncMessageCallbackID++;
@@ -800,13 +800,13 @@
void Connection::uninstallIncomingSyncMessageCallback(uint64_t callbackID)
{
- std::lock_guard<Lock> lock(m_incomingSyncMessageCallbackMutex);
+ auto locker = holdLock(m_incomingSyncMessageCallbackMutex);
m_incomingSyncMessageCallbacks.remove(callbackID);
}
bool Connection::hasIncomingSyncMessage()
{
- std::lock_guard<Lock> lock(m_incomingMessagesMutex);
+ auto locker = holdLock(m_incomingMessagesMutex);
for (auto& message : m_incomingMessages) {
if (message->isSyncMessage())
@@ -847,7 +847,7 @@
}
{
- std::lock_guard<Lock> lock(m_waitForMessageMutex);
+ auto locker = holdLock(m_waitForMessageMutex);
ASSERT(m_shouldWaitForMessages);
m_shouldWaitForMessages = false;
@@ -890,7 +890,7 @@
std::unique_ptr<Encoder> message;
{
- std::lock_guard<Lock> lock(m_outgoingMessagesMutex);
+ auto locker = holdLock(m_outgoingMessagesMutex);
if (m_outgoingMessages.isEmpty())
break;
message = m_outgoingMessages.takeFirst();
@@ -957,7 +957,7 @@
void Connection::enqueueIncomingMessage(std::unique_ptr<Decoder> incomingMessage)
{
{
- std::lock_guard<Lock> lock(m_incomingMessagesMutex);
+ auto locker = holdLock(m_incomingMessagesMutex);
#if PLATFORM(COCOA)
if (m_wasKilled)
@@ -1010,7 +1010,7 @@
bool Connection::dispatchMessageToWorkQueueReceiver(std::unique_ptr<Decoder>& message)
{
- std::lock_guard<Lock> lock(m_workQueueMessageReceiversMutex);
+ auto locker = holdLock(m_workQueueMessageReceiversMutex);
auto it = m_workQueueMessageReceivers.find(message->messageReceiverName());
if (it != m_workQueueMessageReceivers.end()) {
it->value.first->dispatch([protectedThis = makeRef(*this), workQueueMessageReceiver = it->value.second, decoder = WTFMove(message)]() mutable {
@@ -1025,7 +1025,7 @@
{
RefPtr<ThreadMessageReceiver> protectedThreadMessageReceiver;
{
- std::lock_guard<Lock> lock(m_threadMessageReceiversLock);
+ auto locker = holdLock(m_threadMessageReceiversLock);
protectedThreadMessageReceiver = m_threadMessageReceivers.get(message->messageReceiverName());
}
@@ -1136,7 +1136,7 @@
{
std::unique_ptr<Decoder> message;
{
- std::lock_guard<Lock> lock(m_incomingMessagesMutex);
+ auto locker = holdLock(m_incomingMessagesMutex);
if (m_incomingMessages.isEmpty())
return;
@@ -1154,7 +1154,7 @@
size_t messagesToProcess = 0;
{
- std::lock_guard<Lock> lock(m_incomingMessagesMutex);
+ auto locker = holdLock(m_incomingMessagesMutex);
if (m_incomingMessages.isEmpty())
return;
@@ -1182,7 +1182,7 @@
for (size_t i = 1; i < messagesToProcess; ++i) {
{
- std::lock_guard<Lock> lock(m_incomingMessagesMutex);
+ auto locker = holdLock(m_incomingMessagesMutex);
if (m_incomingMessages.isEmpty())
return;
Modified: trunk/Source/WebKit/Shared/BlockingResponseMap.h (257687 => 257688)
--- trunk/Source/WebKit/Shared/BlockingResponseMap.h 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Source/WebKit/Shared/BlockingResponseMap.h 2020-03-01 05:01:30 UTC (rev 257688)
@@ -57,7 +57,7 @@
void didReceiveResponse(uint64_t requestID, std::unique_ptr<T> response)
{
- std::lock_guard<Lock> lock(m_mutex);
+ auto locker = holdLock(m_mutex);
ASSERT(!m_responses.contains(requestID));
m_responses.set(requestID, WTFMove(response));
Modified: trunk/Source/WebKit/UIProcess/mac/WKPrintingView.mm (257687 => 257688)
--- trunk/Source/WebKit/UIProcess/mac/WKPrintingView.mm 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Source/WebKit/UIProcess/mac/WKPrintingView.mm 2020-03-01 05:01:30 UTC (rev 257688)
@@ -250,7 +250,7 @@
return;
}
- std::lock_guard<Lock> lock(_printingCallbackMutex);
+ auto locker = holdLock(_printingCallbackMutex);
ASSERT([self _hasPageRects]);
ASSERT(_printedPagesData.isEmpty());
@@ -366,7 +366,7 @@
{
ASSERT(RunLoop::isMain());
- std::lock_guard<Lock> lock(view->_printingCallbackMutex);
+ auto locker = holdLock(view->_printingCallbackMutex);
// We may have received page rects while a message to call this function traveled from secondary thread to main one.
if ([view _hasPageRects]) {
Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (257687 => 257688)
--- trunk/Source/WebKitLegacy/mac/ChangeLog 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog 2020-03-01 05:01:30 UTC (rev 257688)
@@ -1,3 +1,15 @@
+2020-02-29 Yusuke Suzuki <[email protected]>
+
+ Remove std::lock_guard
+ https://bugs.webkit.org/show_bug.cgi?id=206451
+
+ Reviewed by Anders Carlsson.
+
+ * DOM/DOMInternal.mm:
+ (getDOMWrapper):
+ (addDOMWrapper):
+ (removeDOMWrapper):
+
2020-02-28 Jer Noble <[email protected]>
[GPUP] Implement Modern EME API in the GPU Process
Modified: trunk/Source/WebKitLegacy/mac/DOM/DOMInternal.mm (257687 => 257688)
--- trunk/Source/WebKitLegacy/mac/DOM/DOMInternal.mm 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Source/WebKitLegacy/mac/DOM/DOMInternal.mm 2020-03-01 05:01:30 UTC (rev 257688)
@@ -56,7 +56,7 @@
NSObject* getDOMWrapper(DOMObjectInternal* impl)
{
#ifdef NEEDS_WRAPPER_CACHE_LOCK
- std::lock_guard<Lock> lock(wrapperCacheLock);
+ auto locker = holdLock(wrapperCacheLock);
#endif
return wrapperCache().get(impl);
}
@@ -64,7 +64,7 @@
void addDOMWrapper(NSObject* wrapper, DOMObjectInternal* impl)
{
#ifdef NEEDS_WRAPPER_CACHE_LOCK
- std::lock_guard<Lock> lock(wrapperCacheLock);
+ auto locker = holdLock(wrapperCacheLock);
#endif
wrapperCache().set(impl, wrapper);
}
@@ -72,7 +72,7 @@
void removeDOMWrapper(DOMObjectInternal* impl)
{
#ifdef NEEDS_WRAPPER_CACHE_LOCK
- std::lock_guard<Lock> lock(wrapperCacheLock);
+ auto locker = holdLock(wrapperCacheLock);
#endif
wrapperCache().remove(impl);
}
Modified: trunk/Source/bmalloc/ChangeLog (257687 => 257688)
--- trunk/Source/bmalloc/ChangeLog 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Source/bmalloc/ChangeLog 2020-03-01 05:01:30 UTC (rev 257688)
@@ -1,3 +1,12 @@
+2020-02-29 Yusuke Suzuki <[email protected]>
+
+ Remove std::lock_guard
+ https://bugs.webkit.org/show_bug.cgi?id=206451
+
+ Reviewed by Anders Carlsson.
+
+ * bmalloc/Mutex.h:
+
2020-02-28 Saam Barati <[email protected]>
Clean up code with how we choose Gigacage sizes and whether or not to use Wasm fast memory
Modified: trunk/Source/bmalloc/bmalloc/Mutex.h (257687 => 257688)
--- trunk/Source/bmalloc/bmalloc/Mutex.h 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Source/bmalloc/bmalloc/Mutex.h 2020-03-01 05:01:30 UTC (rev 257688)
@@ -38,7 +38,7 @@
class Mutex;
using UniqueLockHolder = std::unique_lock<Mutex>;
-using LockHolder = std::lock_guard<Mutex>;
+using LockHolder = std::scoped_lock<Mutex>;
class Mutex {
public:
Modified: trunk/Tools/ChangeLog (257687 => 257688)
--- trunk/Tools/ChangeLog 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Tools/ChangeLog 2020-03-01 05:01:30 UTC (rev 257688)
@@ -1,3 +1,29 @@
+2020-02-29 Yusuke Suzuki <[email protected]>
+
+ Remove std::lock_guard
+ https://bugs.webkit.org/show_bug.cgi?id=206451
+
+ Reviewed by Anders Carlsson.
+
+ Add std::lock_guard lint rule to prevent from using it.
+
+ * Scripts/webkitpy/style/checkers/cpp.py:
+ (check_lock_guard):
+ (check_style):
+ (CppChecker):
+ * Scripts/webkitpy/style/checkers/cpp_unittest.py:
+ (WebKitStyleTest.test_lock_guard):
+ * TestWebKitAPI/Tests/WTF/Condition.cpp:
+ * TestWebKitAPI/Tests/WTF/ParkingLot.cpp:
+ * TestWebKitAPI/Tests/WTF/bmalloc/IsoHeap.cpp:
+ (assertHasObjects):
+ (assertHasOnlyObjects):
+ * WebKitTestRunner/InjectedBundle/AccessibilityController.cpp:
+ (WTR::AXThread::dispatch):
+ (WTR::AXThread::dispatchFunctionsFromAXThread):
+ * WebKitTestRunner/InjectedBundle/mac/AccessibilityControllerMac.mm:
+ (WTR::AXThread::initializeRunLoop):
+
2020-02-29 Per Arne Vollan <[email protected]>
[Cocoa] Mapping from MIME type to UTI type should be done in the UI process
Modified: trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py (257687 => 257688)
--- trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py 2020-03-01 05:01:30 UTC (rev 257688)
@@ -2505,6 +2505,26 @@
"Use 'WTF::makeUnique<{typename}>' instead of 'std::make_unique<{typename}>'.".format(typename=typename))
+def check_lock_guard(clean_lines, line_number, file_state, error):
+ """Looks for use of 'std::lock_guard<>' which should be replaced with 'WTF::Locker'.
+
+ Args:
+ clean_lines: A CleansedLines instance containing the file.
+ line_number: The number of the line to check.
+ file_state: A _FileState instance which maintains information about
+ the state of things in the file.
+ error: The function to call with any errors found.
+ """
+
+ line = clean_lines.elided[line_number] # Get rid of comments and strings.
+
+ using_std_lock_guard_search = search(r'\bstd::lock_guard\s*<([^(]+)', line)
+ if not using_std_lock_guard_search:
+ return
+
+ error(line_number, 'runtime/lock_guard', 4, "Use 'auto locker = holdLock(mutex)' instead of 'std::lock_guard<>'.")
+
+
def check_ctype_functions(clean_lines, line_number, file_state, error):
"""Looks for use of the standard functions in ctype.h and suggest they be replaced
by use of equivilent ones in <wtf/ASCIICType.h>?.
@@ -3065,6 +3085,7 @@
check_wtf_move(clean_lines, line_number, file_state, error)
check_wtf_optional(clean_lines, line_number, file_state, error)
check_wtf_make_unique(clean_lines, line_number, file_state, error)
+ check_lock_guard(clean_lines, line_number, file_state, error)
check_ctype_functions(clean_lines, line_number, file_state, error)
check_switch_indentation(clean_lines, line_number, error)
check_braces(clean_lines, line_number, file_state, error)
@@ -4226,6 +4247,7 @@
'runtime/int',
'runtime/invalid_increment',
'runtime/leaky_pattern',
+ 'runtime/lock_guard',
'runtime/max_min_macros',
'runtime/memset',
'runtime/printf',
Modified: trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py (257687 => 257688)
--- trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py 2020-03-01 05:01:30 UTC (rev 257688)
@@ -5373,6 +5373,24 @@
" [runtime/wtf_optional] [4]",
'foo.cpp')
+ def test_lock_guard(self):
+ self.assert_lint(
+ 'auto locker = holdLock(mutex);',
+ '',
+ 'foo.cpp')
+
+ self.assert_lint(
+ 'std::lock_guard<Lock> locker(mutex);',
+ "Use 'auto locker = holdLock(mutex)' instead of 'std::lock_guard<>'."
+ " [runtime/lock_guard] [4]",
+ 'foo.cpp')
+
+ self.assert_lint(
+ 'std::lock_guard<Lock> locker(mutex);',
+ "Use 'auto locker = holdLock(mutex)' instead of 'std::lock_guard<>'."
+ " [runtime/lock_guard] [4]",
+ 'foo.mm')
+
def test_ctype_fucntion(self):
self.assert_lint(
'int i = isascii(8);',
Modified: trunk/Tools/TestWebKitAPI/Tests/WTF/Condition.cpp (257687 => 257688)
--- trunk/Tools/TestWebKitAPI/Tests/WTF/Condition.cpp 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Tools/TestWebKitAPI/Tests/WTF/Condition.cpp 2020-03-01 05:01:30 UTC (rev 257688)
@@ -118,7 +118,7 @@
notify(notifyStyle, fullCondition, shouldNotify);
{
- std::lock_guard<Lock> locker(receivedLock);
+ auto locker = holdLock(receivedLock);
received.append(result);
}
}
@@ -155,7 +155,7 @@
thread->waitForCompletion();
{
- std::lock_guard<Lock> locker(lock);
+ auto locker = holdLock(lock);
shouldContinue = false;
}
emptyCondition.notifyAll();
Modified: trunk/Tools/TestWebKitAPI/Tests/WTF/ParkingLot.cpp (257687 => 257688)
--- trunk/Tools/TestWebKitAPI/Tests/WTF/ParkingLot.cpp 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Tools/TestWebKitAPI/Tests/WTF/ParkingLot.cpp 2020-03-01 05:01:30 UTC (rev 257688)
@@ -51,7 +51,7 @@
[&] () {
down();
- std::lock_guard<std::mutex> locker(lock);
+ std::scoped_lock<std::mutex> locker(lock);
awake.add(Thread::current());
lastAwoken = &Thread::current();
condition.notify_one();
Modified: trunk/Tools/TestWebKitAPI/Tests/WTF/bmalloc/IsoHeap.cpp (257687 => 257688)
--- trunk/Tools/TestWebKitAPI/Tests/WTF/bmalloc/IsoHeap.cpp 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Tools/TestWebKitAPI/Tests/WTF/bmalloc/IsoHeap.cpp 2020-03-01 05:01:30 UTC (rev 257688)
@@ -78,7 +78,7 @@
return;
}
auto& impl = heap.impl();
- std::lock_guard<bmalloc::Mutex> locker(impl.lock);
+ std::scoped_lock<bmalloc::Mutex> locker(impl.lock);
impl.forEachLiveObject(
locker,
[&] (void* object) {
@@ -95,7 +95,7 @@
return;
}
auto& impl = heap.impl();
- std::lock_guard<bmalloc::Mutex> locker(impl.lock);
+ std::scoped_lock<bmalloc::Mutex> locker(impl.lock);
impl.forEachLiveObject(
locker,
[&] (void* object) {
Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityController.cpp (257687 => 257688)
--- trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityController.cpp 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityController.cpp 2020-03-01 05:01:30 UTC (rev 257688)
@@ -137,7 +137,7 @@
axThread.createThreadIfNeeded();
{
- std::lock_guard<Lock> lock(axThread.m_functionsMutex);
+ auto locker = holdLock(axThread.m_functionsMutex);
axThread.m_functions.append(WTFMove(function));
}
@@ -185,7 +185,7 @@
Vector<Function<void()>> functions;
{
- std::lock_guard<Lock> lock(m_functionsMutex);
+ auto locker = holdLock(m_functionsMutex);
functions = WTFMove(m_functions);
}
Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityControllerMac.mm (257687 => 257688)
--- trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityControllerMac.mm 2020-03-01 03:32:16 UTC (rev 257687)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityControllerMac.mm 2020-03-01 05:01:30 UTC (rev 257688)
@@ -129,7 +129,7 @@
{
// Initialize the run loop.
{
- std::lock_guard<Lock> lock(m_initializeRunLoopMutex);
+ auto locker = holdLock(m_initializeRunLoopMutex);
m_threadRunLoop = CFRunLoopGetCurrent();