12022-02-19 Chris Dumez <cdumez@apple.com>
2
3 Optimize DOM storage event dispatch
4 https://bugs.webkit.org/show_bug.cgi?id=236871
5
6 Reviewed by NOBODY (OOPS!).
7
8 Made the following optimization to DOM storage event dispatch:
9 1. Pass a SecurityOrigin around instead of a SecurityOriginData. Otherwise,
10 dispatchLocalStorageEvents() / dispatchSessionStorageEvents() just keep
11 reconstructing the SecurityOrigin from the SecurityOriginData for every
12 frame.
13 2. When gathering the list of frames where we need to dispatch the storage
14 event, discard the ones that do not have a "storage" event listener.
15
16 * inspector/InspectorInstrumentation.cpp:
17 (WebCore::InspectorInstrumentation::didDispatchDOMStorageEventImpl):
18 * inspector/InspectorInstrumentation.h:
19 (WebCore::InspectorInstrumentation::didDispatchDOMStorageEvent):
20 * inspector/agents/InspectorDOMStorageAgent.cpp:
21 (WebCore::InspectorDOMStorageAgent::storageId):
22 (WebCore::InspectorDOMStorageAgent::didDispatchDOMStorageEvent):
23 (WebCore::InspectorDOMStorageAgent::findStorageArea):
24 * inspector/agents/InspectorDOMStorageAgent.h:
25 * loader/EmptyClients.cpp:
26 * page/DOMWindow.cpp:
27 * storage/StorageEventDispatcher.cpp:
28 (WebCore::StorageEventDispatcher::dispatchSessionStorageEvents):
29 (WebCore::StorageEventDispatcher::dispatchLocalStorageEvents):
30 (WebCore::StorageEventDispatcher::dispatchSessionStorageEventsToFrames):
31 (WebCore::StorageEventDispatcher::dispatchLocalStorageEventsToFrames):
32 * storage/StorageEventDispatcher.h:
33 * storage/StorageNamespace.h:
34 * storage/StorageNamespaceProvider.cpp:
35 (WebCore::StorageNamespaceProvider::localStorageArea):
36