Changeset 206410 in webkit
- Timestamp:
- Sep 26, 2016 8:35:01 PM (8 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r206397 r206410 1 2016-09-26 Dan Bernstein <mitz@apple.com> 2 3 -_webViewWebProcessDidBecomeUnresponsive: gets called when the Web process is stopped in the debugger 4 https://bugs.webkit.org/show_bug.cgi?id=162234 5 6 Reviewed by Sam Weinig. 7 8 * UIProcess/Cocoa/WebProcessProxyCocoa.mm: 9 (WebKit::WebProcessProxy::platformIsBeingDebugged): Use the KERN_PROC sysctl to get the 10 process flags and check for P_TRACED. 11 12 * UIProcess/ResponsivenessTimer.cpp: 13 (WebKit::ResponsivenessTimer::timerFired): Call the new client function 14 mayBecomeUnresponsive. If it returns false, restart the timer and bail out without 15 changing the responsiveness state. 16 17 * UIProcess/ResponsivenessTimer.h: Declared new client function mayBecomeUnresponsive. 18 19 * UIProcess/WebProcessProxy.cpp: 20 (WebKit::WebProcessProxy::platformIsBeingDebugged): A generic implementation that always 21 returns false. 22 (WebKit::WebProcessProxy::mayBecomeUnresponsive): Implement this new 23 ResponsivenessTimer::Client function to return true unless the process is being debugged. 24 * UIProcess/WebProcessProxy.h: 25 1 26 2016-09-26 Chris Dumez <cdumez@apple.com> 2 27 -
trunk/Source/WebKit2/UIProcess/Cocoa/WebProcessProxyCocoa.mm
r203003 r206410 31 31 #import "WKBrowsingContextHandleInternal.h" 32 32 #import "WKTypeRefWrapper.h" 33 #import <sys/sysctl.h> 33 34 #import <wtf/NeverDestroyed.h> 34 35 … … 121 122 } 122 123 124 bool WebProcessProxy::platformIsBeingDebugged() const 125 { 126 struct kinfo_proc info; 127 int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, processIdentifier() }; 128 size_t size = sizeof(info); 129 if (sysctl(mib, WTF_ARRAY_LENGTH(mib), &info, &size, nullptr, 0) == -1) 130 return false; 131 132 return info.kp_proc.p_flag & P_TRACED; 123 133 } 134 135 } -
trunk/Source/WebKit2/UIProcess/ResponsivenessTimer.cpp
r202611 r206410 53 53 return; 54 54 55 if (!m_client.mayBecomeUnresponsive()) { 56 m_timer.startOneShot(responsivenessTimeout); 57 return; 58 } 59 55 60 m_client.willChangeIsResponsive(); 56 61 m_isResponsive = false; -
trunk/Source/WebKit2/UIProcess/ResponsivenessTimer.h
r202611 r206410 41 41 virtual void willChangeIsResponsive() = 0; 42 42 virtual void didChangeIsResponsive() = 0; 43 44 virtual bool mayBecomeUnresponsive() = 0; 43 45 }; 44 46 -
trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp
r205462 r206410 473 473 } 474 474 475 #if !PLATFORM(COCOA) 476 bool WebProcessProxy::platformIsBeingDebugged() const 477 { 478 return false; 479 } 480 #endif 481 475 482 void WebProcessProxy::didReceiveMessage(IPC::Connection& connection, IPC::Decoder& decoder) 476 483 { … … 578 585 for (auto& page : pages) 579 586 page->didChangeProcessIsResponsive(); 587 } 588 589 bool WebProcessProxy::mayBecomeUnresponsive() 590 { 591 return !platformIsBeingDebugged(); 580 592 } 581 593 -
trunk/Source/WebKit2/UIProcess/WebProcessProxy.h
r205213 r206410 187 187 void releaseRemainingIconsForPageURLs(); 188 188 189 bool platformIsBeingDebugged() const; 190 189 191 static const HashSet<String>& platformPathsWithAssumedReadAccess(); 190 192 … … 201 203 void willChangeIsResponsive() override; 202 204 void didChangeIsResponsive() override; 205 bool mayBecomeUnresponsive() override; 203 206 204 207 // ProcessThrottlerClient
Note: See TracChangeset
for help on using the changeset viewer.