Changeset 84288 in webkit
- Timestamp:
- Apr 19, 2011 1:47:21 PM (13 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r84281 r84288 1 2011-04-19 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Alexey Proskuryakov. 4 5 Replace the didFailToSendSyncMessage Connection::Client function with a flag 6 https://bugs.webkit.org/show_bug.cgi?id=58923 7 8 * Platform/CoreIPC/Connection.cpp: 9 (CoreIPC::Connection::Connection): 10 Initialize m_shouldExitOnSyncMessageSendFailure to false. 11 12 (CoreIPC::Connection::setShouldExitOnSyncMessageSendFailure): 13 Set m_didCloseOnConnectionWorkQueueCallback. 14 15 (CoreIPC::Connection::sendSyncMessage): 16 Call didFailToSendSyncMessage if we fail to send the sync message for some reason. 17 18 (CoreIPC::Connection::didFailToSendSyncMessage): 19 if m_shouldExitOnSyncMessageSendFailure is true, exit. 20 21 * Platform/CoreIPC/Connection.h: 22 Remove didFailToSendSyncMessage from Connection::Client. 23 24 * PluginProcess/PluginProcess.cpp: 25 * PluginProcess/PluginProcess.h: 26 Remove didFailToSendSyncMessage. 27 28 * WebProcess/WebProcess.cpp: 29 (WebKit::WebProcess::initialize): 30 * WebProcess/WebProcess.h: 31 Remove didFailToSendSyncMessage. Call setShouldExitOnSyncMessageSendFailure on our 32 UI process connection. 33 1 34 2011-04-19 Anders Carlsson <andersca@apple.com> 2 35 -
trunk/Source/WebKit2/Platform/CoreIPC/Connection.cpp
r84281 r84288 198 198 , m_syncRequestID(0) 199 199 , m_onlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage(false) 200 , m_shouldExitOnSyncMessageSendFailure(false) 200 201 , m_didCloseOnConnectionWorkQueueCallback(0) 201 202 , m_isConnected(false) … … 228 229 } 229 230 231 void Connection::setShouldExitOnSyncMessageSendFailure(bool shouldExitOnSyncMessageSendFailure) 232 { 233 ASSERT(!m_isConnected); 234 235 m_shouldExitOnSyncMessageSendFailure = shouldExitOnSyncMessageSendFailure; 236 } 237 230 238 void Connection::setDidCloseOnConnectionWorkQueueCallback(DidCloseOnConnectionWorkQueueCallback callback) 231 239 { … … 359 367 ASSERT(RunLoop::current() == m_clientRunLoop); 360 368 361 if (!isValid()) 369 if (!isValid()) { 370 didFailToSendSyncMessage(); 362 371 return 0; 363 372 } 373 364 374 // Push the pending sync reply information on our stack. 365 375 { 366 376 MutexLocker locker(m_syncReplyStateMutex); 367 377 if (!m_shouldWaitForSyncReplies) { 368 m_client->didFailToSendSyncMessage(this);378 didFailToSendSyncMessage(); 369 379 return 0; 370 380 } … … 388 398 } 389 399 390 if (!reply && m_client)391 m_client->didFailToSendSyncMessage(this);400 if (!reply) 401 didFailToSendSyncMessage(); 392 402 393 403 return reply.release(); … … 593 603 } 594 604 605 void Connection::didFailToSendSyncMessage() 606 { 607 if (!m_shouldExitOnSyncMessageSendFailure) 608 return; 609 610 exit(0); 611 } 612 595 613 void Connection::enqueueIncomingMessage(IncomingMessage& incomingMessage) 596 614 { -
trunk/Source/WebKit2/Platform/CoreIPC/Connection.h
r84281 r84288 94 94 virtual void didClose(Connection*) = 0; 95 95 virtual void didReceiveInvalidMessage(Connection*, MessageID) = 0; 96 virtual void didFailToSendSyncMessage(Connection*) { }97 96 98 97 #if PLATFORM(WIN) … … 121 120 122 121 void setOnlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage(bool); 122 void setShouldExitOnSyncMessageSendFailure(bool shouldExitOnSyncMessageSendFailure); 123 123 124 124 // The set callback will be called on the connection work queue when the connection is closed, … … 217 217 void dispatchMessages(); 218 218 void dispatchSyncMessage(MessageID, ArgumentDecoder*); 219 void didFailToSendSyncMessage(); 219 220 220 221 // Can be called on any thread. … … 226 227 227 228 bool m_onlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage; 229 bool m_shouldExitOnSyncMessageSendFailure; 228 230 DidCloseOnConnectionWorkQueueCallback m_didCloseOnConnectionWorkQueueCallback; 229 231 -
trunk/Source/WebKit2/PluginProcess/PluginProcess.cpp
r83842 r84288 125 125 } 126 126 127 NO_RETURN void PluginProcess::didFailToSendSyncMessage(CoreIPC::Connection*)128 {129 // We were making a synchronous call to a web process that doesn't exist any more.130 // Callers are unlikely to be prepared for an error like this, so it's best to exit immediately.131 exit(0);132 }133 134 127 void PluginProcess::initializePluginProcess(const PluginProcessCreationParameters& parameters) 135 128 { -
trunk/Source/WebKit2/PluginProcess/PluginProcess.h
r83767 r84288 72 72 virtual void didClose(CoreIPC::Connection*); 73 73 virtual void didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::MessageID); 74 virtual void didFailToSendSyncMessage(CoreIPC::Connection*);75 74 76 75 // Message handlers. -
trunk/Source/WebKit2/WebProcess/WebProcess.cpp
r84091 r84288 149 149 m_connection = CoreIPC::Connection::createClientConnection(serverIdentifier, this, runLoop); 150 150 m_connection->setDidCloseOnConnectionWorkQueueCallback(didCloseOnConnectionWorkQueue); 151 m_connection->setShouldExitOnSyncMessageSendFailure(true); 151 152 152 153 m_connection->open(); … … 666 667 } 667 668 668 NO_RETURN void WebProcess::didFailToSendSyncMessage(CoreIPC::Connection*)669 {670 // We were making a synchronous call to a UI process that doesn't exist any more.671 // Callers are unlikely to be prepared for an error like this, so it's best to exit immediately.672 exit(0);673 }674 675 669 WebFrame* WebProcess::webFrame(uint64_t frameID) const 676 670 { -
trunk/Source/WebKit2/WebProcess/WebProcess.h
r83774 r84288 173 173 void didClose(CoreIPC::Connection*); 174 174 void didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::MessageID); 175 NO_RETURN void didFailToSendSyncMessage(CoreIPC::Connection*);176 175 #if PLATFORM(WIN) 177 176 Vector<HWND> windowsToReceiveSentMessagesWhileWaitingForSyncReply();
Note: See TracChangeset
for help on using the changeset viewer.