This way we would avoid all the GScource + polling mechanism that GST uses internally to handle messages asynchronously in the main thread.
Created attachment 264584 [details] Patch
Created attachment 264591 [details] Updated patch I was assuming that sync message handler was always called from a secondary thread, but the main thread can also call gst_bus_post, so I've added a check to not schedule the message to the main thread if we are already in the main thread.
Comment on attachment 264591 [details] Updated patch View in context: https://bugs.webkit.org/attachment.cgi?id=264591&action=review Looks good, I'll leave it to Phil to approve it. > Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:1949 > + if (!weakThis) > + return; > + weakThis->handleMessage(protectMessage.get()); Nit: could be a two-liner. > if (weakThis) > weakThis->handleMessage(protectMessage.get());
Committed r191948: <http://trac.webkit.org/changeset/191948>