Changeset 278409 in webkit
- Timestamp:
- Jun 3, 2021, 10:04:44 AM (5 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
NetworkProcess/WebStorage/StorageArea.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r278402 r278409 1 2021-06-03 Chris Dumez <cdumez@apple.com> 2 3 StorageArea should be able to send its IPC directly from the background thread 4 https://bugs.webkit.org/show_bug.cgi?id=226583 5 6 Reviewed by Alex Christensen. 7 8 Update StorageArea so that it does its IPC sending straight from the storage thread, instead of 9 hopping to the main thread to do so. 10 11 * NetworkProcess/WebStorage/StorageArea.cpp: 12 (WebKit::StorageArea::clear): 13 (WebKit::StorageArea::dispatchEvents const): 14 1 15 2021-06-03 Carlos Garcia Campos <cgarcia@igalia.com> 2 16 -
trunk/Source/WebKit/NetworkProcess/WebStorage/StorageArea.cpp
r278253 r278409 164 164 } 165 165 166 for (auto it = m_eventListeners.begin(), end = m_eventListeners.end(); it != end; ++it) { 167 RunLoop::main().dispatch([connectionID = *it, destinationStorageAreaID = m_identifier] { 168 if (auto* connection = IPC::Connection::connection(connectionID)) 169 connection->send(Messages::StorageAreaMap::ClearCache(), destinationStorageAreaID); 170 }); 171 } 166 for (auto& listenerUniqueID : m_eventListeners) 167 IPC::Connection::send(listenerUniqueID, Messages::StorageAreaMap::ClearCache(), m_identifier.toUInt64()); 172 168 } 173 169 … … 190 186 ASSERT(!RunLoop::isMain()); 191 187 ASSERT(storageAreaImplID); 192 for (auto it = m_eventListeners.begin(), end = m_eventListeners.end(); it != end; ++it) { 193 std::optional<StorageAreaImplIdentifier> optionalStorageAreaImplID = *it == sourceConnection ? std::make_optional(storageAreaImplID) : std::nullopt; 194 195 RunLoop::main().dispatch([connectionID = *it, destinationStorageAreaID = m_identifier, key = key.isolatedCopy(), oldValue = oldValue.isolatedCopy(), newValue = newValue.isolatedCopy(), urlString = urlString.isolatedCopy(), optionalStorageAreaImplID = WTFMove(optionalStorageAreaImplID)] { 196 if (auto* connection = IPC::Connection::connection(connectionID)) 197 connection->send(Messages::StorageAreaMap::DispatchStorageEvent(optionalStorageAreaImplID, key, oldValue, newValue, urlString), destinationStorageAreaID); 198 }); 188 for (auto& listenerUniqueID : m_eventListeners) { 189 auto optionalStorageAreaImplID = listenerUniqueID == sourceConnection ? std::make_optional(storageAreaImplID) : std::nullopt; 190 IPC::Connection::send(listenerUniqueID, Messages::StorageAreaMap::DispatchStorageEvent(optionalStorageAreaImplID, key, oldValue, newValue, urlString), m_identifier.toUInt64()); 199 191 } 200 192 }
Note:
See TracChangeset
for help on using the changeset viewer.