Blob Blame Raw
2015-02-09  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] GMutexLocker build issue
        https://bugs.webkit.org/show_bug.cgi?id=141381

        Reviewed by Žan Doberšek.

        Use always WTF::GMutexLocker because newer glib versions have a
        GMutexLocker in the public API.

diff --git a/Source/WTF/wtf/gobject/GMutexLocker.h b/Source/WTF/wtf/gobject/GMutexLocker.h
index 0356702..5efbff0 100644
--- a/Source/WTF/wtf/gobject/GMutexLocker.h
+++ b/Source/WTF/wtf/gobject/GMutexLocker.h
@@ -97,8 +97,6 @@ private:
 
 } // namespace WTF
 
-using WTF::GMutexLocker;
-
 #endif // USE(GLIB)
 
 #endif // GMutexLocker_h
diff --git a/Source/WebCore/platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp b/Source/WebCore/platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp
index b77d738..87adfb2 100644
--- a/Source/WebCore/platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp
+++ b/Source/WebCore/platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp
@@ -150,7 +150,7 @@ void AudioSourceProviderGStreamer::configureAudioBin(GstElement* audioBin, GstEl
 
 void AudioSourceProviderGStreamer::provideInput(AudioBus* bus, size_t framesToProcess)
 {
-    GMutexLocker<GMutex> lock(m_adapterMutex);
+    WTF::GMutexLocker<GMutex> lock(m_adapterMutex);
     copyGStreamerBuffersToAudioChannel(m_frontLeftAdapter, bus, 0, framesToProcess);
     copyGStreamerBuffersToAudioChannel(m_frontRightAdapter, bus, 1, framesToProcess);
 }
@@ -177,7 +177,7 @@ GstFlowReturn AudioSourceProviderGStreamer::handleAudioBuffer(GstAppSink* sink)
     GstAudioInfo info;
     gst_audio_info_from_caps(&info, caps);
 
-    GMutexLocker<GMutex> lock(m_adapterMutex);
+    WTF::GMutexLocker<GMutex> lock(m_adapterMutex);
 
     // Check the first audio channel. The buffer is supposed to store
     // data of a single channel anyway.
@@ -339,7 +339,7 @@ void AudioSourceProviderGStreamer::deinterleavePadsConfigured()
 
 void AudioSourceProviderGStreamer::clearAdapters()
 {
-    GMutexLocker<GMutex> lock(m_adapterMutex);
+    WTF::GMutexLocker<GMutex> lock(m_adapterMutex);
     gst_adapter_clear(m_frontLeftAdapter);
     gst_adapter_clear(m_frontRightAdapter);
 }
diff --git a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp
index 44de756..18864b1 100644
--- a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp
+++ b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp
@@ -137,7 +137,7 @@ IntSize MediaPlayerPrivateGStreamerBase::naturalSize() const
     if (!m_videoSize.isEmpty())
         return m_videoSize;
 
-    GMutexLocker<GMutex> lock(m_sampleMutex);
+    WTF::GMutexLocker<GMutex> lock(m_sampleMutex);
     if (!m_sample)
         return IntSize();
 
@@ -279,7 +279,7 @@ void MediaPlayerPrivateGStreamerBase::muteChanged()
 #if USE(TEXTURE_MAPPER_GL) && !USE(COORDINATED_GRAPHICS)
 PassRefPtr<BitmapTexture> MediaPlayerPrivateGStreamerBase::updateTexture(TextureMapper* textureMapper)
 {
-    GMutexLocker<GMutex> lock(m_sampleMutex);
+    WTF::GMutexLocker<GMutex> lock(m_sampleMutex);
     if (!m_sample)
         return nullptr;
 
@@ -330,7 +330,7 @@ void MediaPlayerPrivateGStreamerBase::triggerRepaint(GstSample* sample)
     g_return_if_fail(GST_IS_SAMPLE(sample));
 
     {
-        GMutexLocker<GMutex> lock(m_sampleMutex);
+        WTF::GMutexLocker<GMutex> lock(m_sampleMutex);
         if (m_sample)
             gst_sample_unref(m_sample);
         m_sample = gst_sample_ref(sample);
@@ -364,7 +364,7 @@ void MediaPlayerPrivateGStreamerBase::paint(GraphicsContext* context, const IntR
     if (!m_player->visible())
         return;
 
-    GMutexLocker<GMutex> lock(m_sampleMutex);
+    WTF::GMutexLocker<GMutex> lock(m_sampleMutex);
     if (!m_sample)
         return;
 
diff --git a/Source/WebCore/platform/graphics/gstreamer/VideoSinkGStreamer.cpp b/Source/WebCore/platform/graphics/gstreamer/VideoSinkGStreamer.cpp
index 255e760..7252065 100644
--- a/Source/WebCore/platform/graphics/gstreamer/VideoSinkGStreamer.cpp
+++ b/Source/WebCore/platform/graphics/gstreamer/VideoSinkGStreamer.cpp
@@ -117,7 +117,7 @@ static void webkitVideoSinkTimeoutCallback(WebKitVideoSink* sink)
 {
     WebKitVideoSinkPrivate* priv = sink->priv;
 
-    GMutexLocker<GMutex> lock(priv->sampleMutex);
+    WTF::GMutexLocker<GMutex> lock(priv->sampleMutex);
     GstSample* sample = priv->sample;
     priv->sample = 0;
 
@@ -136,7 +136,7 @@ static GstFlowReturn webkitVideoSinkRender(GstBaseSink* baseSink, GstBuffer* buf
     WebKitVideoSink* sink = WEBKIT_VIDEO_SINK(baseSink);
     WebKitVideoSinkPrivate* priv = sink->priv;
 
-    GMutexLocker<GMutex> lock(priv->sampleMutex);
+    WTF::GMutexLocker<GMutex> lock(priv->sampleMutex);
 
     if (priv->unlocked)
         return GST_FLOW_OK;
@@ -234,7 +234,7 @@ static void webkitVideoSinkFinalize(GObject* object)
 
 static void unlockSampleMutex(WebKitVideoSinkPrivate* priv)
 {
-    GMutexLocker<GMutex> lock(priv->sampleMutex);
+    WTF::GMutexLocker<GMutex> lock(priv->sampleMutex);
 
     if (priv->sample) {
         gst_sample_unref(priv->sample);
@@ -260,7 +260,7 @@ static gboolean webkitVideoSinkUnlockStop(GstBaseSink* baseSink)
     WebKitVideoSinkPrivate* priv = WEBKIT_VIDEO_SINK(baseSink)->priv;
 
     {
-        GMutexLocker<GMutex> lock(priv->sampleMutex);
+        WTF::GMutexLocker<GMutex> lock(priv->sampleMutex);
         priv->unlocked = false;
     }
 
@@ -285,7 +285,7 @@ static gboolean webkitVideoSinkStart(GstBaseSink* baseSink)
 {
     WebKitVideoSinkPrivate* priv = WEBKIT_VIDEO_SINK(baseSink)->priv;
 
-    GMutexLocker<GMutex> lock(priv->sampleMutex);
+    WTF::GMutexLocker<GMutex> lock(priv->sampleMutex);
     priv->unlocked = false;
     return TRUE;
 }
diff --git a/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp b/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp
index 1fc305f..b9437aa 100644
--- a/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp
+++ b/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp
@@ -338,7 +338,7 @@ static void webKitWebSrcGetProperty(GObject* object, guint propID, GValue* value
     WebKitWebSrc* src = WEBKIT_WEB_SRC(object);
     WebKitWebSrcPrivate* priv = src->priv;
 
-    GMutexLocker<GMutex> locker(*GST_OBJECT_GET_LOCK(src));
+    WTF::GMutexLocker<GMutex> locker(*GST_OBJECT_GET_LOCK(src));
     switch (propID) {
     case PROP_IRADIO_NAME:
         g_value_set_string(value, priv->iradioName);
@@ -378,7 +378,7 @@ static void webKitWebSrcStop(WebKitWebSrc* src)
 
     ASSERT(isMainThread());
 
-    GMutexLocker<GMutex> locker(*GST_OBJECT_GET_LOCK(src));
+    WTF::GMutexLocker<GMutex> locker(*GST_OBJECT_GET_LOCK(src));
 
     bool seeking = priv->seekSource.isActive();
 
@@ -436,7 +436,7 @@ static void webKitWebSrcStart(WebKitWebSrc* src)
 
     ASSERT(isMainThread());
 
-    GMutexLocker<GMutex> locker(*GST_OBJECT_GET_LOCK(src));
+    WTF::GMutexLocker<GMutex> locker(*GST_OBJECT_GET_LOCK(src));
 
     priv->pendingStart = FALSE;
     priv->didPassAccessControlCheck = false;
@@ -539,7 +539,7 @@ static GstStateChangeReturn webKitWebSrcChangeState(GstElement* element, GstStat
         return ret;
     }
 
-    GMutexLocker<GMutex> locker(*GST_OBJECT_GET_LOCK(src));
+    WTF::GMutexLocker<GMutex> locker(*GST_OBJECT_GET_LOCK(src));
     switch (transition) {
     case GST_STATE_CHANGE_READY_TO_PAUSED:
         GST_DEBUG_OBJECT(src, "READY->PAUSED");
@@ -576,7 +576,7 @@ static gboolean webKitWebSrcQueryWithParent(GstPad* pad, GstObject* parent, GstQ
         gst_query_parse_duration(query, &format, NULL);
 
         GST_DEBUG_OBJECT(src, "duration query in format %s", gst_format_get_name(format));
-        GMutexLocker<GMutex> locker(*GST_OBJECT_GET_LOCK(src));
+        WTF::GMutexLocker<GMutex> locker(*GST_OBJECT_GET_LOCK(src));
         if (format == GST_FORMAT_BYTES && src->priv->size > 0) {
             gst_query_set_duration(query, format, src->priv->size);
             result = TRUE;
@@ -584,7 +584,7 @@ static gboolean webKitWebSrcQueryWithParent(GstPad* pad, GstObject* parent, GstQ
         break;
     }
     case GST_QUERY_URI: {
-        GMutexLocker<GMutex> locker(*GST_OBJECT_GET_LOCK(src));
+        WTF::GMutexLocker<GMutex> locker(*GST_OBJECT_GET_LOCK(src));
         gst_query_set_uri(query, src->priv->uri);
         result = TRUE;
         break;
@@ -634,7 +634,7 @@ static gchar* webKitWebSrcGetUri(GstURIHandler* handler)
     WebKitWebSrc* src = WEBKIT_WEB_SRC(handler);
     gchar* ret;
 
-    GMutexLocker<GMutex> locker(*GST_OBJECT_GET_LOCK(src));
+    WTF::GMutexLocker<GMutex> locker(*GST_OBJECT_GET_LOCK(src));
     ret = g_strdup(src->priv->uri);
     return ret;
 }
@@ -649,7 +649,7 @@ static gboolean webKitWebSrcSetUri(GstURIHandler* handler, const gchar* uri, GEr
         return FALSE;
     }
 
-    GMutexLocker<GMutex> locker(*GST_OBJECT_GET_LOCK(src));
+    WTF::GMutexLocker<GMutex> locker(*GST_OBJECT_GET_LOCK(src));
 
     g_free(priv->uri);
     priv->uri = 0;
@@ -685,7 +685,7 @@ static void webKitWebSrcNeedDataMainCb(WebKitWebSrc* src)
 
     ASSERT(isMainThread());
 
-    GMutexLocker<GMutex> locker(*GST_OBJECT_GET_LOCK(src));
+    WTF::GMutexLocker<GMutex> locker(*GST_OBJECT_GET_LOCK(src));
     priv->paused = FALSE;
     locker.unlock();
 
@@ -702,7 +702,7 @@ static void webKitWebSrcNeedDataCb(GstAppSrc*, guint length, gpointer userData)
 
     GST_DEBUG_OBJECT(src, "Need more data: %u", length);
 
-    GMutexLocker<GMutex> locker(*GST_OBJECT_GET_LOCK(src));
+    WTF::GMutexLocker<GMutex> locker(*GST_OBJECT_GET_LOCK(src));
     if (priv->needDataSource.isScheduled() || !priv->paused)
         return;
 
@@ -717,7 +717,7 @@ static void webKitWebSrcEnoughDataMainCb(WebKitWebSrc* src)
 
     ASSERT(isMainThread());
 
-    GMutexLocker<GMutex> locker(*GST_OBJECT_GET_LOCK(src));
+    WTF::GMutexLocker<GMutex> locker(*GST_OBJECT_GET_LOCK(src));
     priv->paused = TRUE;
     locker.unlock();
 
@@ -734,7 +734,7 @@ static void webKitWebSrcEnoughDataCb(GstAppSrc*, gpointer userData)
 
     GST_DEBUG_OBJECT(src, "Have enough data");
 
-    GMutexLocker<GMutex> locker(*GST_OBJECT_GET_LOCK(src));
+    WTF::GMutexLocker<GMutex> locker(*GST_OBJECT_GET_LOCK(src));
     if (priv->enoughDataSource.isScheduled() || priv->paused)
         return;
 
@@ -757,7 +757,7 @@ static gboolean webKitWebSrcSeekDataCb(GstAppSrc*, guint64 offset, gpointer user
     WebKitWebSrcPrivate* priv = src->priv;
 
     GST_DEBUG_OBJECT(src, "Seeking to offset: %" G_GUINT64_FORMAT, offset);
-    GMutexLocker<GMutex> locker(*GST_OBJECT_GET_LOCK(src));
+    WTF::GMutexLocker<GMutex> locker(*GST_OBJECT_GET_LOCK(src));
     if (offset == priv->offset && priv->requestedOffset == priv->offset)
         return TRUE;
 
@@ -776,7 +776,7 @@ static gboolean webKitWebSrcSeekDataCb(GstAppSrc*, guint64 offset, gpointer user
 void webKitWebSrcSetMediaPlayer(WebKitWebSrc* src, WebCore::MediaPlayer* player)
 {
     ASSERT(player);
-    GMutexLocker<GMutex> locker(*GST_OBJECT_GET_LOCK(src));
+    WTF::GMutexLocker<GMutex> locker(*GST_OBJECT_GET_LOCK(src));
     src->priv->player = player;
 }
 
@@ -806,7 +806,7 @@ char* StreamingClient::createReadBuffer(size_t requestedSize, size_t& actualSize
 
     mapGstBuffer(buffer);
 
-    GMutexLocker<GMutex> locker(*GST_OBJECT_GET_LOCK(src));
+    WTF::GMutexLocker<GMutex> locker(*GST_OBJECT_GET_LOCK(src));
     priv->buffer = adoptGRef(buffer);
     locker.unlock();
 
@@ -828,7 +828,7 @@ void StreamingClient::handleResponseReceived(const ResourceResponse& response)
         return;
     }
 
-    GMutexLocker<GMutex> locker(*GST_OBJECT_GET_LOCK(src));
+    WTF::GMutexLocker<GMutex> locker(*GST_OBJECT_GET_LOCK(src));
 
     if (priv->seekSource.isActive()) {
         GST_DEBUG_OBJECT(src, "Seek in progress, ignoring response");
@@ -925,7 +925,7 @@ void StreamingClient::handleDataReceived(const char* data, int length)
     WebKitWebSrc* src = WEBKIT_WEB_SRC(m_src);
     WebKitWebSrcPrivate* priv = src->priv;
 
-    GMutexLocker<GMutex> locker(*GST_OBJECT_GET_LOCK(src));
+    WTF::GMutexLocker<GMutex> locker(*GST_OBJECT_GET_LOCK(src));
 
     GST_LOG_OBJECT(src, "Have %lld bytes of data", priv->buffer ? static_cast<long long>(gst_buffer_get_size(priv->buffer.get())) : length);
 
@@ -994,7 +994,7 @@ void StreamingClient::handleNotifyFinished()
 
     GST_DEBUG_OBJECT(src, "Have EOS");
 
-    GMutexLocker<GMutex> locker(*GST_OBJECT_GET_LOCK(src));
+    WTF::GMutexLocker<GMutex> locker(*GST_OBJECT_GET_LOCK(src));
     if (!priv->seekSource.isActive()) {
         locker.unlock();
         gst_app_src_end_of_stream(priv->appsrc);
@@ -1131,7 +1131,7 @@ void ResourceHandleStreamingClient::wasBlocked(ResourceHandle*)
 
     GST_ERROR_OBJECT(src, "Request was blocked");
 
-    GMutexLocker<GMutex> locker(*GST_OBJECT_GET_LOCK(src));
+    WTF::GMutexLocker<GMutex> locker(*GST_OBJECT_GET_LOCK(src));
     uri.reset(g_strdup(src->priv->uri));
     locker.unlock();
 
@@ -1145,7 +1145,7 @@ void ResourceHandleStreamingClient::cannotShowURL(ResourceHandle*)
 
     GST_ERROR_OBJECT(src, "Cannot show URL");
 
-    GMutexLocker<GMutex> locker(*GST_OBJECT_GET_LOCK(src));
+    WTF::GMutexLocker<GMutex> locker(*GST_OBJECT_GET_LOCK(src));
     uri.reset(g_strdup(src->priv->uri));
     locker.unlock();