Changeset 84281 in webkit
- Timestamp:
- Apr 19, 2011 12:28:29 PM (13 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r84260 r84281 1 2011-04-19 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 Add a way to set the default sync message timeout for a CoreIPC connection 6 https://bugs.webkit.org/show_bug.cgi?id=58908 7 8 * Platform/CoreIPC/Connection.cpp: 9 (CoreIPC::Connection::Connection): 10 Initialize m_defaultSyncMessageTimeout. 11 12 (CoreIPC::Connection::setDefaultSyncMessageTimeout): 13 Set the m_defaultSyncMessageTimeout member variable. 14 15 (CoreIPC::Connection::waitForSyncReply): 16 Handle the timeout being one of our two special magic values. 17 18 * Platform/CoreIPC/Connection.h: 19 Add a DefaultTimeout constant and change the NoTimeout constant to be -1. 20 1 21 2011-04-19 Vsevolod Vlasov <vsevik@chromium.org> 2 22 -
trunk/Source/WebKit2/Platform/CoreIPC/Connection.cpp
r83498 r84281 205 205 , m_inDispatchMessageMarkedDispatchWhenWaitingForSyncReplyCount(0) 206 206 , m_didReceiveInvalidMessage(false) 207 , m_defaultSyncMessageTimeout(NoTimeout) 207 208 , m_syncMessageState(SyncMessageState::getOrCreate(clientRunLoop)) 208 209 , m_shouldWaitForSyncReplies(true) … … 253 254 254 255 m_didReceiveInvalidMessage = true; 256 } 257 258 void Connection::setDefaultSyncMessageTimeout(double defaultSyncMessageTimeout) 259 { 260 ASSERT(defaultSyncMessageTimeout != DefaultTimeout); 261 262 m_defaultSyncMessageTimeout = defaultSyncMessageTimeout; 255 263 } 256 264 … … 388 396 PassOwnPtr<ArgumentDecoder> Connection::waitForSyncReply(uint64_t syncRequestID, double timeout) 389 397 { 398 if (timeout == DefaultTimeout) 399 timeout = m_defaultSyncMessageTimeout; 400 401 // Use a really long timeout. 402 if (timeout == NoTimeout) 403 timeout = 1e10; 404 390 405 double absoluteTime = currentTime() + timeout; 391 406 -
trunk/Source/WebKit2/Platform/CoreIPC/Connection.h
r83498 r84281 134 134 void markCurrentlyDispatchedMessageAsInvalid(); 135 135 136 static const unsigned long long NoTimeout = 10000000000ULL; 136 void setDefaultSyncMessageTimeout(double); 137 138 static const int DefaultTimeout = 0; 139 static const int NoTimeout = -1; 137 140 138 141 template<typename T> bool send(const T& message, uint64_t destinationID, unsigned messageSendFlags = 0); 139 template<typename T> bool sendSync(const T& message, const typename T::Reply& reply, uint64_t destinationID, double timeout = NoTimeout);142 template<typename T> bool sendSync(const T& message, const typename T::Reply& reply, uint64_t destinationID, double timeout = DefaultTimeout); 140 143 template<typename T> bool waitForAndDispatchImmediately(uint64_t destinationID, double timeout); 141 144 … … 232 235 unsigned m_inDispatchMessageMarkedDispatchWhenWaitingForSyncReplyCount; 233 236 bool m_didReceiveInvalidMessage; 237 238 double m_defaultSyncMessageTimeout; 234 239 235 240 // Incoming messages.
Note: See TracChangeset
for help on using the changeset viewer.