Changeset 295707 in webkit
- Timestamp:
- Jun 21, 2022 6:05:31 PM (2 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/Platform/IPC/cocoa/ConnectionCocoa.mm
r295666 r295707 189 189 } 190 190 191 static void requestNoSenderNotifications(mach_port_t port, mach_port_t notify) 192 { 193 mach_port_t previousNotificationPort = MACH_PORT_NULL; 194 auto kr = mach_port_request_notification(mach_task_self(), port, MACH_NOTIFY_NO_SENDERS, 0, notify, MACH_MSG_TYPE_MAKE_SEND_ONCE, &previousNotificationPort); 195 ASSERT(kr == KERN_SUCCESS); 196 if (kr != KERN_SUCCESS) { 197 // If mach_port_request_notification fails, 'previousNotificationPort' will be uninitialized. 198 LOG_ERROR("mach_port_request_notification failed: (%x) %s", kr, mach_error_string(kr)); 199 } else 200 deallocateSendRightSafely(previousNotificationPort); 201 } 202 203 static void requestNoSenderNotifications(mach_port_t port) 204 { 205 requestNoSenderNotifications(port, port); 206 } 207 208 static void clearNoSenderNotifications(mach_port_t port) 209 { 210 requestNoSenderNotifications(port, MACH_PORT_NULL); 211 } 212 191 213 bool Connection::open() 192 214 { … … 240 262 mach_port_mod_refs(mach_task_self(), receivePort, MACH_PORT_RIGHT_RECEIVE, -1); 241 263 }); 264 // Disconnections are normally handled by DISPATCH_MACH_SEND_DEAD on the m_sendSource, but that's not 265 // initialized until we receive the connection message from the client, so we need to request MACH_NOTIFY_NO_SENDERS 266 // on the receiving port until then. 267 if (m_isServer) 268 requestNoSenderNotifications(m_receivePort); 242 269 243 270 m_connectionQueue->dispatch([strongRef = Ref { *this }, this] { … … 584 611 if (m_sendPort) { 585 612 ASSERT(MACH_PORT_VALID(m_receivePort)); 586 mach_port_t previousNotificationPort = MACH_PORT_NULL; 587 auto kr = mach_port_request_notification(mach_task_self(), m_receivePort, MACH_NOTIFY_NO_SENDERS, 0, MACH_PORT_NULL, MACH_MSG_TYPE_MOVE_SEND_ONCE, &previousNotificationPort); 588 ASSERT(kr == KERN_SUCCESS); 589 if (kr != KERN_SUCCESS) { 590 // If mach_port_request_notification fails, 'previousNotificationPort' will be uninitialized. 591 LOG_ERROR("mach_port_request_notification failed: (%x) %s", kr, mach_error_string(kr)); 592 previousNotificationPort = MACH_PORT_NULL; 593 } 594 595 if (previousNotificationPort != MACH_PORT_NULL) 596 deallocateSendRightSafely(previousNotificationPort); 613 clearNoSenderNotifications(m_receivePort); 597 614 598 615 initializeSendSource(); -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/GPUProcess.mm
r295433 r295707 116 116 } 117 117 118 // FIXME: Re-enable after webkit.org/b/240692 is resolved119 #if (PLATFORM(IOS))120 TEST(GPUProcess, DISABLED_WebProcessTerminationAfterTooManyGPUProcessCrashes)121 #else122 118 TEST(GPUProcess, WebProcessTerminationAfterTooManyGPUProcessCrashes) 123 #endif124 119 { 125 120 auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]); … … 161 156 while ((![processPool _gpuProcessIdentifier] || [processPool _gpuProcessIdentifier] == gpuProcessPID) && timeout++ < 100) 162 157 TestWebKitAPI::Util::sleep(0.1); 163 EXPECT_NE([processPool _gpuProcessIdentifier], 0);164 EXPECT_NE([processPool _gpuProcessIdentifier], gpuProcessPID);158 ASSERT_NE([processPool _gpuProcessIdentifier], 0); 159 ASSERT_NE([processPool _gpuProcessIdentifier], gpuProcessPID); 165 160 gpuProcessPID = [processPool _gpuProcessIdentifier]; 166 161 … … 175 170 while ((![processPool _gpuProcessIdentifier] || [processPool _gpuProcessIdentifier] == gpuProcessPID) && timeout++ < 100) 176 171 TestWebKitAPI::Util::sleep(0.1); 177 EXPECT_NE([processPool _gpuProcessIdentifier], 0);178 EXPECT_NE([processPool _gpuProcessIdentifier], gpuProcessPID);172 ASSERT_NE([processPool _gpuProcessIdentifier], 0); 173 ASSERT_NE([processPool _gpuProcessIdentifier], gpuProcessPID); 179 174 gpuProcessPID = [processPool _gpuProcessIdentifier]; 180 175
Note: See TracChangeset
for help on using the changeset viewer.