Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d5d5bd30a02deea1a39d7235f31a0bf3fee5cdd4
      
https://github.com/WebKit/WebKit/commit/d5d5bd30a02deea1a39d7235f31a0bf3fee5cdd4
  Author: Patrick Angle <pan...@apple.com>
  Date:   2023-04-05 (Wed, 05 Apr 2023)

  Changed paths:
    M Source/JavaScriptCore/inspector/remote/RemoteInspectionTarget.cpp
    M Source/JavaScriptCore/inspector/remote/RemoteInspectionTarget.h
    M Source/JavaScriptCore/inspector/remote/RemoteInspector.h
    M Source/JavaScriptCore/inspector/remote/cocoa/RemoteInspectorCocoa.mm
    M Source/WebKit/UIProcess/WebPageProxy.cpp

  Log Message:
  -----------
  Remote Web Inspector: Send the `presentingApplicationPID` to the relay 
process for WKWebViews
https://bugs.webkit.org/show_bug.cgi?id=254537
rdar://105636143

Reviewed by BJ Burg.

In some cases, a process may create WKWebViews on behalf of another process to 
be served remotely. WKWebViews
inspectability is managed in the UI process, and those does not currently use 
the `presentingApplicationPID` to
associate a target with a specific parent process (a process may represent 
multiple parent processes at a time). We thus
need to provide target-specific PIDs for the presenting application so that 
WKWebViews are correctly related back to the
application that is showing the web content via the intermediate remote service 
that actually created the WKWebView.

* Source/JavaScriptCore/inspector/remote/RemoteInspectionTarget.cpp:
(Inspector::RemoteInspectionTarget::setPresentingApplicationPID):
* Source/JavaScriptCore/inspector/remote/RemoteInspectionTarget.h:
- Allow setting a per-target `presentingApplicationPID` as an alternative to 
having a single PID the entire process
proxies its inspectable content to.

* Source/JavaScriptCore/inspector/remote/cocoa/RemoteInspectorCocoa.mm:
(Inspector::identifierForPID):
(Inspector::RemoteInspector::listingForInspectionTarget const):
- Provide a per-target presenting application PID so that individual web views 
can be associated the appropriate process.
Relays should use this value in place of the application-wide parent process 
PID when it is present. For WKWebView,
those values will be equal by default unless explicitly set.

(Inspector::RemoteInspector::receivedProxyApplicationSetupMessage):
- Proxy apps don't need to respond to the proxy setup message, since all the 
necessary information will be provided with
the application's listing of targets.

* Source/WebKit/UIProcess/WebPageProxy.cpp:
- Use the `presentingApplicationPID` of the web content process pool to inform 
associate the inspectable page with the
correct parent application, since that is the pool that the content to be 
inspected will actually exist in. Unless it
has been overriden, this will be the PID of the UI process.

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


_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to