Diff
Modified: trunk/Source/WTF/ChangeLog (266156 => 266157)
--- trunk/Source/WTF/ChangeLog 2020-08-26 02:22:44 UTC (rev 266156)
+++ trunk/Source/WTF/ChangeLog 2020-08-26 02:25:04 UTC (rev 266157)
@@ -1,3 +1,16 @@
+2020-08-25 Ryosuke Niwa <[email protected]>
+
+ HashMap<Ref<T>>::take should return RefPtr<T>
+ https://bugs.webkit.org/show_bug.cgi?id=215830
+
+ Reviewed by Darin Adler.
+
+ Updated the hash traits for Ref<T> to make HashMap<Ref<T>> and HashSet<Ref<T>>
+ return RefPtr<T> instad of Optional<Ref<T>>.
+
+ * wtf/HashTraits.h:
+ (WTF::RefHashTraits::take):
+
2020-08-25 Per Arne Vollan <[email protected]>
[Win] Assert failure under RunLoop::RunLoop
Modified: trunk/Source/WTF/wtf/HashTraits.h (266156 => 266157)
--- trunk/Source/WTF/wtf/HashTraits.h 2020-08-26 02:22:44 UTC (rev 266156)
+++ trunk/Source/WTF/wtf/HashTraits.h 2020-08-26 02:25:04 UTC (rev 266157)
@@ -208,12 +208,12 @@
static constexpr bool hasIsEmptyValueFunction = true;
static bool isEmptyValue(const Ref<P>& value) { return value.isHashTableEmptyValue(); }
- typedef P* PeekType;
+ using PeekType = P*;
static PeekType peek(const Ref<P>& value) { return const_cast<PeekType>(value.ptrAllowingHashTableEmptyValue()); }
static PeekType peek(P* value) { return value; }
- typedef Optional<Ref<P>> TakeType;
- static TakeType take(Ref<P>&& value) { return isEmptyValue(value) ? WTF::nullopt : Optional<Ref<P>>(WTFMove(value)); }
+ using TakeType = RefPtr<P>;
+ static TakeType take(Ref<P>&& value) { return isEmptyValue(value) ? nullptr : RefPtr<P>(WTFMove(value)); }
};
template<typename P> struct HashTraits<Ref<P>> : RefHashTraits<P> { };
Modified: trunk/Source/WebCore/ChangeLog (266156 => 266157)
--- trunk/Source/WebCore/ChangeLog 2020-08-26 02:22:44 UTC (rev 266156)
+++ trunk/Source/WebCore/ChangeLog 2020-08-26 02:25:04 UTC (rev 266157)
@@ -1,3 +1,31 @@
+2020-08-25 Ryosuke Niwa <[email protected]>
+
+ HashMap<Ref<T>>::take should return RefPtr<T>
+ https://bugs.webkit.org/show_bug.cgi?id=215830
+
+ Reviewed by Darin Adler.
+
+ * Modules/indexeddb/client/IDBConnectionProxy.cpp:
+ (WebCore::IDBClient::IDBConnectionProxy::didGetAllDatabaseNamesAndVersions):
+ * accessibility/isolatedtree/AXIsolatedTree.cpp:
+ (WebCore::AXIsolatedTree::removeTreeForPageID):
+ * crypto/SubtleCrypto.cpp:
+ (WebCore::getPromise):
+ * dom/CustomElementRegistry.cpp:
+ (WebCore::CustomElementRegistry::addElementDefinition):
+ * dom/ScriptRunner.cpp:
+ (WebCore::ScriptRunner::notifyFinished):
+ * inspector/agents/InspectorCSSAgent.cpp:
+ (WebCore::InspectorCSSAgent::didRemoveDOMNode):
+ * page/PageOverlayController.cpp:
+ (WebCore::PageOverlayController::uninstallPageOverlay):
+ * workers/service/ServiceWorkerClients.cpp:
+ (WebCore::ServiceWorkerClients::claim):
+ * workers/service/context/ServiceWorkerThreadProxy.cpp:
+ (WebCore::ServiceWorkerThreadProxy::cancelFetch):
+ * workers/service/server/SWServer.cpp:
+ (WebCore::SWServer::workerContextTerminated):
+
2020-08-25 Zalan Bujtas <[email protected]>
Facebook post with lots of comments has cut off scrollbar, and can't scroll fully to the bottom (sticky)
Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.cpp (266156 => 266157)
--- trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.cpp 2020-08-26 02:22:44 UTC (rev 266156)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.cpp 2020-08-26 02:25:04 UTC (rev 266157)
@@ -528,12 +528,9 @@
RefPtr<IDBDatabaseNameAndVersionRequest> request;
{
Locker<Lock> locker(m_databaseInfoMapLock);
- auto takenRequest = m_databaseInfoCallbacks.take(requestIdentifier);
-
- if (!takenRequest)
+ request = m_databaseInfoCallbacks.take(requestIdentifier);
+ if (!request)
return;
-
- request = WTFMove(*takenRequest);
}
request->performCallbackOnOriginThread(*request, &IDBDatabaseNameAndVersionRequest::complete, WTFMove(databases));
Modified: trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp (266156 => 266157)
--- trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp 2020-08-26 02:22:44 UTC (rev 266156)
+++ trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp 2020-08-26 02:25:04 UTC (rev 266157)
@@ -121,8 +121,7 @@
ASSERT(isMainThread());
LockHolder locker(s_cacheLock);
- if (auto optionalTree = treePageCache().take(pageID)) {
- auto& tree { *optionalTree };
+ if (auto tree = treePageCache().take(pageID)) {
tree->clear();
treeIDCache().remove(tree->treeID());
}
Modified: trunk/Source/WebCore/crypto/SubtleCrypto.cpp (266156 => 266157)
--- trunk/Source/WebCore/crypto/SubtleCrypto.cpp 2020-08-26 02:22:44 UTC (rev 266156)
+++ trunk/Source/WebCore/crypto/SubtleCrypto.cpp 2020-08-26 02:25:04 UTC (rev 266157)
@@ -509,10 +509,8 @@
RefPtr<DeferredPromise> getPromise(DeferredPromise* index, WeakPtr<SubtleCrypto> subtleCryptoWeakPointer)
{
- if (subtleCryptoWeakPointer) {
- if (auto promise = subtleCryptoWeakPointer->m_pendingPromises.take(index))
- return WTFMove(promise.value());
- }
+ if (subtleCryptoWeakPointer)
+ return subtleCryptoWeakPointer->m_pendingPromises.take(index);
return nullptr;
}
Modified: trunk/Source/WebCore/dom/CustomElementRegistry.cpp (266156 => 266157)
--- trunk/Source/WebCore/dom/CustomElementRegistry.cpp 2020-08-26 02:22:44 UTC (rev 266156)
+++ trunk/Source/WebCore/dom/CustomElementRegistry.cpp 2020-08-26 02:25:04 UTC (rev 266157)
@@ -76,9 +76,7 @@
if (auto* document = m_window.document())
enqueueUpgradeInShadowIncludingTreeOrder(*document, elementInterface.get());
- if (auto promise = m_promiseMap.take(localName))
- return WTFMove(*promise);
- return nullptr;
+ return m_promiseMap.take(localName);
}
JSCustomElementInterface* CustomElementRegistry::findInterface(const Element& element) const
Modified: trunk/Source/WebCore/dom/ScriptRunner.cpp (266156 => 266157)
--- trunk/Source/WebCore/dom/ScriptRunner.cpp 2020-08-26 02:22:44 UTC (rev 266156)
+++ trunk/Source/WebCore/dom/ScriptRunner.cpp 2020-08-26 02:25:04 UTC (rev 266157)
@@ -96,10 +96,8 @@
{
if (pendingScript.element().willExecuteInOrder())
ASSERT(!m_scriptsToExecuteInOrder.isEmpty());
- else {
- ASSERT(m_pendingAsyncScripts.contains(pendingScript));
- m_scriptsToExecuteSoon.append(m_pendingAsyncScripts.take(pendingScript)->ptr());
- }
+ else
+ m_scriptsToExecuteSoon.append(m_pendingAsyncScripts.take(pendingScript).releaseNonNull());
pendingScript.clearClient();
if (!m_document.hasActiveParserYieldToken())
Modified: trunk/Source/WebCore/inspector/agents/InspectorCSSAgent.cpp (266156 => 266157)
--- trunk/Source/WebCore/inspector/agents/InspectorCSSAgent.cpp 2020-08-26 02:22:44 UTC (rev 266156)
+++ trunk/Source/WebCore/inspector/agents/InspectorCSSAgent.cpp 2020-08-26 02:25:04 UTC (rev 266157)
@@ -1030,7 +1030,7 @@
auto sheet = m_nodeToInspectorStyleSheet.take(&node);
if (!sheet)
return;
- m_idToInspectorStyleSheet.remove(sheet.value()->id());
+ m_idToInspectorStyleSheet.remove(sheet->id());
}
void InspectorCSSAgent::didModifyDOMAttr(Element& element)
Modified: trunk/Source/WebCore/page/PageOverlayController.cpp (266156 => 266157)
--- trunk/Source/WebCore/page/PageOverlayController.cpp 2020-08-26 02:22:44 UTC (rev 266156)
+++ trunk/Source/WebCore/page/PageOverlayController.cpp 2020-08-26 02:25:04 UTC (rev 266157)
@@ -227,7 +227,7 @@
overlay.setPage(nullptr);
if (auto optionalLayer = m_overlayGraphicsLayers.take(&overlay))
- optionalLayer.value()->removeFromParent();
+ optionalLayer->removeFromParent();
bool removed = m_pageOverlays.removeFirst(&overlay);
ASSERT_UNUSED(removed, removed);
Modified: trunk/Source/WebCore/workers/service/ServiceWorkerClients.cpp (266156 => 266157)
--- trunk/Source/WebCore/workers/service/ServiceWorkerClients.cpp 2020-08-26 02:22:44 UTC (rev 266156)
+++ trunk/Source/WebCore/workers/service/ServiceWorkerClients.cpp 2020-08-26 02:25:04 UTC (rev 266157)
@@ -124,7 +124,7 @@
connection->claim(serviceWorkerIdentifier, [promisePointer, serviceWorkerIdentifier](auto&& result) mutable {
SWContextManager::singleton().postTaskToServiceWorker(serviceWorkerIdentifier, [promisePointer, result = isolatedCopy(WTFMove(result))](auto& scope) mutable {
if (auto promise = scope.clients().m_pendingPromises.take(promisePointer)) {
- DOMPromiseDeferred<void> pendingPromise { WTFMove(promise.value()) };
+ DOMPromiseDeferred<void> pendingPromise { promise.releaseNonNull() };
pendingPromise.settle(WTFMove(result));
}
});
Modified: trunk/Source/WebCore/workers/service/context/ServiceWorkerThreadProxy.cpp (266156 => 266157)
--- trunk/Source/WebCore/workers/service/context/ServiceWorkerThreadProxy.cpp 2020-08-26 02:22:44 UTC (rev 266156)
+++ trunk/Source/WebCore/workers/service/context/ServiceWorkerThreadProxy.cpp 2020-08-26 02:25:04 UTC (rev 266157)
@@ -222,7 +222,7 @@
if (m_ongoingFetchTasks.isEmpty())
thread().stopFetchEventMonitoring();
- postTaskForModeToWorkerGlobalScope([client = WTFMove(client.value())] (ScriptExecutionContext&) {
+ postTaskForModeToWorkerGlobalScope([client = client.releaseNonNull()] (ScriptExecutionContext&) {
client->cancel();
}, WorkerRunLoop::defaultMode());
}
Modified: trunk/Source/WebCore/workers/service/server/SWServer.cpp (266156 => 266157)
--- trunk/Source/WebCore/workers/service/server/SWServer.cpp 2020-08-26 02:22:44 UTC (rev 266156)
+++ trunk/Source/WebCore/workers/service/server/SWServer.cpp 2020-08-26 02:25:04 UTC (rev 266157)
@@ -781,7 +781,7 @@
// At this point if no registrations are referencing the worker then it will be destroyed,
// removing itself from the m_workersByID map.
auto result = m_runningOrTerminatingWorkers.take(worker.identifier());
- ASSERT_UNUSED(result, result && result->ptr() == &worker);
+ ASSERT_UNUSED(result, result == &worker);
worker.setState(SWServerWorker::State::NotRunning);
Modified: trunk/Source/WebKit/ChangeLog (266156 => 266157)
--- trunk/Source/WebKit/ChangeLog 2020-08-26 02:22:44 UTC (rev 266156)
+++ trunk/Source/WebKit/ChangeLog 2020-08-26 02:25:04 UTC (rev 266157)
@@ -1,3 +1,22 @@
+2020-08-25 Ryosuke Niwa <[email protected]>
+
+ HashMap<Ref<T>>::take should return RefPtr<T>
+ https://bugs.webkit.org/show_bug.cgi?id=215830
+
+ Reviewed by Darin Adler.
+
+ * GPUProcess/media/RemoteAudioDestinationManager.cpp:
+ (WebKit::RemoteAudioDestinationManager::deleteAudioDestination):
+ * NetworkProcess/NetworkResourceLoadMap.cpp:
+ (WebKit::NetworkResourceLoadMap::take):
+ * UIProcess/Automation/WebAutomationSession.cpp:
+ (WebKit::WebAutomationSession::willClosePage):
+ * UIProcess/WebURLSchemeHandler.cpp:
+ (WebKit::WebURLSchemeHandler::taskCompleted):
+ * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
+ (WebKit::UserMediaPermissionRequestManager::userMediaAccessWasGranted):
+ (WebKit::UserMediaPermissionRequestManager::userMediaAccessWasDenied):
+
2020-08-25 Tim Horton <[email protected]>
Web Share API can share non-HTTP(S) URLs
Modified: trunk/Source/WebKit/GPUProcess/media/RemoteAudioDestinationManager.cpp (266156 => 266157)
--- trunk/Source/WebKit/GPUProcess/media/RemoteAudioDestinationManager.cpp 2020-08-26 02:22:44 UTC (rev 266156)
+++ trunk/Source/WebKit/GPUProcess/media/RemoteAudioDestinationManager.cpp 2020-08-26 02:25:04 UTC (rev 266157)
@@ -150,7 +150,7 @@
{
auto destination = m_audioDestinations.take(id);
if (destination)
- destination.value()->scheduleGracefulShutdownIfNeeded();
+ destination->scheduleGracefulShutdownIfNeeded();
completionHandler();
}
Modified: trunk/Source/WebKit/NetworkProcess/NetworkResourceLoadMap.cpp (266156 => 266157)
--- trunk/Source/WebKit/NetworkProcess/NetworkResourceLoadMap.cpp 2020-08-26 02:22:44 UTC (rev 266156)
+++ trunk/Source/WebKit/NetworkProcess/NetworkResourceLoadMap.cpp 2020-08-26 02:25:04 UTC (rev 266157)
@@ -66,10 +66,10 @@
if (!loader)
return nullptr;
- if ((*loader)->originalRequest().hasUpload())
+ if (loader->originalRequest().hasUpload())
setHasUpload(WTF::anyOf(m_loaders.values(), [](auto& loader) { return loader->originalRequest().hasUpload(); }));
- return WTFMove(*loader);
+ return loader;
}
NetworkResourceLoader* NetworkResourceLoadMap::get(ResourceLoadIdentifier identifier) const
Modified: trunk/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp (266156 => 266157)
--- trunk/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp 2020-08-26 02:22:44 UTC (rev 266156)
+++ trunk/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp 2020-08-26 02:25:04 UTC (rev 266157)
@@ -835,9 +835,8 @@
#if ENABLE(WEBDRIVER_ACTIONS_API)
// Then tell the input dispatcher to cancel so timers are stopped, and let it go out of scope.
- Optional<Ref<SimulatedInputDispatcher>> inputDispatcher = m_inputDispatchersByPage.take(page.identifier());
- if (inputDispatcher.hasValue())
- inputDispatcher.value()->cancel();
+ if (auto inputDispatcher = m_inputDispatchersByPage.take(page.identifier()))
+ inputDispatcher->cancel();
#endif
}
Modified: trunk/Source/WebKit/UIProcess/WebURLSchemeHandler.cpp (266156 => 266157)
--- trunk/Source/WebKit/UIProcess/WebURLSchemeHandler.cpp 2020-08-26 02:22:44 UTC (rev 266156)
+++ trunk/Source/WebKit/UIProcess/WebURLSchemeHandler.cpp 2020-08-26 02:25:04 UTC (rev 266157)
@@ -105,7 +105,7 @@
void WebURLSchemeHandler::taskCompleted(WebURLSchemeTask& task)
{
auto takenTask = m_tasks.take(task.identifier());
- ASSERT_UNUSED(takenTask, takenTask->ptr() == &task);
+ ASSERT_UNUSED(takenTask, takenTask == &task);
removeTaskFromPageMap(task.pageProxyID(), task.identifier());
platformTaskCompleted(task);
Modified: trunk/Source/WebKit/WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp (266156 => 266157)
--- trunk/Source/WebKit/WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp 2020-08-26 02:22:44 UTC (rev 266156)
+++ trunk/Source/WebKit/WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp 2020-08-26 02:25:04 UTC (rev 266157)
@@ -125,7 +125,7 @@
return;
}
- request.value()->allow(WTFMove(audioDevice), WTFMove(videoDevice), WTFMove(deviceIdentifierHashSalt), WTFMove(completionHandler));
+ request->allow(WTFMove(audioDevice), WTFMove(videoDevice), WTFMove(deviceIdentifierHashSalt), WTFMove(completionHandler));
}
void UserMediaPermissionRequestManager::userMediaAccessWasDenied(uint64_t requestID, UserMediaRequest::MediaAccessDenialReason reason, String&& invalidConstraint)
@@ -134,7 +134,7 @@
if (!request)
return;
- request.value()->deny(reason, WTFMove(invalidConstraint));
+ request->deny(reason, WTFMove(invalidConstraint));
}
void UserMediaPermissionRequestManager::enumerateMediaDevices(Document& document, CompletionHandler<void(const Vector<CaptureDevice>&, const String&)>&& completionHandler)
Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (266156 => 266157)
--- trunk/Source/WebKitLegacy/mac/ChangeLog 2020-08-26 02:22:44 UTC (rev 266156)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog 2020-08-26 02:25:04 UTC (rev 266157)
@@ -1,3 +1,13 @@
+2020-08-25 Ryosuke Niwa <[email protected]>
+
+ HashMap<Ref<T>>::take should return RefPtr<T>
+ https://bugs.webkit.org/show_bug.cgi?id=215830
+
+ Reviewed by Darin Adler.
+
+ * WebCoreSupport/WebEditorClient.mm:
+ (WebEditorClient::didCheckSucceed):
+
2020-08-25 Megan Gardner <[email protected]>
Trying to lookup when WebView is in a popover causes process to hang. Fix for Legacy WebView.
Modified: trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.mm (266156 => 266157)
--- trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.mm 2020-08-26 02:22:44 UTC (rev 266156)
+++ trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.mm 2020-08-26 02:25:04 UTC (rev 266157)
@@ -1221,12 +1221,11 @@
void WebEditorClient::didCheckSucceed(TextCheckingRequestIdentifier identifier, NSArray *results)
{
- auto requestOptional = m_requestsInFlight.take(identifier);
- ASSERT(requestOptional);
- if (!requestOptional)
+ auto request = m_requestsInFlight.take(identifier);
+ ASSERT(request);
+ if (!request)
return;
-
- auto request = WTFMove(requestOptional.value());
+
ASSERT(identifier == request->data().identifier().value());
request->didSucceed(core(results, request->data().checkingTypes()));
}
Modified: trunk/Tools/ChangeLog (266156 => 266157)
--- trunk/Tools/ChangeLog 2020-08-26 02:22:44 UTC (rev 266156)
+++ trunk/Tools/ChangeLog 2020-08-26 02:25:04 UTC (rev 266157)
@@ -1,3 +1,15 @@
+2020-08-25 Ryosuke Niwa <[email protected]>
+
+ HashMap<Ref<T>>::take should return RefPtr<T>
+ https://bugs.webkit.org/show_bug.cgi?id=215830
+
+ Reviewed by Darin Adler.
+
+ * TestWebKitAPI/Tests/WTF/HashMap.cpp:
+ (TestWebKitAPI::TEST):
+ * TestWebKitAPI/Tests/WTF/HashSet.cpp:
+ (TestWebKitAPI::TEST):
+
2020-08-25 Carlos Alberto Lopez Perez <[email protected]>
[GTK][WPE] Add a script for generating MiniBrowser bundles (follow-up fix)
Modified: trunk/Tools/TestWebKitAPI/Tests/WTF/HashMap.cpp (266156 => 266157)
--- trunk/Tools/TestWebKitAPI/Tests/WTF/HashMap.cpp 2020-08-26 02:22:44 UTC (rev 266156)
+++ trunk/Tools/TestWebKitAPI/Tests/WTF/HashMap.cpp 2020-08-26 02:25:04 UTC (rev 266157)
@@ -946,7 +946,7 @@
auto aOut = map.take(1);
ASSERT_TRUE(static_cast<bool>(aOut));
- ASSERT_EQ(&a, aOut.value().ptr());
+ ASSERT_EQ(&a, aOut.get());
}
ASSERT_STREQ("ref(a) deref(a) ", takeLogStr().c_str());
Modified: trunk/Tools/TestWebKitAPI/Tests/WTF/HashSet.cpp (266156 => 266157)
--- trunk/Tools/TestWebKitAPI/Tests/WTF/HashSet.cpp 2020-08-26 02:22:44 UTC (rev 266156)
+++ trunk/Tools/TestWebKitAPI/Tests/WTF/HashSet.cpp 2020-08-26 02:25:04 UTC (rev 266157)
@@ -404,7 +404,7 @@
auto aOut = set.take(&a);
ASSERT_TRUE(static_cast<bool>(aOut));
- ASSERT_EQ(&a, aOut.value().ptr());
+ ASSERT_EQ(&a, aOut.get());
}
ASSERT_STREQ("ref(a) deref(a) ", takeLogStr().c_str());
@@ -419,7 +419,7 @@
auto aOut = set.takeAny();
ASSERT_TRUE(static_cast<bool>(aOut));
- ASSERT_EQ(&a, aOut.value().ptr());
+ ASSERT_EQ(&a, aOut.get());
}
ASSERT_STREQ("ref(a) deref(a) ", takeLogStr().c_str());