Title: [289128] trunk/Source
Revision
289128
Author
[email protected]
Date
2022-02-04 10:50:31 -0800 (Fri, 04 Feb 2022)

Log Message

Revert some structured binding workarounds with Clang
https://bugs.webkit.org/show_bug.cgi?id=236098

Reviewed by Sam Weinig.

Revert structured bindings workarounds made in r288309, r261572, r249524 now that this is fixed in clang.

Source/WebCore:

* Modules/indexeddb/server/MemoryObjectStore.cpp:
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
* inspector/agents/InspectorNetworkAgent.cpp:

Source/WebKit:

* NetworkProcess/storage/StorageAreaBase.cpp:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (289127 => 289128)


--- trunk/Source/WebCore/ChangeLog	2022-02-04 18:42:08 UTC (rev 289127)
+++ trunk/Source/WebCore/ChangeLog	2022-02-04 18:50:31 UTC (rev 289128)
@@ -1,3 +1,16 @@
+2022-02-04  Christopher Reid  <[email protected]>
+
+        Revert some structured binding workarounds with Clang
+        https://bugs.webkit.org/show_bug.cgi?id=236098
+
+        Reviewed by Sam Weinig.
+
+        Revert structured bindings workarounds made in r288309, r261572, r249524 now that this is fixed in clang.
+
+        * Modules/indexeddb/server/MemoryObjectStore.cpp:
+        * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
+        * inspector/agents/InspectorNetworkAgent.cpp:
+
 2022-02-04  Sam Weinig  <[email protected]>
 
         Gradients don't correctly interpolate missing/none color components correctly

Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.cpp (289127 => 289128)


--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.cpp	2022-02-04 18:42:08 UTC (rev 289127)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.cpp	2022-02-04 18:50:31 UTC (rev 289128)
@@ -310,8 +310,8 @@
     IDBError error;
     Vector<std::pair<MemoryIndex*, IndexKey>> changedIndexRecords;
 
-    for (const auto& entry : indexKeys) {
-        auto* index = m_indexesByIdentifier.get(entry.key);
+    for (const auto& [indexID, indexKey] : indexKeys) {
+        auto* index = m_indexesByIdentifier.get(indexID);
         ASSERT(index);
         if (!index) {
             error = IDBError { InvalidStateError, "Missing index metadata" };
@@ -318,11 +318,11 @@
             break;
         }
 
-        error = index->putIndexKey(key, entry.value);
+        error = index->putIndexKey(key, indexKey);
         if (!error.isNull())
             break;
 
-        changedIndexRecords.append(std::make_pair(index, entry.value));
+        changedIndexRecords.append(std::make_pair(index, indexKey));
     }
 
     // If any of the index puts failed, revert all of the ones that went through.

Modified: trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp (289127 => 289128)


--- trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp	2022-02-04 18:42:08 UTC (rev 289127)
+++ trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp	2022-02-04 18:50:31 UTC (rev 289128)
@@ -1913,8 +1913,8 @@
     const auto& indexMap = info.indexMap();
     bool anyRecordsSucceeded = false;
 
-    for (const auto& entry : indexKeys) {
-        auto indexIterator = indexMap.find(entry.key);
+    for (const auto& [indexID, indexKey] : indexKeys) {
+        auto indexIterator = indexMap.find(indexID);
         ASSERT(indexIterator != indexMap.end());
 
         if (indexIterator == indexMap.end()) {
@@ -1922,7 +1922,7 @@
             break;
         }
 
-        error = uncheckedPutIndexKey(indexIterator->value, key, entry.value, recordID);
+        error = uncheckedPutIndexKey(indexIterator->value, key, indexKey, recordID);
         if (!error.isNull())
             break;
 

Modified: trunk/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp (289127 => 289128)


--- trunk/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp	2022-02-04 18:42:08 UTC (rev 289127)
+++ trunk/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp	2022-02-04 18:50:31 UTC (rev 289128)
@@ -1193,10 +1193,10 @@
         request.setHTTPMethod(method);
     if (headers) {
         HTTPHeaderMap explicitHeaders;
-        for (auto& header : *headers) {
-            auto headerValue = header.value->asString();
+        for (auto& [key, value] : *headers) {
+            auto headerValue = value->asString();
             if (!!headerValue)
-                explicitHeaders.add(header.key, headerValue);
+                explicitHeaders.add(key, headerValue);
         }
         request.setHTTPHeaderFields(WTFMove(explicitHeaders));
     }

Modified: trunk/Source/WebKit/ChangeLog (289127 => 289128)


--- trunk/Source/WebKit/ChangeLog	2022-02-04 18:42:08 UTC (rev 289127)
+++ trunk/Source/WebKit/ChangeLog	2022-02-04 18:50:31 UTC (rev 289128)
@@ -1,3 +1,14 @@
+2022-02-04  Christopher Reid  <[email protected]>
+
+        Revert some structured binding workarounds with Clang
+        https://bugs.webkit.org/show_bug.cgi?id=236098
+
+        Reviewed by Sam Weinig.
+
+        Revert structured bindings workarounds made in r288309, r261572, r249524 now that this is fixed in clang.
+
+        * NetworkProcess/storage/StorageAreaBase.cpp:
+
 2022-02-04  Commit Queue  <[email protected]>
 
         Unreviewed, reverting r289125.

Modified: trunk/Source/WebKit/NetworkProcess/storage/StorageAreaBase.cpp (289127 => 289128)


--- trunk/Source/WebKit/NetworkProcess/storage/StorageAreaBase.cpp	2022-02-04 18:42:08 UTC (rev 289127)
+++ trunk/Source/WebKit/NetworkProcess/storage/StorageAreaBase.cpp	2022-02-04 18:50:31 UTC (rev 289128)
@@ -64,8 +64,8 @@
 
 void StorageAreaBase::notifyListenersAboutClear()
 {
-    for (auto& listener : m_listeners)
-        IPC::Connection::send(listener.key, Messages::StorageAreaMap::ClearCache(StorageAreaBase::nextMessageIdentifier()), listener.value.toUInt64());
+    for (auto& [connection, identifier] : m_listeners)
+        IPC::Connection::send(connection, Messages::StorageAreaMap::ClearCache(StorageAreaBase::nextMessageIdentifier()), identifier.toUInt64());
 }
 
 void StorageAreaBase::dispatchEvents(IPC::Connection::UniqueID sourceConnection, StorageAreaImplIdentifier sourceImplIdentifier, const String& key, const String& oldValue, const String& newValue, const String& urlString) const
@@ -72,11 +72,11 @@
 {
     ASSERT(sourceImplIdentifier);
 
-    for (auto& listener : m_listeners) {
+    for (auto& [connection, identifier] : m_listeners) {
         std::optional<StorageAreaImplIdentifier> implIdentifier;
-        if (listener.key == sourceConnection)
+        if (connection == sourceConnection)
             implIdentifier = sourceImplIdentifier;
-        IPC::Connection::send(listener.key, Messages::StorageAreaMap::DispatchStorageEvent(implIdentifier, key, oldValue, newValue, urlString, StorageAreaBase::nextMessageIdentifier()), listener.value.toUInt64());
+        IPC::Connection::send(connection, Messages::StorageAreaMap::DispatchStorageEvent(implIdentifier, key, oldValue, newValue, urlString, StorageAreaBase::nextMessageIdentifier()), identifier.toUInt64());
     }
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to