Changeset 71044 in webkit


Ignore:
Timestamp:
Nov 1, 2010 12:16:45 PM (13 years ago)
Author:
andersca@apple.com
Message:

Tear down the related WebProcessProxy when a WebContext is deallocated
https://bugs.webkit.org/show_bug.cgi?id=48769

Reviewed by John Sullivan.

WebKit2:

  • UIProcess/WebContext.cpp:

(WebKit::WebContext::~WebContext):
Call WebProcessManager::contextWasDestroyed.

(WebKit::WebContext::didNavigateWithNavigationData):
(WebKit::WebContext::didPerformClientRedirect):
(WebKit::WebContext::didPerformServerRedirect):
(WebKit::WebContext::didUpdateHistoryTitle):
It is valid for a frame to have a null page here, if the frame has outlived
its page.

  • UIProcess/WebProcessManager.cpp:

(WebKit::WebProcessManager::contextWasDestroyed):
Remove the context from the map.

  • UIProcess/WebProcessProxy.cpp:

(WebKit::WebProcessProxy::~WebProcessProxy):
It's OK for the connection to be non-null here if the process goes away because
the context has been deallocated.

WebKitTools:

  • TestWebKitAPI/Tests/WebKit2/FailedLoad.cpp:

(TestWebKitAPI::didFailProvisionalLoadWithErrorForFrame):
We don't support empty URLs anymore, update test to expect a null URL instead.

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit2/ChangeLog

    r71042 r71044  
     12010-11-01  Anders Carlsson  <andersca@apple.com>
     2
     3        Reviewed by John Sullivan.
     4
     5        Tear down the related WebProcessProxy when a WebContext is deallocated
     6        https://bugs.webkit.org/show_bug.cgi?id=48769
     7
     8        * UIProcess/WebContext.cpp:
     9        (WebKit::WebContext::~WebContext):
     10        Call WebProcessManager::contextWasDestroyed.
     11
     12        (WebKit::WebContext::didNavigateWithNavigationData):
     13        (WebKit::WebContext::didPerformClientRedirect):
     14        (WebKit::WebContext::didPerformServerRedirect):
     15        (WebKit::WebContext::didUpdateHistoryTitle):
     16        It is valid for a frame to have a null page here, if the frame has outlived
     17        its page.
     18
     19        * UIProcess/WebProcessManager.cpp:
     20        (WebKit::WebProcessManager::contextWasDestroyed):
     21        Remove the context from the map.
     22
     23        * UIProcess/WebProcessProxy.cpp:
     24        (WebKit::WebProcessProxy::~WebProcessProxy):
     25        It's OK for the connection to be non-null here if the process goes away because
     26        the context has been deallocated.
     27
    1282010-11-01  Brady Eidson  <beidson@apple.com>
    229
  • trunk/WebKit2/UIProcess/WebContext.cpp

    r70997 r71044  
    106106    m_preferences->removeContext(this);
    107107    removeLanguageChangeObserver(this);
     108
     109    WebProcessManager::shared().contextWasDestroyed(this);
    108110   
    109111#ifndef NDEBUG
     
    287289void WebContext::didNavigateWithNavigationData(WebFrameProxy* frame, const WebNavigationDataStore& store)
    288290{
    289     ASSERT(frame->page());
     291    if (!frame->page())
     292        return;
     293   
    290294    m_historyClient.didNavigateWithNavigationData(this, frame->page(), store, frame);
    291295}
     
    293297void WebContext::didPerformClientRedirect(WebFrameProxy* frame, const String& sourceURLString, const String& destinationURLString)
    294298{
    295     ASSERT(frame->page());
     299    if (!frame->page())
     300        return;
     301   
    296302    m_historyClient.didPerformClientRedirect(this, frame->page(), sourceURLString, destinationURLString, frame);
    297303}
     
    299305void WebContext::didPerformServerRedirect(WebFrameProxy* frame, const String& sourceURLString, const String& destinationURLString)
    300306{
    301     ASSERT(frame->page());
     307    if (!frame->page())
     308        return;
     309   
    302310    m_historyClient.didPerformServerRedirect(this, frame->page(), sourceURLString, destinationURLString, frame);
    303311}
     
    305313void WebContext::didUpdateHistoryTitle(WebFrameProxy* frame, const String& title, const String& url)
    306314{
    307     ASSERT(frame->page());
     315    if (!frame->page())
     316        return;
     317
    308318    m_historyClient.didUpdateHistoryTitle(this, frame->page(), title, url, frame);
    309319}
  • trunk/WebKit2/UIProcess/WebProcessManager.cpp

    r61579 r71044  
    8888}
    8989
     90void WebProcessManager::contextWasDestroyed(WebContext* context)
     91{
     92    m_processMap.remove(context);
     93}
     94
    9095} // namespace WebKit
  • trunk/WebKit2/UIProcess/WebProcessManager.h

    r61500 r71044  
    4040    void processDidClose(WebProcessProxy*, WebContext*);
    4141
     42    void contextWasDestroyed(WebContext*);
     43
    4244private:
    4345    WebProcessManager();
  • trunk/WebKit2/UIProcess/WebProcessProxy.cpp

    r70915 r71044  
    6464WebProcessProxy::~WebProcessProxy()
    6565{
    66     ASSERT(!m_connection);
     66    ASSERT(m_pageMap.isEmpty());
     67
     68    if (m_connection)
     69        m_connection->invalidate();
    6770   
    6871    for (size_t i = 0; i < m_pendingMessages.size(); ++i)
  • trunk/WebKitTools/ChangeLog

    r71030 r71044  
     12010-11-01  Anders Carlsson  <andersca@apple.com>
     2
     3        Reviewed by John Sullivan.
     4
     5        Tear down the related WebProcessProxy when a WebContext is deallocated
     6        https://bugs.webkit.org/show_bug.cgi?id=48769
     7
     8        * TestWebKitAPI/Tests/WebKit2/FailedLoad.cpp:
     9        (TestWebKitAPI::didFailProvisionalLoadWithErrorForFrame):
     10        We don't support empty URLs anymore, update test to expect a null URL instead.
     11
    1122010-11-01  Søren Gjesse  <sgjesse@chromium.org>
    213
  • trunk/WebKitTools/TestWebKitAPI/Tests/WebKit2/FailedLoad.cpp

    r70062 r71044  
    4242
    4343    WKURLRef url = WKFrameCopyProvisionalURL(frame);
    44     WKURLRef emptyURL = WKURLCreateWithUTF8CString("");
    45     TEST_ASSERT(WKURLIsEqual(url, emptyURL));
    46     WKRelease(url);
    47     WKRelease(emptyURL);
     44    TEST_ASSERT(!url);
    4845
    4946    testDone = true;
Note: See TracChangeset for help on using the changeset viewer.