2011-02-07 Anders Carlsson <andersca@apple.com>
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Feb 2011 01:44:49 +0000 (01:44 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Feb 2011 01:44:49 +0000 (01:44 +0000)
commit40c3ea2e7ce88b36c9f4e7a66e154da27d69356a
tree498b560b33b3e7f4066f7a1ce9264c79cf930942
parentd43e2e9851ed4308a5e18f1c09a670913280fddc
2011-02-07  Anders Carlsson  <andersca@apple.com>

        Reviewed by Sam Weinig.

        Crash in web process after the connection had been closed
        https://bugs.webkit.org/show_bug.cgi?id=51115
        <rdar://problem/8964255>

        Remove didCloseOnConnectionWorkQueue from Connection::Client and add
        Connection::setDidCloseOnConnectionWorkQueueCallback which takes a static
        function, eliminating the race condition in connectionDidClose where m_client could be
        nulled out in the client thread right before we try to dereference it.

        * Platform/CoreIPC/Connection.cpp:
        (CoreIPC::Connection::Connection):
        Initialize m_didCloseOnConnectionWorkQueueCallback.

        (CoreIPC::Connection::setDidCloseOnConnectionWorkQueueCallback):
        Update m_didCloseOnConnectionWorkQueueCallback.

        (CoreIPC::Connection::connectionDidClose):
        Call m_didCloseOnConnectionWorkQueueCallback.

        * Platform/WorkQueue.h:
        Make WorkQueue noncopyable.

        * PluginProcess/PluginProcess.cpp:
        (WebKit::PluginProcess::initializeConnection):
        Call setDidCloseOnConnectionWorkQueueCallback.

        * Shared/ChildProcess.cpp:
        (WebKit::ChildProcess::didCloseOnConnectionWorkQueue):
        * Shared/ChildProcess.h:
        didCloseOnConnectionWorkQueue is now a static member function.

        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::initialize):
        Call setDidCloseOnConnectionWorkQueueCallback.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@77874 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/Platform/CoreIPC/Connection.cpp
Source/WebKit2/Platform/CoreIPC/Connection.h
Source/WebKit2/Platform/WorkQueue.h
Source/WebKit2/PluginProcess/PluginProcess.cpp
Source/WebKit2/Shared/ChildProcess.cpp
Source/WebKit2/Shared/ChildProcess.h
Source/WebKit2/WebProcess/WebProcess.cpp