WebKit Bugzilla
Attachment 342284 Details for
Bug 186429
: Send display link IPC message from display link thread.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for landing
patch186429.txt (text/plain), 3.32 KB, created by
Per Arne Vollan
on 2018-06-08 10:21:44 PDT
(
hide
)
Description:
Patch for landing
Filename:
MIME Type:
Creator:
Per Arne Vollan
Created:
2018-06-08 10:21:44 PDT
Size:
3.32 KB
patch
obsolete
>Index: Source/WebKit/ChangeLog >=================================================================== >--- Source/WebKit/ChangeLog (revision 232620) >+++ Source/WebKit/ChangeLog (working copy) >@@ -1,3 +1,20 @@ >+2018-06-08 Per Arne Vollan <pvollan@apple.com> >+ >+ Send display link IPC message from display link thread. >+ https://bugs.webkit.org/show_bug.cgi?id=186429 >+ >+ Reviewed by Geoffrey Garen. >+ >+ When the display link callback is firing on the display link thread in the UI process, >+ we schedule a function to be called on the main thread to send the IPC message to the >+ WebContent process. Since Connection::send is thread-safe, we can just send the message >+ from the display link thread, instead. This should be a small performance improvement. >+ >+ * UIProcess/mac/DisplayLink.cpp: >+ (WebKit::DisplayLink::DisplayLink): >+ (WebKit::DisplayLink::displayLinkCallback): >+ * UIProcess/mac/DisplayLink.h: >+ > 2018-06-07 Chris Dumez <cdumez@apple.com> > > Add base class to get WeakPtrFactory member and avoid some boilerplate code >Index: Source/WebKit/UIProcess/mac/DisplayLink.cpp >=================================================================== >--- Source/WebKit/UIProcess/mac/DisplayLink.cpp (revision 232619) >+++ Source/WebKit/UIProcess/mac/DisplayLink.cpp (working copy) >@@ -36,6 +36,8 @@ > namespace WebKit { > > DisplayLink::DisplayLink(WebCore::PlatformDisplayID displayID, WebPageProxy& webPageProxy) >+ : m_connection(webPageProxy.process().connection()) >+ , m_pageID(webPageProxy.pageID()) > { > ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer)); > CVReturn error = CVDisplayLinkCreateWithCGDisplay(displayID, &m_displayLink); >@@ -44,7 +46,7 @@ > return; > } > >- error = CVDisplayLinkSetOutputCallback(m_displayLink, displayLinkCallback, &webPageProxy); >+ error = CVDisplayLinkSetOutputCallback(m_displayLink, displayLinkCallback, this); > if (error) { > WTFLogAlways("Could not set the display link output callback: %d", error); > return; >@@ -97,11 +99,8 @@ > > CVReturn DisplayLink::displayLinkCallback(CVDisplayLinkRef displayLinkRef, const CVTimeStamp*, const CVTimeStamp*, CVOptionFlags, CVOptionFlags*, void* data) > { >- WebPageProxy* webPageProxy = reinterpret_cast<WebPageProxy*>(data); >- RunLoop::main().dispatch([weakPtr = makeWeakPtr(*webPageProxy)] { >- if (auto* proxy = weakPtr.get()) >- proxy->process().send(Messages::DrawingArea::DisplayWasRefreshed(), proxy->pageID()); >- }); >+ DisplayLink* displayLink = static_cast<DisplayLink*>(data); >+ displayLink->m_connection->send(Messages::DrawingArea::DisplayWasRefreshed(), displayLink->m_pageID); > return kCVReturnSuccess; > } > >Index: Source/WebKit/UIProcess/mac/DisplayLink.h >=================================================================== >--- Source/WebKit/UIProcess/mac/DisplayLink.h (revision 232619) >+++ Source/WebKit/UIProcess/mac/DisplayLink.h (working copy) >@@ -32,6 +32,10 @@ > #include <WebCore/PlatformScreen.h> > #include <wtf/HashSet.h> > >+namespace IPC { >+class Connection; >+} >+ > namespace WebKit { > > class WebPageProxy; >@@ -53,6 +57,8 @@ > > CVDisplayLinkRef m_displayLink { nullptr }; > HashSet<unsigned> m_observers; >+ RefPtr<IPC::Connection> m_connection; >+ uint64_t m_pageID { 0 }; > }; > > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186429
:
342258
|
342265
|
342274
|
342280
| 342284