Changeset 169306 in webkit


Ignore:
Timestamp:
May 24, 2014 12:17:53 AM (10 years ago)
Author:
Carlos Garcia Campos
Message:

REGRESSION(r165841): Messages sent before the child process is launched are never sent after r165841
https://bugs.webkit.org/show_bug.cgi?id=131675

Reviewed by Anders Carlsson.

Since r165841 the connection is opened after the pending messages
are sent, because connectionWillOpen might send messages that we
want to happen after the ones already pending. The problem is that
Connection::canSendOutgoingMessages() returns false when
connection hasn't been opened. We should ensure no messages are
sent by connectionWillOpen.

  • Shared/ChildProcessProxy.cpp:

(WebKit::ChildProcessProxy::didFinishLaunching): Open the
connection before sending pending messages.

  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::connectionWillOpen): Do not call
VisitedLinkProvider::addProcess() here because it tries to send a
message to the web process, but the connection hasn't be opened yet.
(WebKit::WebPageProxy::processDidFinishLaunching): Call
VisitedLinkProvider::addProcess() here instead.

  • UIProcess/WebPageProxy.h:
  • UIProcess/WebProcessProxy.cpp:

(WebKit::WebProcessProxy::didFinishLaunching): Call
WebPageProxy::processDidFinishLaunching() for every web page.

Location:
trunk/Source/WebKit2
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r169304 r169306  
     12014-05-24  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        REGRESSION(r165841): Messages sent before the child process is launched are never sent after r165841
     4        https://bugs.webkit.org/show_bug.cgi?id=131675
     5
     6        Reviewed by Anders Carlsson.
     7
     8        Since r165841 the connection is opened after the pending messages
     9        are sent, because connectionWillOpen might send messages that we
     10        want to happen after the ones already pending. The problem is that
     11        Connection::canSendOutgoingMessages() returns false when
     12        connection hasn't been opened. We should ensure no messages are
     13        sent by connectionWillOpen.
     14
     15        * Shared/ChildProcessProxy.cpp:
     16        (WebKit::ChildProcessProxy::didFinishLaunching): Open the
     17        connection before sending pending messages.
     18        * UIProcess/WebPageProxy.cpp:
     19        (WebKit::WebPageProxy::connectionWillOpen): Do not call
     20        VisitedLinkProvider::addProcess() here because it tries to send a
     21        message to the web process, but the connection hasn't be opened yet.
     22        (WebKit::WebPageProxy::processDidFinishLaunching): Call
     23        VisitedLinkProvider::addProcess() here instead.
     24        * UIProcess/WebPageProxy.h:
     25        * UIProcess/WebProcessProxy.cpp:
     26        (WebKit::WebProcessProxy::didFinishLaunching): Call
     27        WebPageProxy::processDidFinishLaunching() for every web page.
     28
    1292014-05-23  Ian Henderson  <ianh@apple.com>
    230
  • trunk/Source/WebKit2/Shared/ChildProcessProxy.cpp

    r168595 r169306  
    139139#endif
    140140
     141    connectionWillOpen(m_connection.get());
     142    m_connection->open();
     143
    141144    for (size_t i = 0; i < m_pendingMessages.size(); ++i) {
    142145        std::unique_ptr<IPC::MessageEncoder> message = std::move(m_pendingMessages[i].first);
     
    144147        m_connection->sendMessage(std::move(message), messageSendFlags);
    145148    }
    146 
    147     connectionWillOpen(m_connection.get());
    148     m_connection->open();
    149149
    150150    m_pendingMessages.clear();
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp

    r169295 r169306  
    29192919    ASSERT(connection == m_process->connection());
    29202920
     2921    m_process->context().storageManager().setAllowedSessionStorageNamespaceConnection(m_pageID, connection);
     2922}
     2923
     2924void WebPageProxy::connectionWillClose(IPC::Connection* connection)
     2925{
     2926    ASSERT_UNUSED(connection, connection == m_process->connection());
     2927
     2928    m_process->context().storageManager().setAllowedSessionStorageNamespaceConnection(m_pageID, 0);
     2929}
     2930
     2931void WebPageProxy::processDidFinishLaunching()
     2932{
    29212933    if (m_userContentController)
    29222934        m_userContentController->addProcess(m_process.get());
    29232935    m_visitedLinkProvider->addProcess(m_process.get());
    2924 
    2925     m_process->context().storageManager().setAllowedSessionStorageNamespaceConnection(m_pageID, connection);
    2926 }
    2927 
    2928 void WebPageProxy::connectionWillClose(IPC::Connection* connection)
    2929 {
    2930     ASSERT_UNUSED(connection, connection == m_process->connection());
    2931 
    2932     m_process->context().storageManager().setAllowedSessionStorageNamespaceConnection(m_pageID, 0);
    29332936}
    29342937
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.h

    r169294 r169306  
    10751075    void connectionWillClose(IPC::Connection*);
    10761076
     1077    void processDidFinishLaunching();
     1078
    10771079    void didSaveToPageCache();
    10781080       
  • trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp

    r168312 r169306  
    455455    ChildProcessProxy::didFinishLaunching(launcher, connectionIdentifier);
    456456
     457    for (auto& page : m_pageMap.values())
     458        page->processDidFinishLaunching();
     459
    457460    m_webConnection = WebConnectionToWebProcess::create(this);
    458461
Note: See TracChangeset for help on using the changeset viewer.