• jberlin@webkit.org's avatar
    Crash in WebDatabaseManagerProxy::getDatabaseOrigins when called after the WebProcess has · 2a7b7853
    jberlin@webkit.org authored
    died at least once
    Reviewed by Darin Adler.
    WebDatabaseManagerProxy::invalidate was setting m_webContext to 0, and invalidate gets
    called in WebContext::processDidClose. However, m_webContext is only set in the
    constructor, which is only called from the constructor of WebContext, so attempting to send
    a message to any new WebProcess after the first one died was causing a null deref.
    This patch moves setting m_webcontext into clearContext and clearContext is only called in
    the WebContext destructor.
    This patch also adds checks for a valid WebProcessProxy before attempting to send messages to
    the WebProcessProxy so that if the WebProcess has died and has not been revived, it does not
    attempt to dereference a null WebProcessProxy.
    * UIProcess/WebContext.cpp:
    Call WebDatabaseManagerProxy::clearContext.
    * UIProcess/WebContext.h:
    Make this method public so that it can be called from WebDatabaseManagerProxy.
    * UIProcess/WebDatabaseManagerProxy.cpp:
    If there isn't a valid process, invalidate the callback and return early.
    If tehre isn't a valid process return early.
    Move setting m_webContext to 0 from here ...
    * UIProcess/WebDatabaseManagerProxy.h:
    ... to here.
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76163 268f45cc-cd09-0410-ab3c-d52691b4dbfc