Use a separate queue for the connection watchdog callback in the web process
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Feb 2013 21:11:27 +0000 (21:11 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Feb 2013 21:11:27 +0000 (21:11 +0000)
https://bugs.webkit.org/show_bug.cgi?id=108844

Reviewed by Andreas Kling.

Don't pass the connection work queue to the didCloseOnConnectionWorkQueue callback.
Instead, create a new, temporary work queue where the exit call will be dispatched to.

* Platform/CoreIPC/Connection.cpp:
(CoreIPC::Connection::connectionDidClose):
* Platform/CoreIPC/Connection.h:
(Connection):
* Shared/ChildProcess.cpp:
(WebKit::didCloseOnConnectionWorkQueue):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@141796 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/Platform/CoreIPC/Connection.cpp
Source/WebKit2/Platform/CoreIPC/Connection.h
Source/WebKit2/Shared/ChildProcess.cpp

index 3f7d1d2d4a58363e71dd02b167c72ac220f181c4..aeb284424da9de78fb87090a54355dfc8b9b924a 100644 (file)
@@ -1,3 +1,20 @@
+2013-02-04  Anders Carlsson  <andersca@apple.com>
+
+        Use a separate queue for the connection watchdog callback in the web process
+        https://bugs.webkit.org/show_bug.cgi?id=108844
+
+        Reviewed by Andreas Kling.
+
+        Don't pass the connection work queue to the didCloseOnConnectionWorkQueue callback.
+        Instead, create a new, temporary work queue where the exit call will be dispatched to.
+
+        * Platform/CoreIPC/Connection.cpp:
+        (CoreIPC::Connection::connectionDidClose):
+        * Platform/CoreIPC/Connection.h:
+        (Connection):
+        * Shared/ChildProcess.cpp:
+        (WebKit::didCloseOnConnectionWorkQueue):
+
 2013-02-04  Tim Horton  <timothy_horton@apple.com>
 
         Allow TiledCoreAnimationDrawingArea overlay layers to become tiled
index b77375d615da44f0d4e2c3407018b127c02ba141..07b910706e60b4d4dbf16d760fb4bb9e41f02e29 100644 (file)
@@ -637,7 +637,7 @@ void Connection::connectionDidClose()
     }
 
     if (m_didCloseOnConnectionWorkQueueCallback)
-        m_didCloseOnConnectionWorkQueueCallback(m_connectionQueue.get(), this);
+        m_didCloseOnConnectionWorkQueueCallback(this);
 
     m_clientRunLoop->dispatch(WTF::bind(&Connection::dispatchConnectionDidClose, this));
 }
index aabb89acc3039d62203e2fa070d90f3127bd125a..6f65f6c77141f8fa4ca3a6cc20094191122b1cfe 100644 (file)
@@ -161,7 +161,7 @@ public:
     // In the future we might want a more generic way to handle sync or async messages directly
     // on the work queue, for example if we want to handle them on some other thread we could avoid
     // handling the message on the client thread first.
-    typedef void (*DidCloseOnConnectionWorkQueueCallback)(WorkQueue*, Connection*);
+    typedef void (*DidCloseOnConnectionWorkQueueCallback)(Connection*);
     void setDidCloseOnConnectionWorkQueueCallback(DidCloseOnConnectionWorkQueueCallback callback);
 
     void addQueueClient(QueueClient*);
index 4562144aafa7ef35918f8f6970190480e5cba246..e72a3739e5d0496224fe04443ac608c7d865e675 100644 (file)
@@ -55,13 +55,13 @@ NO_RETURN static void watchdogCallback()
     _exit(EXIT_FAILURE);
 }
 
-static void didCloseOnConnectionWorkQueue(WorkQueue* workQueue, CoreIPC::Connection*)
+static void didCloseOnConnectionWorkQueue(CoreIPC::Connection*)
 {
     // If the connection has been closed and we haven't responded in the main thread for 10 seconds
     // the process will exit forcibly.
     const double watchdogDelay = 10;
 
-    workQueue->dispatchAfterDelay(bind(static_cast<void(*)()>(watchdogCallback)), watchdogDelay);
+    WorkQueue::create("com.apple.WebKit.ChildProcess.WatchDogQueue")->dispatchAfterDelay(bind(static_cast<void(*)()>(watchdogCallback)), watchdogDelay);
 }
 
 void ChildProcess::initialize(const ChildProcessInitializationParameters& parameters)