New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GraphicsLayerWC: site isolation support #12723
GraphicsLayerWC: site isolation support #12723
Conversation
EWS run on previous version of this PR (hash 103c71f) |
103c71f
to
9063076
Compare
EWS run on previous version of this PR (hash 9063076) |
9063076
to
ff68a79
Compare
EWS run on previous version of this PR (hash ff68a79) |
ff68a79
to
5f75b6f
Compare
EWS run on previous version of this PR (hash 5f75b6f) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for being engaged in this development. It is good to know that site isolation won't be just a Cocoa-specific development, which is important for the health of the project.
Do you know what it would take to get it so that we could unskip the test and have the drawing driven in all processes? That would probably be worth finding out. Also, the test times out occasionally on macOS for an unknown reason, and I am hoping to fix that soonish.
For a currently unknown reason, on macOS one isolated iframe draws fine but the second isolated iframe does not draw. I was hoping to figure that out and fix it before cementing the architecture in even more by adding another port's implementation.
One thing I had to make sure I did right is attach the layer and sublayer correctly if the parent layer was created first and if the child layer was created first, which required two places where we stitched layers together. I'm not sure I see that in your code.
Source/WebKit/GPUProcess/graphics/wc/WCRemoteFrameHostLayerManager.cpp
Outdated
Show resolved
Hide resolved
rootLayer.viewOverlayRootLayer->flushCompositingState(visibleRect); | ||
|
||
m_commitQueue->dispatch([this, weakThis = WeakPtr(*this), stateID = m_backingStoreStateID, updateInfo = std::exchange(m_updateInfo, { }), willCallDisplayDidRefresh]() mutable { | ||
flushLayerImageBuffers(updateInfo); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably check weakThis before using this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WeakPtr isn't thread safe. I should nothing for the WeakPtr in another thread.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted the fix.
For the WinCairo problem, I will do it as as a follow-up.
Do you mean a page containing two cross-site iframes or two pages containing a cross-site iframe?
This patch supports both scenarios.
If a remote frame layer tree is created before the parent layer is created
|
5f75b6f
to
e3fdd98
Compare
EWS run on previous version of this PR (hash e3fdd98) |
e3fdd98
to
62db346
Compare
EWS run on previous version of this PR (hash 62db346) |
It's able to run the test. Due to the repainting problem, it is flaky test failure. But, no timeout failure.
It tuned out web process is leaking. The number of web processes is gradually increasing and crash eventually without |
62db346
to
f90ac07
Compare
EWS run on current version of this PR (hash f90ac07) |
https://bugs.webkit.org/show_bug.cgi?id=254902 Reviewed by Don Olmstead. This is the initial support of site isolation for GraphicsLayerWC. Cocoa port (aka RemoteLayerTree and GraphicsLayerCARemote) transfers a layer tree to UI process, GraphicsLayerWC transfers a layer tree to GPU process. GPU process renders a remote child frame into a texture, and attach the texture into the content of iframe layer of the parent frame's layer tree. Added WCRemoteFrameHostLayerManager class to manage a HashMap from a LayerHostingContextIdentifier to a BitmapTexture. This has a problem now. Updating remote child frame's layer tree doesn't trigger the parent frame's repaint. For the workaround, you need to manually click a browser window of MiniBrowser to repaint. Keep http/tests/site-isolation tests skipped for WinCairo. MiniBrowser has to enable SiteIsolationEnabled option to test it by using the internal settings menu item or adding the following code. > WKPreferencesSetBoolValueForKeyForTesting(preferences.get(), true, createWKString("SiteIsolationEnabled").get()); Fixed a bug of TextureMapperGL::endPainting. It should restore a previous frame buffer that TextureMapperGL::beginPainting saved. TextureMapperGL supports the offscreen rendering mode for WebKitTestRunner pixel dump mode. It's not a problem for WebKitTestRunner because it renders a layer tree always to a texture. In site-isolation, however, remote frame's layer tree renders to a texture and main frame layer tree to a frame buffer. After rendering to a texture, it has to restore the previous frame buffer. * Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp: (WebCore::TextureMapperGL::endPainting): Restore the previous framebuffer. * Source/WebKit/GPUProcess/GPUConnectionToWebProcess.cpp: (WebKit::GPUConnectionToWebProcess::didClose): * Source/WebKit/GPUProcess/graphics/wc/RemoteWCLayerTreeHost.cpp: (WebKit::remoteGraphicsStreamWorkQueue): * Source/WebKit/GPUProcess/graphics/wc/RemoteWCLayerTreeHost.h: * Source/WebKit/GPUProcess/graphics/wc/WCRemoteFrameHostLayerManager.cpp: Added. (WebKit::WCRemoteFrameHostLayerManager::singleton): (WebKit::WCRemoteFrameHostLayerManager::acquireRemoteFrameHostLayer): (WebKit::WCRemoteFrameHostLayerManager::releaseRemoteFrameHostLayer): (WebKit::WCRemoteFrameHostLayerManager::updateTexture): (WebKit::WCRemoteFrameHostLayerManager::removeAllLayersForProcess): * Source/WebKit/GPUProcess/graphics/wc/WCRemoteFrameHostLayerManager.h: Added. * Source/WebKit/GPUProcess/graphics/wc/WCScene.cpp: (WebKit::WCScene::update): * Source/WebKit/PlatformPlayStation.cmake: * Source/WebKit/PlatformWin.cmake: * Source/WebKit/WebProcess/WebPage/wc/DrawingAreaWC.cpp: (WebKit::DrawingAreaWC::DrawingAreaWC): (WebKit::DrawingAreaWC::updateRootLayers): (WebKit::DrawingAreaWC::setRootCompositingLayer): (WebKit::DrawingAreaWC::addRootFrame): (WebKit::DrawingAreaWC::attachViewOverlayGraphicsLayer): (WebKit::DrawingAreaWC::updatePreferences): (WebKit::DrawingAreaWC::shouldUseTiledBackingForFrameView const): (WebKit::DrawingAreaWC::updateGeometryWC): (WebKit::DrawingAreaWC::isCompositingMode): (WebKit::DrawingAreaWC::sendUpdateAC): (WebKit::DrawingAreaWC::rootLayerInfoWithFrameIdentifier): * Source/WebKit/WebProcess/WebPage/wc/DrawingAreaWC.h: * Source/WebKit/WebProcess/WebPage/wc/GraphicsLayerWC.cpp: (WebKit::GraphicsLayerWC::setContentsToPlatformLayerHost): (WebKit::GraphicsLayerWC::flushCompositingStateForThisLayerOnly): * Source/WebKit/WebProcess/WebPage/wc/GraphicsLayerWC.h: * Source/WebKit/WebProcess/WebPage/wc/WCUpdateInfo.h: (WebKit::WCLayerUpdateInfo::encode const): (WebKit::WCLayerUpdateInfo::decode): (WebKit::WCUpdateInfo::encode const): (WebKit::WCUpdateInfo::decode): Canonical link: https://commits.webkit.org/265099@main
f90ac07
to
dc5a423
Compare
Committed 265099@main (dc5a423): https://commits.webkit.org/265099@main Reviewed commits have been landed. Closing PR #12723 and removing active labels. |
dc5a423
f90ac07
π wincairoπ§ͺ api-macπ gtkπ§ͺ mac-wk1π§ͺ gtk-wk2π§ͺ api-gtkπ§ͺ mac-AS-debug-wk2