Changeset 70085 in webkit
- Timestamp:
- Oct 19, 2010 2:11:29 PM (14 years ago)
- Location:
- trunk/WebKit2
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit2/ChangeLog
r70067 r70085 1 2010-10-19 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Adam Roben. 4 5 Stop waiting for sync replies if the connection is closed 6 https://bugs.webkit.org/show_bug.cgi?id=47930 7 8 * Platform/CoreIPC/Connection.cpp: 9 (CoreIPC::Connection::Connection): 10 Initialize m_shouldWaitForSyncReplies to true. 11 12 (CoreIPC::Connection::sendSyncMessage): 13 Don't attempt to send a message if m_shouldWaitForSyncReplies is false. 14 15 (CoreIPC::Connection::waitForSyncReply): 16 Return if m_shouldWaitForSyncReplies was set to false. 17 18 (CoreIPC::Connection::connectionDidClose): 19 Set m_shouldWaitForSyncReplies to true and signal the semaphore. 20 21 * Platform/CoreIPC/Connection.h: 22 1 23 2010-10-19 Adam Roben <aroben@apple.com> 2 24 -
trunk/WebKit2/Platform/CoreIPC/Connection.cpp
r69584 r70085 52 52 , m_connectionQueue("com.apple.CoreIPC.ReceiveQueue") 53 53 , m_clientRunLoop(clientRunLoop) 54 , m_shouldWaitForSyncReplies(true) 54 55 { 55 56 ASSERT(m_client); … … 166 167 // Push the pending sync reply information on our stack. 167 168 { 168 MutexLocker locker(m_pendingSyncRepliesMutex); 169 MutexLocker locker(m_syncReplyStateMutex); 170 if (!m_shouldWaitForSyncReplies) 171 return 0; 172 169 173 m_pendingSyncReplies.append(PendingSyncReply(syncRequestID)); 170 174 } … … 178 182 // Finally, pop the pending sync reply information. 179 183 { 180 MutexLocker locker(m_ pendingSyncRepliesMutex);184 MutexLocker locker(m_syncReplyStateMutex); 181 185 ASSERT(m_pendingSyncReplies.last().syncRequestID == syncRequestID); 182 186 m_pendingSyncReplies.removeLast(); … … 193 197 while (!timedOut) { 194 198 { 195 MutexLocker locker(m_ pendingSyncRepliesMutex);199 MutexLocker locker(m_syncReplyStateMutex); 196 200 197 201 // First, check if there is a sync reply at the top of the stack. … … 201 205 ASSERT(pendingSyncReply.syncRequestID == syncRequestID); 202 206 203 // We found the sync reply, return it.204 if (pendingSyncReply.didReceiveReply )207 // We found the sync reply, or the connection was closed. 208 if (pendingSyncReply.didReceiveReply || !m_shouldWaitForSyncReplies) 205 209 return pendingSyncReply.releaseReplyDecoder(); 206 210 } … … 218 222 // Check if this is a sync reply. 219 223 if (messageID == MessageID(CoreIPCMessage::SyncMessageReply)) { 220 MutexLocker locker(m_ pendingSyncRepliesMutex);224 MutexLocker locker(m_syncReplyStateMutex); 221 225 ASSERT(!m_pendingSyncReplies.isEmpty()); 222 226 … … 254 258 // The connection is now invalid. 255 259 platformInvalidate(); 256 260 261 { 262 MutexLocker locker(m_syncReplyStateMutex); 263 264 ASSERT(m_shouldWaitForSyncReplies); 265 m_shouldWaitForSyncReplies = false; 266 267 if (!m_pendingSyncReplies.isEmpty()) 268 m_waitForSyncReplySemaphore.signal(); 269 } 270 257 271 m_clientRunLoop->scheduleWork(WorkItem::create(this, &Connection::dispatchConnectionDidClose)); 258 272 } -
trunk/WebKit2/Platform/CoreIPC/Connection.h
r69584 r70085 229 229 BinarySemaphore m_waitForSyncReplySemaphore; 230 230 231 Mutex m_pendingSyncRepliesMutex; 231 Mutex m_syncReplyStateMutex; 232 bool m_shouldWaitForSyncReplies; 232 233 Vector<PendingSyncReply> m_pendingSyncReplies; 233 234
Note: See TracChangeset
for help on using the changeset viewer.