WebKit Bugzilla
Attachment 360513 Details for
Bug 193992
: <rdar://problem/29471922> Safari should switch from the legacy denap SPI to handling vouchers
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193992-20190129153559.patch (text/plain), 3.87 KB, created by
Benjamin Poulain
on 2019-01-29 15:36:00 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Benjamin Poulain
Created:
2019-01-29 15:36:00 PST
Size:
3.87 KB
patch
obsolete
>Subversion Revision: 240595 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 4ab33d8124bb3b31afe31ff8bc80f32aa6af0dae..cd73bfddfdad99235bffdd389a3e39071cabfcbc 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,19 @@ >+2019-01-29 Daniel Steffen <dsteffen@apple.com> >+ >+ <rdar://problem/29471922> Safari should switch from the legacy denap SPI to handling vouchers >+ https://bugs.webkit.org/show_bug.cgi?id=193992 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ The denap SPI is deprecated. >+ The new way of staying out of AppNap is through a voucher. >+ >+ * Platform/IPC/mac/ConnectionMac.mm: >+ (IPC::readFromMachPort): >+ * Platform/IPC/mac/ImportanceAssertion.h: >+ (IPC::ImportanceAssertion::ImportanceAssertion): >+ (IPC::ImportanceAssertion::~ImportanceAssertion): >+ > 2019-01-28 Antoine Quint <graouts@apple.com> > > Limit user-agent interactions based on the touch-action property on iOS >diff --git a/Source/WebKit/Platform/IPC/mac/ConnectionMac.mm b/Source/WebKit/Platform/IPC/mac/ConnectionMac.mm >index 50416b84114ab930eb4e628a3951417825a89e12..b98ac560307b21f422d3d47f368e6b61c36ba0dd 100644 >--- a/Source/WebKit/Platform/IPC/mac/ConnectionMac.mm >+++ b/Source/WebKit/Platform/IPC/mac/ConnectionMac.mm >@@ -476,7 +476,7 @@ static mach_msg_header_t* readFromMachPort(mach_port_t machPort, ReceiveBuffer& > buffer.resize(receiveBufferSize); > > mach_msg_header_t* header = reinterpret_cast<mach_msg_header_t*>(buffer.data()); >- kern_return_t kr = mach_msg(header, MACH_RCV_MSG | MACH_RCV_LARGE | MACH_RCV_TIMEOUT, 0, buffer.size(), machPort, 0, MACH_PORT_NULL); >+ kern_return_t kr = mach_msg(header, MACH_RCV_MSG | MACH_RCV_LARGE | MACH_RCV_TIMEOUT | MACH_RCV_VOUCHER, 0, buffer.size(), machPort, 0, MACH_PORT_NULL); > if (kr == MACH_RCV_TIMED_OUT) > return nullptr; > >@@ -485,7 +485,7 @@ static mach_msg_header_t* readFromMachPort(mach_port_t machPort, ReceiveBuffer& > buffer.resize(header->msgh_size + MAX_TRAILER_SIZE); > header = reinterpret_cast<mach_msg_header_t*>(buffer.data()); > >- kr = mach_msg(header, MACH_RCV_MSG | MACH_RCV_LARGE | MACH_RCV_TIMEOUT, 0, buffer.size(), machPort, 0, MACH_PORT_NULL); >+ kr = mach_msg(header, MACH_RCV_MSG | MACH_RCV_LARGE | MACH_RCV_TIMEOUT | MACH_RCV_VOUCHER, 0, buffer.size(), machPort, 0, MACH_PORT_NULL); > ASSERT(kr != MACH_RCV_TOO_LARGE); > } > >diff --git a/Source/WebKit/Platform/IPC/mac/ImportanceAssertion.h b/Source/WebKit/Platform/IPC/mac/ImportanceAssertion.h >index f7687a7b789edf16136bdd181d75454ed79c8b52..d9765d1854c5508dca69760c40619df1e7a40a29 100644 >--- a/Source/WebKit/Platform/IPC/mac/ImportanceAssertion.h >+++ b/Source/WebKit/Platform/IPC/mac/ImportanceAssertion.h >@@ -28,12 +28,7 @@ > > #if PLATFORM(MAC) > >-#if USE(APPLE_INTERNAL_SDK) >-#include <libproc_internal.h> >-#endif >- >-extern "C" int proc_denap_assertion_begin_with_msg(mach_msg_header_t*, uint64_t *); >-extern "C" int proc_denap_assertion_complete(uint64_t); >+#include <mach/message.h> > > namespace IPC { > >@@ -42,18 +37,25 @@ class ImportanceAssertion { > > public: > explicit ImportanceAssertion(mach_msg_header_t* header) >- : m_assertion(0) >+ : m_voucher(0) > { >- proc_denap_assertion_begin_with_msg(header, &m_assertion); >+ if (MACH_MSGH_BITS_HAS_VOUCHER(header->msgh_bits)) { >+ m_voucher = header->msgh_voucher_port; >+ header->msgh_voucher_port = MACH_VOUCHER_NULL; >+ header->msgh_bits &= ~(MACH_MSGH_BITS_VOUCHER_MASK | MACH_MSGH_BITS_RAISEIMP); >+ } > } > > ~ImportanceAssertion() > { >- proc_denap_assertion_complete(m_assertion); >+ if (m_voucher) { >+ kern_return_t kr = mach_voucher_deallocate(m_voucher); >+ ASSERT_UNUSED(kr, !kr); >+ } > } > > private: >- uint64_t m_assertion; >+ mach_voucher_t m_voucher; > }; > > }
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 193992
:
360513
|
360646