WorkQueue should be a ref-counted class
https://bugs.webkit.org/show_bug.cgi?id=108544

Reviewed by Sam Weinig.

Make WorkQueue a ref-counted class that's implicitly ref()'d when dispatching a function to it, and then
implicitly deref()'d when the function is done executing. This matches the behavior of dispatch queues,
and ensures that the WorkQueue object won't go away while dispatched functions are running.

* Platform/CoreIPC/Connection.cpp:
(CoreIPC::Connection::Connection):
(CoreIPC::Connection::~Connection):
(CoreIPC::Connection::addQueueClient):
(CoreIPC::Connection::removeQueueClient):
(CoreIPC::Connection::invalidate):
(CoreIPC::Connection::sendMessage):
(CoreIPC::Connection::postConnectionDidCloseOnConnectionWorkQueue):
(CoreIPC::Connection::connectionDidClose):
* Platform/CoreIPC/Connection.h:
(Connection):
* Platform/CoreIPC/mac/ConnectionMac.cpp:
(CoreIPC::createDataAvailableSource):
(CoreIPC::Connection::open):
(CoreIPC::Connection::initializeDeadNameSource):
* Platform/WorkQueue.cpp:
(WorkQueue::create):
(WorkQueue::WorkQueue):
(WorkQueue::~WorkQueue):
* Platform/WorkQueue.h:
(WorkQueue):
* Platform/mac/WorkQueueMac.cpp:
(WorkQueue::dispatch):
(WorkQueue::dispatchAfterDelay):
* Shared/ChildProcess.cpp:
(WebKit::didCloseOnConnectionWorkQueue):
* UIProcess/Launcher/ProcessLauncher.cpp:
(WebKit::processLauncherWorkQueue):
(WebKit::ProcessLauncher::ProcessLauncher):
* UIProcess/WebProcessProxy.cpp:
(WebKit::pluginWorkQueue):
(WebKit::WebProcessProxy::getPlugins):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141497 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Gtk] drag and drop has black background without composition
https://bugs.webkit.org/show_bug.cgi?id=108376

Patch by Arnaud Renevier <a.renevier@sisa.samsung.com> on 2013-01-31
Reviewed by Martin Robinson.

Use gtk_drag_set_icon_surface (or gtk_drag_set_icon_pixbuf) when the
screen is not composited. That way, drag window will be decomposited
and rendered transparent with Xshape.

To determine which parts of the window must be transparent, gtk checks
if a pixel is more than 50% opaque. With dissolveDragImageToFraction,
all pixels are made 25% transparent. With antialiasing, opacity goes
below the threshold for some pixels, which makes the resulting image
messy. So, we need to skip dissolveDragImageToFraction when we use
gtk_drag_set_icon_surface.

* platform/gtk/DragIcon.cpp:
(WebCore::DragIcon::DragIcon):
(WebCore::DragIcon::~DragIcon):
(WebCore::DragIcon::setImage):
(WebCore::DragIcon::useForDrag):
* platform/gtk/DragIcon.h:
(DragIcon):
* platform/gtk/DragImageGtk.cpp:
(WebCore::dissolveDragImageToFraction):

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