Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 376f4eaf9750f0df5b0f91ab0dad9e81fe217c37
      
https://github.com/WebKit/WebKit/commit/376f4eaf9750f0df5b0f91ab0dad9e81fe217c37
  Author: Brady Eidson <[email protected]>
  Date:   2024-11-15 (Fri, 15 Nov 2024)

  Changed paths:
    M Source/WebCore/CMakeLists.txt
    M Source/WebCore/DerivedSources-input.xcfilelist
    M Source/WebCore/DerivedSources-output.xcfilelist
    M Source/WebCore/DerivedSources.make
    M Source/WebCore/Headers.cmake
    A Source/WebCore/Scripts/generate-process-sync-data.py
    M Source/WebCore/Sources.txt
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    M Source/WebCore/page/Page.cpp
    M Source/WebCore/page/Page.h
    R Source/WebCore/page/ProcessSyncClient.h
    A Source/WebCore/page/ProcessSyncData.in
    M Source/WebKit/CMakeLists.txt
    M Source/WebKit/DerivedSources-input.xcfilelist
    M Source/WebKit/DerivedSources.make
    M Source/WebKit/UIProcess/WebPageProxy.cpp
    M Source/WebKit/UIProcess/WebPageProxy.h
    M Source/WebKit/UIProcess/WebPageProxy.messages.in
    M Source/WebKit/WebProcess/WebCoreSupport/WebProcessSyncClient.cpp
    M Source/WebKit/WebProcess/WebCoreSupport/WebProcessSyncClient.h
    M Source/WebKit/WebProcess/WebPage/WebPage.cpp
    M Source/WebKit/WebProcess/WebPage/WebPage.h
    M Source/WebKit/WebProcess/WebPage/WebPage.messages.in

  Log Message:
  -----------
  Generate "process synched data" code
https://bugs.webkit.org/show_bug.cgi?id=283178
<rdar://problem/139974832>

Reviewed by Charlie Wolfe.

With site isolation, there's a lot of bits of data that are generated in one 
WebContent process that
other WebContent processes need to be aware of.

We'd started down a somewhat slow road of writing messages for each case, ad 
hoc.
Keeping with that approach seems undesirable.

This patch adds a new `ProcessSyncData.in` file where you declare a property 
that needs to be synced.
It also adds a script that processes that file.

The script generates `ProcessSyncClient` with one method per data to broadcast 
the change.
It also generates `ProcessSyncData` code to wrap the data type being broadcast 
as well as generate its
serializers for message passing.

To add a new synced data type is now as simple as:
1 - Adding an entry for it in `ProcessSyncData.in`
2 - Make a one line call to the new `ProcessSyncClient` method where the data 
change is generated
3 - Handle the new switch case in `Page::updateProcessSyncData` to receive the 
data change broadcast

I fully expect this mechanism will grow to become much more flexible (e.g. 
targeting specific frames)
but for now most of the complexity was getting all of the scripts and build 
system stuff figured out;
Future expansion of the mechanism should be much easier.

The behavior change of moving "MainFrameURLChange" over to this new mechanism 
is covered by an API test:
SiteIsolation.MainFrameURLAfterFragmentNavigation

* Source/WebCore/DerivedSources-input.xcfilelist:
* Source/WebCore/DerivedSources-output.xcfilelist:
* Source/WebCore/DerivedSources.make:

* Source/WebCore/Scripts/generate-process-sync-data.py: Added.
(SyncedData):
(SyncedData.__init__):
(parse_process_sync_data):
(generate_process_sync_client_header):
(generate_process_sync_client_impl):
(sorted_qualified_types):
(generate_process_sync_data_header):
(generate_process_sync_data_header.ProcessSyncDataType):
(generate_process_sync_data_serialiation_in):
(generate_process_sync_data_serialiation_in.WebCore):
(main):

* Source/WebCore/WebCore.xcodeproj/project.pbxproj:

* Source/WebCore/page/Page.cpp:
(WebCore::Page::updateProcessSyncData):
* Source/WebCore/page/Page.h:

* Source/WebCore/page/ProcessSyncClient.h: Removed.

* Source/WebCore/page/ProcessSyncData.in: Added.

* Source/WebKit/DerivedSources-input.xcfilelist:
* Source/WebKit/DerivedSources.make:

* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::broadcastProcessSyncData):
(WebKit::WebPageProxy::broadcastMainFrameURLChangeToOtherProcesses): Deleted.
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/UIProcess/WebPageProxy.messages.in:

* Source/WebKit/WebProcess/WebCoreSupport/WebProcessSyncClient.cpp:
(WebKit::WebProcessSyncClient::broadcastProcessSyncDataToOtherProcesses):
(WebKit::WebProcessSyncClient::broadcastMainFrameURLChangeToOtherProcesses): 
Deleted.
* Source/WebKit/WebProcess/WebCoreSupport/WebProcessSyncClient.h:

* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::processSyncDataChangedInAnotherProcess):
(WebKit::WebPage::mainFrameURLChangedInAnotherProcess): Deleted.
* Source/WebKit/WebProcess/WebPage/WebPage.h:
* Source/WebKit/WebProcess/WebPage/WebPage.messages.in:

Canonical link: https://commits.webkit.org/286671@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to