Changeset 187129 in webkit
- Timestamp:
- Jul 21, 2015, 3:33:53 PM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 7 edited
-
WTF/ChangeLog (modified) (1 diff)
-
WTF/wtf/RefCounter.h (modified) (1 diff)
-
WebKit2/ChangeLog (modified) (1 diff)
-
WebKit2/UIProcess/WebProcessPool.cpp (modified) (3 diffs)
-
WebKit2/UIProcess/WebProcessPool.h (modified) (1 diff)
-
WebKit2/UIProcess/WebProcessProxy.cpp (modified) (2 diffs)
-
WebKit2/UIProcess/WebProcessProxy.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r187026 r187129 1 2015-07-21 Daniel Bates <dabates@apple.com> 2 3 WTFCrash() in WebKit::WebProcess::networkConnection() 4 https://bugs.webkit.org/show_bug.cgi?id=147112 5 <rdar://problem/18477459> 6 7 Reviewed by Gavin Barraclough. 8 9 Add explicit boolean conversion function and remove overload of operator! to support 10 checking whether an activity token is valid more directly than using the overloaded operator!. 11 12 * wtf/RefCounter.h: 13 (WTF::RefCounter::Token::operator bool): Added. 14 (WTF::RefCounter::Token::operator!): Deleted. 15 1 16 2015-07-20 Mark Lam <mark.lam@apple.com> 2 17 -
trunk/Source/WTF/wtf/RefCounter.h
r185273 r187129 68 68 inline Token<T>& operator=(Token<T>&&); 69 69 70 bool operator!() const { return !m_ptr; }70 explicit operator bool() const { return m_ptr; } 71 71 72 72 private: -
trunk/Source/WebKit2/ChangeLog
r187124 r187129 1 2015-07-21 Daniel Bates <dabates@apple.com> 2 3 WTFCrash() in WebKit::WebProcess::networkConnection() 4 https://bugs.webkit.org/show_bug.cgi?id=147112 5 <rdar://problem/18477459> 6 7 Reviewed by Gavin Barraclough. 8 9 Fixes an issue where a newly launched network process may be jetsam'd because it has not 10 taken a process assertion between the time it was launched and the time when a web process 11 makes use of it. 12 13 Initially a network process does not have a process assertion. A process assertion is taken 14 (if one has not been taken) for the network process when a process assertion is taken for at 15 least one web process. When the network process crashes a WebProcess may ultimately launch a 16 new network process in WebProcess::networkConnection(). The new network process may be jetsam'd 17 immediately when the system is under some measure pressure because it has a low jetsam priority, 18 0 (since it does not have a process assertion and higher priority implies that a process is less 19 likely to be jetsam'd). And the logic in WebProcess::networkConnection() explicitly calls 20 CRASH() if the newly launched network process crashes immediately. Towards preventing the newly 21 launched network process from being jetsam'd we should obtain a process assertion for it. 22 23 * UIProcess/WebProcessPool.cpp: 24 (WebKit::WebProcessPool::WebProcessPool): Initialize m_didNetworkProcessCrash to false. 25 (WebKit::WebProcessPool::ensureNetworkProcess): If the network process crashed (m_didNetworkProcessCrash == true) 26 then tell each process in the pool to reinstate their network activity token for the new network process. 27 (WebKit::WebProcessPool::networkProcessCrashed): Set m_didNetworkProcessCrash to true when the 28 network process crashed. 29 * UIProcess/WebProcessPool.h: 30 * UIProcess/WebProcessProxy.cpp: 31 (WebKit::WebProcessProxy::reinstateNetworkProcessAssertionState): Added. 32 (WebKit::WebProcessProxy::didSetAssertionState): Add assert to ensure we never have both 33 a background- and foreground- activity token for the network process. 34 * UIProcess/WebProcessProxy.h: 35 1 36 2015-07-21 Daniel Bates <dabates@apple.com> 2 37 -
trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp
r186059 r187129 161 161 #if ENABLE(NETWORK_PROCESS) 162 162 , m_canHandleHTTPSServerTrustEvaluation(true) 163 , m_didNetworkProcessCrash(false) 163 164 #endif 164 165 #if USE(SOUP) … … 420 421 #endif 421 422 423 if (m_didNetworkProcessCrash) { 424 m_didNetworkProcessCrash = false; 425 for (auto& process : m_processes) 426 process->reinstateNetworkProcessAssertionState(*m_networkProcess); 427 } 428 422 429 return *m_networkProcess; 423 430 } … … 427 434 ASSERT(m_networkProcess); 428 435 ASSERT(networkProcessProxy == m_networkProcess.get()); 436 m_didNetworkProcessCrash = true; 429 437 430 438 WebContextSupplementMap::const_iterator it = m_supplements.begin(); -
trunk/Source/WebKit2/UIProcess/WebProcessPool.h
r185736 r187129 499 499 #if ENABLE(NETWORK_PROCESS) 500 500 bool m_canHandleHTTPSServerTrustEvaluation; 501 bool m_didNetworkProcessCrash; 501 502 RefPtr<NetworkProcessProxy> m_networkProcess; 502 503 #endif -
trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp
r187023 r187129 926 926 } 927 927 928 #if ENABLE(NETWORK_PROCESS) 929 void WebProcessProxy::reinstateNetworkProcessAssertionState(NetworkProcessProxy& newNetworkProcessProxy) 930 { 931 ASSERT(!m_backgroundTokenForNetworkProcess || !m_foregroundTokenForNetworkProcess); 932 933 // The network process crashed; take new tokens for the new network process. 934 if (m_backgroundTokenForNetworkProcess) 935 m_backgroundTokenForNetworkProcess = newNetworkProcessProxy.throttler().backgroundActivityToken(); 936 else if (m_foregroundTokenForNetworkProcess) 937 m_foregroundTokenForNetworkProcess = newNetworkProcessProxy.throttler().foregroundActivityToken(); 938 } 939 #endif 940 928 941 void WebProcessProxy::didSetAssertionState(AssertionState state) 929 942 { 930 943 #if PLATFORM(IOS) && ENABLE(NETWORK_PROCESS) 944 ASSERT(!m_backgroundTokenForNetworkProcess || !m_foregroundTokenForNetworkProcess); 945 931 946 switch (state) { 932 947 case AssertionState::Suspended: … … 951 966 break; 952 967 } 968 969 ASSERT(!m_backgroundTokenForNetworkProcess || !m_foregroundTokenForNetworkProcess); 953 970 #else 954 971 UNUSED_PARAM(state); -
trunk/Source/WebKit2/UIProcess/WebProcessProxy.h
r184774 r187129 60 60 61 61 class DownloadProxyMap; 62 class NetworkProcessProxy; 62 63 class WebBackForwardListItem; 63 64 class WebPageGroup; … … 151 152 ProcessThrottler& throttler() { return m_throttler; } 152 153 154 #if ENABLE(NETWORK_PROCESS) 155 void reinstateNetworkProcessAssertionState(NetworkProcessProxy&); 156 #endif 157 153 158 private: 154 159 explicit WebProcessProxy(WebProcessPool&);
Note:
See TracChangeset
for help on using the changeset viewer.