Changeset 142792 in webkit
- Timestamp:
- Feb 13, 2013 1:49:23 PM (11 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r142784 r142792 1 2013-02-13 Anders Carlsson <andersca@apple.com> 2 3 Remove Connection::QueueClient 4 https://bugs.webkit.org/show_bug.cgi?id=109744 5 6 Reviewed by Sam Weinig. 7 8 * Platform/CoreIPC/Connection.cpp: 9 (CoreIPC::Connection::processIncomingMessage): 10 (CoreIPC::Connection::connectionDidClose): 11 * Platform/CoreIPC/Connection.h: 12 (Connection): 13 1 14 2013-02-13 Anders Carlsson <andersca@apple.com> 2 15 -
trunk/Source/WebKit2/Platform/CoreIPC/Connection.cpp
r142696 r142792 255 255 } 256 256 257 void Connection::add QueueClient(QueueClient* queueClient)257 void Connection::addWorkQueueMessageReceiver(StringReference messageReceiverName, WorkQueue* workQueue, WorkQueueMessageReceiver* workQueueMessageReceiver) 258 258 { 259 259 ASSERT(RunLoop::current() == m_clientRunLoop); 260 260 ASSERT(!m_isConnected); 261 261 262 m_connectionQueue->dispatch(WTF::bind(&Connection::addQueueClientOnWorkQueue, this, queueClient));263 }264 265 void Connection::removeQueueClient(QueueClient* queueClient)266 {267 ASSERT(RunLoop::current() == m_clientRunLoop);268 269 m_connectionQueue->dispatch(WTF::bind(&Connection::removeQueueClientOnWorkQueue, this, queueClient));270 }271 272 void Connection::addWorkQueueMessageReceiver(StringReference messageReceiverName, WorkQueue* workQueue, WorkQueueMessageReceiver* workQueueMessageReceiver)273 {274 ASSERT(RunLoop::current() == m_clientRunLoop);275 ASSERT(!m_isConnected);276 277 262 m_connectionQueue->dispatch(bind(&Connection::addWorkQueueMessageReceiverOnConnectionWorkQueue, this, messageReceiverName, RefPtr<WorkQueue>(workQueue), RefPtr<WorkQueueMessageReceiver>(workQueueMessageReceiver))); 278 263 } … … 305 290 306 291 workQueueMessageReceiver->didReceiveMessage(this, *decoder); 307 }308 309 void Connection::addQueueClientOnWorkQueue(QueueClient* queueClient)310 {311 ASSERT(!m_connectionQueueClients.contains(queueClient));312 m_connectionQueueClients.append(queueClient);313 }314 315 void Connection::removeQueueClientOnWorkQueue(QueueClient* queueClient)316 {317 size_t index = m_connectionQueueClients.find(queueClient);318 ASSERT(index != notFound);319 m_connectionQueueClients.remove(index);320 292 } 321 293 … … 649 621 } 650 622 651 // Hand off the message to the connection queue clients.652 for (size_t i = 0; i < m_connectionQueueClients.size(); ++i) {653 m_connectionQueueClients[i]->didReceiveMessageOnConnectionWorkQueue(this, message);654 if (!message) {655 // A connection queue client handled the message, our work here is done.656 return;657 }658 }659 660 623 enqueueIncomingMessage(message.release()); 661 624 } … … 683 646 iter->value->semaphore.signal(); 684 647 } 685 686 for (size_t i = 0; i < m_connectionQueueClients.size(); ++i)687 m_connectionQueueClients[i]->didCloseOnConnectionWorkQueue(this);688 648 689 649 if (m_didCloseOnConnectionWorkQueueCallback) -
trunk/Source/WebKit2/Platform/CoreIPC/Connection.h
r142696 r142792 96 96 }; 97 97 98 class QueueClient {99 public:100 virtual void didReceiveMessageOnConnectionWorkQueue(Connection*, OwnPtr<MessageDecoder>&) = 0;101 virtual void didCloseOnConnectionWorkQueue(Connection*) = 0;102 103 protected:104 virtual ~QueueClient() { }105 };106 107 98 #if OS(DARWIN) 108 99 struct Identifier { … … 172 163 void removeWorkQueueMessageReceiver(StringReference messageReceiverName); 173 164 174 void addQueueClient(QueueClient*);175 void removeQueueClient(QueueClient*);176 177 165 bool open(); 178 166 void invalidate(); … … 217 205 void dispatchWorkQueueMessageReceiverMessage(WorkQueueMessageReceiver*, MessageDecoder*); 218 206 219 void addQueueClientOnWorkQueue(QueueClient*);220 void removeQueueClientOnWorkQueue(QueueClient*);221 222 207 bool canSendOutgoingMessages() const; 223 208 bool platformCanSendOutgoingMessages() const; … … 248 233 RefPtr<WorkQueue> m_connectionQueue; 249 234 WebCore::RunLoop* m_clientRunLoop; 250 251 Vector<QueueClient*> m_connectionQueueClients;252 235 253 236 HashMap<StringReference, std::pair<RefPtr<WorkQueue>, RefPtr<WorkQueueMessageReceiver> > > m_workQueueMessageReceivers;
Note: See TracChangeset
for help on using the changeset viewer.