Changeset 142792 in webkit


Ignore:
Timestamp:
Feb 13, 2013 1:49:23 PM (11 years ago)
Author:
andersca@apple.com
Message:

Remove Connection::QueueClient
https://bugs.webkit.org/show_bug.cgi?id=109744

Reviewed by Sam Weinig.

  • Platform/CoreIPC/Connection.cpp:

(CoreIPC::Connection::processIncomingMessage):
(CoreIPC::Connection::connectionDidClose):

  • Platform/CoreIPC/Connection.h:

(Connection):

Location:
trunk/Source/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r142784 r142792  
     12013-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
    1142013-02-13  Anders Carlsson  <andersca@apple.com>
    215
  • trunk/Source/WebKit2/Platform/CoreIPC/Connection.cpp

    r142696 r142792  
    255255}
    256256
    257 void Connection::addQueueClient(QueueClient* queueClient)
     257void Connection::addWorkQueueMessageReceiver(StringReference messageReceiverName, WorkQueue* workQueue, WorkQueueMessageReceiver* workQueueMessageReceiver)
    258258{
    259259    ASSERT(RunLoop::current() == m_clientRunLoop);
    260260    ASSERT(!m_isConnected);
    261261
    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 
    277262    m_connectionQueue->dispatch(bind(&Connection::addWorkQueueMessageReceiverOnConnectionWorkQueue, this, messageReceiverName, RefPtr<WorkQueue>(workQueue), RefPtr<WorkQueueMessageReceiver>(workQueueMessageReceiver)));
    278263}
     
    305290
    306291    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);
    320292}
    321293
     
    649621    }
    650622
    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 
    660623    enqueueIncomingMessage(message.release());
    661624}
     
    683646            iter->value->semaphore.signal();
    684647    }
    685 
    686     for (size_t i = 0; i < m_connectionQueueClients.size(); ++i)
    687         m_connectionQueueClients[i]->didCloseOnConnectionWorkQueue(this);
    688648
    689649    if (m_didCloseOnConnectionWorkQueueCallback)
  • trunk/Source/WebKit2/Platform/CoreIPC/Connection.h

    r142696 r142792  
    9696    };
    9797
    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 
    10798#if OS(DARWIN)
    10899    struct Identifier {
     
    172163    void removeWorkQueueMessageReceiver(StringReference messageReceiverName);
    173164
    174     void addQueueClient(QueueClient*);
    175     void removeQueueClient(QueueClient*);
    176 
    177165    bool open();
    178166    void invalidate();
     
    217205    void dispatchWorkQueueMessageReceiverMessage(WorkQueueMessageReceiver*, MessageDecoder*);
    218206
    219     void addQueueClientOnWorkQueue(QueueClient*);
    220     void removeQueueClientOnWorkQueue(QueueClient*);
    221    
    222207    bool canSendOutgoingMessages() const;
    223208    bool platformCanSendOutgoingMessages() const;
     
    248233    RefPtr<WorkQueue> m_connectionQueue;
    249234    WebCore::RunLoop* m_clientRunLoop;
    250 
    251     Vector<QueueClient*> m_connectionQueueClients;
    252235
    253236    HashMap<StringReference, std::pair<RefPtr<WorkQueue>, RefPtr<WorkQueueMessageReceiver> > > m_workQueueMessageReceivers;
Note: See TracChangeset for help on using the changeset viewer.