Changeset 70702 in webkit


Ignore:
Timestamp:
Oct 27, 2010 1:38:36 PM (14 years ago)
Author:
jberlin@webkit.org
Message:

Fix the WebKit2 API tests.
https://bugs.webkit.org/show_bug.cgi?id=48461

Reviewed by Sam Weinig.

The API tests were failing because the tests expect to be able to send messages before the
WebProcess finishes launching.

Instead of dispatching the pending messages in processDidFinishLaunching, dispatch them in
ensureWebProcess but do not make messages pending if the process is launching.

  • UIProcess/WebContext.cpp:

(WebKit::WebContext::processDidFinishLaunching):
Move dispatching the pending messages back from here ...
(WebKit::WebContext::ensureWebProcess):
... to here.
(WebKit::WebContext::postMessageToInjectedBundle):
Check whether the process can send messages in order to determine if a message needs to be
sent later.

  • UIProcess/WebProcessProxy.h:

(WebKit::WebProcessProxy::canSendMessage):
The WebProcessProxy can send a message if it is valid or if it is launching.

Location:
trunk/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit2/ChangeLog

    r70696 r70702  
     12010-10-27  Jessie Berlin  <jberlin@apple.com>
     2
     3        Reviewed by Sam Weinig.
     4
     5        Fix the WebKit2 API tests.
     6        https://bugs.webkit.org/show_bug.cgi?id=48461
     7
     8        The API tests were failing because the tests expect to be able to send messages before the
     9        WebProcess finishes launching.
     10
     11        Instead of dispatching the pending messages in processDidFinishLaunching, dispatch them in
     12        ensureWebProcess but do not make messages pending if the process is launching.
     13
     14        * UIProcess/WebContext.cpp:
     15        (WebKit::WebContext::processDidFinishLaunching):
     16        Move dispatching the pending messages back from here ...
     17        (WebKit::WebContext::ensureWebProcess):
     18        ... to here.
     19        (WebKit::WebContext::postMessageToInjectedBundle):
     20        Check whether the process can send messages in order to determine if a message needs to be
     21        sent later.
     22
     23        * UIProcess/WebProcessProxy.h:
     24        (WebKit::WebProcessProxy::canSendMessage):
     25        The WebProcessProxy can send a message if it is valid or if it is launching.
     26
    1272010-10-27  Anders Carlsson  <andersca@apple.com>
    228
  • trunk/WebKit2/UIProcess/WebContext.cpp

    r70585 r70702  
    179179
    180180    m_process->send(Messages::WebProcess::InitializeWebProcess(parameters), 0);
    181 }
    182 
    183 void WebContext::processDidFinishLaunching(WebProcessProxy* process)
    184 {
    185     // FIXME: Once we support multiple processes per context, this assertion won't hold.
    186     ASSERT(process == m_process);
    187 
    188     m_visitedLinkProvider.populateVisitedLinksIfNeeded();
    189181
    190182    for (size_t i = 0; i != m_pendingMessagesToPostToInjectedBundle.size(); ++i) {
     
    195187}
    196188
     189void WebContext::processDidFinishLaunching(WebProcessProxy* process)
     190{
     191    // FIXME: Once we support multiple processes per context, this assertion won't hold.
     192    ASSERT(process == m_process);
     193
     194    m_visitedLinkProvider.populateVisitedLinksIfNeeded();
     195}
     196
    197197void WebContext::processDidClose(WebProcessProxy* process)
    198198{
     
    261261void WebContext::postMessageToInjectedBundle(const String& messageName, APIObject* messageBody)
    262262{
    263     if (!hasValidProcess()) {
     263    if (!m_process || !m_process->canSendMessage()) {
    264264        m_pendingMessagesToPostToInjectedBundle.append(make_pair(messageName, messageBody));
    265265        return;
  • trunk/WebKit2/UIProcess/WebProcessProxy.h

    r69037 r70702  
    9191    bool isValid() const { return m_connection; }
    9292    bool isLaunching() const;
     93    bool canSendMessage() const { return isValid() || isLaunching(); }
    9394
    9495    WebFrameProxy* webFrame(uint64_t) const;
Note: See TracChangeset for help on using the changeset viewer.