https://bugs.webkit.org/show_bug.cgi?id=123229
Patch by Bastien Nocera <hadess@hadess.net> on 2013-10-28
Reviewed by Anders Carlsson.
Source/WebCore:
Give a name to GLib timeout sources, this is helpful when
profiling WebKitGTK applications.
No new tests, no change in functionality.
Source/WebKit/gtk:
Give a name to GLib timeout sources, this is helpful when
profiling WebKitGTK applications.
Source/WebKit2:
Give a name to GLib timeout sources, this is helpful when
profiling WebKitGTK applications.
Tools:
Give a name to GLib timeout sources, this is helpful when
profiling WebKitGTK applications.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@158110
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2013-10-28 Bastien Nocera <hadess@hadess.net>
+
+ Name all the GLib timeout sources
+ https://bugs.webkit.org/show_bug.cgi?id=123229
+
+ Reviewed by Anders Carlsson.
+
+ Give a name to GLib timeout sources, this is helpful when
+ profiling WebKitGTK applications.
+
+ No new tests, no change in functionality.
+
2013-10-28 Philippe Normand <pnormand@igalia.com>
MediaStreamTrackPrivate's m_client uninitialized
// See also https://bugs.webkit.org/show_bug.cgi?id=117354
if (newState == GST_STATE_READY && !m_readyTimerHandler) {
m_readyTimerHandler = g_timeout_add_seconds(gReadyStateTimerInterval, reinterpret_cast<GSourceFunc>(mediaPlayerPrivateReadyStateTimeoutCallback), this);
+ g_source_set_name_by_id(m_readyTimerHandler, "[WebKit] mediaPlayerPrivateReadyStateTimeoutCallback");
} else if (newState != GST_STATE_READY && m_readyTimerHandler) {
g_source_remove(m_readyTimerHandler);
m_readyTimerHandler = 0;
// See: https://bugzilla.gnome.org/show_bug.cgi?id=610830.
priv->timeoutId = g_timeout_add_full(G_PRIORITY_DEFAULT, 0, webkitVideoSinkTimeoutCallback,
gst_object_ref(sink), reinterpret_cast<GDestroyNotify>(gst_object_unref));
+ g_source_set_name_by_id(priv->timeoutId, "[WebKit] webkitVideoSinkTimeoutCallback");
g_cond_wait(priv->dataCondition, priv->bufferMutex);
g_mutex_unlock(priv->bufferMutex);
updateHudPosition();
// Start periodic updates of the progress bar.
- if (!m_progressBarUpdateId)
+ if (!m_progressBarUpdateId) {
m_progressBarUpdateId = g_timeout_add(PROGRESS_BAR_UPDATE_INTERVAL, reinterpret_cast<GSourceFunc>(progressBarUpdateCallback), this);
+ g_source_set_name_by_id(m_progressBarUpdateId, "[WebKit] progressBarUpdateCallback");
+ }
// Hide the hud in few seconds, if requested.
- if (autoHide)
+ if (autoHide) {
m_hudTimeoutId = g_timeout_add(HUD_AUTO_HIDE_INTERVAL, reinterpret_cast<GSourceFunc>(hideHudCallback), this);
+ g_source_set_name_by_id(m_hudTimeoutId, "[WebKit] hideHudCallback");
+ }
}
void FullscreenVideoControllerGtk::hideHud()
gtk_box_pack_start(GTK_BOX(hbox), item, FALSE, TRUE, 0);
m_progressBarUpdateId = g_timeout_add(PROGRESS_BAR_UPDATE_INTERVAL, reinterpret_cast<GSourceFunc>(progressBarUpdateCallback), this);
+ g_source_set_name_by_id(m_progressBarUpdateId, "[WebKit] progressBarUpdateCallback");
playStateChanged();
}
sharedTimerFiredFunction = f;
}
-static gboolean timeout_cb(gpointer)
+static gboolean sharedTimerTimeoutCallback(gpointer)
{
if (sharedTimerFiredFunction)
sharedTimerFiredFunction();
guint intervalInMS = static_cast<guint>(interval * 1000);
stopSharedTimer();
- sharedTimer = g_timeout_add_full(GDK_PRIORITY_REDRAW, intervalInMS, timeout_cb, 0, 0);
+ sharedTimer = g_timeout_add_full(GDK_PRIORITY_REDRAW, intervalInMS, sharedTimerTimeoutCallback, 0, 0);
+ g_source_set_name_by_id(sharedTimer, "[WebKit] sharedTimerTimeoutCallback");
}
void stopSharedTimer()
g_timeout_add(25,
(GSourceFunc)xt_event_polling_timer_callback,
xtdisplay);
+ g_source_set_name_by_id(xt_polling_timer_id, "[WebKit] xt_event_polling_timer_callback");
}
/* Bump up our usage count */
2013-10-28 Bastien Nocera <hadess@hadess.net>
+ Name all the GLib timeout sources
+ https://bugs.webkit.org/show_bug.cgi?id=123229
+
+ Reviewed by Anders Carlsson.
+
+ Give a name to GLib timeout sources, this is helpful when
+ profiling WebKitGTK applications.
+
+2013-10-28 Bastien Nocera <hadess@hadess.net>
+
Replace 0 timeouts g_timeout_add() by g_idle_add()
https://bugs.webkit.org/show_bug.cgi?id=123260
m_needsExtraFlush = false;
double nextFlush = std::max((1 / gFramesPerSecond) - (currentTime() - m_lastFlushTime), 0.0);
m_layerFlushTimerCallbackId = g_timeout_add_full(GDK_PRIORITY_EVENTS, 1000 * nextFlush, reinterpret_cast<GSourceFunc>(layerFlushTimerFiredCallback), this, 0);
+ g_source_set_name_by_id(m_layerFlushTimerCallbackId, "[WebKit] layerFlushTimerFiredCallback");
}
return true;
scheduleLayerFlush();
m_layerFlushTimerCallbackId = g_timeout_add_full(GDK_PRIORITY_EVENTS, 500, reinterpret_cast<GSourceFunc>(layerFlushTimerFiredCallback), this, 0);
+ g_source_set_name_by_id(m_layerFlushTimerCallbackId, "[WebKit] layerFlushTimerFiredCallback");
}
void AcceleratedCompositingContext::setNonCompositedContentsNeedDisplay(const IntRect& rect)
// starve WebCore timers, which have a lower priority.
double nextFlush = std::max(gScheduleDelay - (currentTime() - m_lastFlushTime), 0.0);
m_layerFlushTimerCallbackId = g_timeout_add_full(GDK_PRIORITY_EVENTS, nextFlush * 1000, reinterpret_cast<GSourceFunc>(layerFlushTimerFiredCallback), this, 0);
+ g_source_set_name_by_id(m_layerFlushTimerCallbackId, "[WebKit] layerFlushTimerFiredCallback");
}
bool AcceleratedCompositingContext::flushPendingLayerChanges()
+2013-10-28 Bastien Nocera <hadess@hadess.net>
+
+ Name all the GLib timeout sources
+ https://bugs.webkit.org/show_bug.cgi?id=123229
+
+ Reviewed by Anders Carlsson.
+
+ Give a name to GLib timeout sources, this is helpful when
+ profiling WebKitGTK applications.
+
2013-10-28 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Fix make distcheck.
const double targetFPS = 60;
double nextFlush = std::max((1 / targetFPS) - (currentTime() - m_lastFlushTime), 0.0);
m_layerFlushTimerCallbackId = g_timeout_add_full(GDK_PRIORITY_EVENTS, nextFlush * 1000.0, reinterpret_cast<GSourceFunc>(layerFlushTimerFiredCallback), this, 0);
+ g_source_set_name_by_id(m_layerFlushTimerCallbackId, "[WebKit] layerFlushTimerFiredCallback");
}
}
return;
// We use a GLib timer because otherwise GTK+ event handling during dragging can starve WebCore timers, which have a lower priority.
- if (!m_layerFlushTimerCallbackId)
+ if (!m_layerFlushTimerCallbackId) {
m_layerFlushTimerCallbackId = g_timeout_add_full(GDK_PRIORITY_EVENTS, 0, reinterpret_cast<GSourceFunc>(layerFlushTimerFiredCallback), this, 0);
+ g_source_set_name_by_id(m_layerFlushTimerCallbackId, "[WebKit] layerFlushTimerFiredCallback");
+ }
}
void LayerTreeHostGtk::setLayerFlushSchedulingEnabled(bool layerFlushingEnabled)
2013-10-28 Bastien Nocera <hadess@hadess.net>
+ Name all the GLib timeout sources
+ https://bugs.webkit.org/show_bug.cgi?id=123229
+
+ Reviewed by Anders Carlsson.
+
+ Give a name to GLib timeout sources, this is helpful when
+ profiling WebKitGTK applications.
+
+2013-10-28 Bastien Nocera <hadess@hadess.net>
+
Replace 0 timeouts g_timeout_add() by g_idle_add()
https://bugs.webkit.org/show_bug.cgi?id=123260
static const int timeoutSeconds = 30;
m_waitToDump = waitUntilDone;
- if (m_waitToDump && shouldSetWaitToDumpWatchdog())
- setWaitToDumpWatchdog(g_timeout_add_seconds(timeoutSeconds, waitToDumpWatchdogFired, 0));
+ if (m_waitToDump && shouldSetWaitToDumpWatchdog()) {
+ guint id = g_timeout_add_seconds(timeoutSeconds, waitToDumpWatchdogFired, 0);
+ g_source_set_name_by_id(id, "[WebKit] waitToDumpWatchdogFired");
+ setWaitToDumpWatchdog(id);
+ }
}
int TestRunner::windowCount()
GTK_BUTTONS_CLOSE,
"%s is now full screen. Press ESC or f to exit.", uri);
g_signal_connect_swapped(dialog, "response", G_CALLBACK(gtk_widget_destroy), dialog);
- g_timeout_add(1500, (GSourceFunc) webViewFullscreenMessageWindowClose, dialog);
+ guint id = g_timeout_add(1500, (GSourceFunc) webViewFullscreenMessageWindowClose, dialog);
+ g_source_set_name_by_id(id, "[WebKit] webViewFullscreenMessageWindowClose");
gtk_dialog_run(GTK_DIALOG(dialog));
}
return TRUE;
{
gdouble progress = webkit_web_view_get_estimated_load_progress(webView);
gtk_entry_set_progress_fraction(GTK_ENTRY(window->uriEntry), progress);
- if (progress == 1.0)
- g_timeout_add(500, (GSourceFunc)resetEntryProgress, window->uriEntry);
+ if (progress == 1.0) {
+ guint id = g_timeout_add(500, (GSourceFunc)resetEntryProgress, window->uriEntry);
+ g_source_set_name_by_id(id, "[WebKit] resetEntryProgress");
+ }
}
static void downloadStarted(WebKitWebContext *webContext, WebKitDownload *download, BrowserWindow *window)
gtk_widget_show(window->fullScreenMessageLabel);
window->fullScreenMessageLabelId = g_timeout_add_seconds(2, (GSourceFunc)fullScreenMessageTimeoutCallback, window);
+ g_source_set_name_by_id(window->fullScreenMessageLabelId, "[WebKit] fullScreenMessageTimeoutCallback");
gtk_widget_hide(window->toolbar);
window->searchBarVisible = gtk_widget_get_visible(GTK_WIDGET(window->searchBar));
browser_search_bar_close(window->searchBar);
m_waitToDumpWatchdogTimer = g_timeout_add(waitToDumpWatchdogTimerInterval * 1000,
waitToDumpWatchdogTimerCallback, 0);
+ g_source_set_name_by_id(m_waitToDumpWatchdogTimer, "[WebKit] waitToDumpWatchdogTimerCallback");
}
JSRetainPtr<JSStringRef> TestRunner::pathToLocalResource(JSStringRef url)
void TestController::platformRunUntil(bool&, double timeout)
{
cancelTimeout();
- if (timeout != m_noTimeout)
+ if (timeout != m_noTimeout) {
gTimeoutSourceId = g_timeout_add(timeout * 1000, timeoutCallback, 0);
+ g_source_set_name_by_id(gTimeoutSourceId, "[WebKit] timeoutCallback");
+ }
gtk_main();
}