aboutsummaryrefslogtreecommitdiffstats
path: root/embed
diff options
context:
space:
mode:
authorDiego Escalante Urrelo <diegoe@svn.gnome.org>2007-01-03 16:08:12 +0800
committerDiego Escalante Urrelo <diegoe@src.gnome.org>2007-01-03 16:08:12 +0800
commitba82c09a4fad2c258eee6198c2c460fce28afd7b (patch)
treefbca03b2be9de64f2073ed154f184c798fac96c8 /embed
parent6f06e1d567f30dc39347f8ce0f05ab16499aea7a (diff)
downloadgsoc2013-epiphany-ba82c09a4fad2c258eee6198c2c460fce28afd7b.tar
gsoc2013-epiphany-ba82c09a4fad2c258eee6198c2c460fce28afd7b.tar.gz
gsoc2013-epiphany-ba82c09a4fad2c258eee6198c2c460fce28afd7b.tar.bz2
gsoc2013-epiphany-ba82c09a4fad2c258eee6198c2c460fce28afd7b.tar.lz
gsoc2013-epiphany-ba82c09a4fad2c258eee6198c2c460fce28afd7b.tar.xz
gsoc2013-epiphany-ba82c09a4fad2c258eee6198c2c460fce28afd7b.tar.zst
gsoc2013-epiphany-ba82c09a4fad2c258eee6198c2c460fce28afd7b.zip
Utilize GLib's new g_timeout_add_seconds to reduce context switches and
2007-01-03 Diego Escalante Urrelo <diegoe@svn.gnome.org> * embed/ephy-favicon-cache.c: (ephy_favicon_cache_init): * embed/ephy-history.c: (ephy_history_init): * lib/Makefile.am: * lib/ephy-glib-compat.h: * src/bookmarks/ephy-bookmarks.c: (ephy_bookmarks_save_delayed): * src/ephy-dbus.c: (session_filter_func), (system_filter_func): * src/ephy-extensions-manager.c: (reload_cb): * src/ephy-session.c: (confirm_shutdown_cb): Utilize GLib's new g_timeout_add_seconds to reduce context switches and improve CPU/power efficiency. Patch by Chris Wilson. svn path=/trunk/; revision=6783
Diffstat (limited to 'embed')
-rw-r--r--embed/ephy-favicon-cache.c13
-rw-r--r--embed/ephy-history.c7
2 files changed, 11 insertions, 9 deletions
diff --git a/embed/ephy-favicon-cache.c b/embed/ephy-favicon-cache.c
index 5d6d62fe3..2892fb496 100644
--- a/embed/ephy-favicon-cache.c
+++ b/embed/ephy-favicon-cache.c
@@ -36,6 +36,7 @@
#include "ephy-node-common.h"
#include "ephy-node.h"
#include "ephy-debug.h"
+#include "ephy-glib-compat.h"
#include <glib/gstdio.h>
#include <libgnomeui/libgnomeui.h>
@@ -47,11 +48,11 @@
#define EPHY_FAVICON_CACHE_OBSOLETE_DAYS 30
-/* how often to save the cache, in milliseconds */
-#define CACHE_SAVE_INTERVAL 10 * 60 * 1000 /* ms */
+/* how often to save the cache, in seconds */
+#define CACHE_SAVE_INTERVAL (10 * 60) /* seconds */
-/* how often to delete old pixbufs from the cache, in milliseconds */
-#define CACHE_CLEANUP_INTERVAL 5 * 60 * 1000 /* ms */
+/* how often to delete old pixbufs from the cache, in seconds */
+#define CACHE_CLEANUP_INTERVAL (5 * 60) /* seconds */
/* how long to keep pixbufs in cache, in seconds. This should be longer than CACHE_CLEANUP_INTERVAL */
#define PIXBUF_CACHE_KEEP_TIME 10 * 60 /* s */
@@ -395,10 +396,10 @@ ephy_favicon_cache_init (EphyFaviconCache *cache)
g_signal_connect_object (embed_shell, "prepare-close",
G_CALLBACK (prepare_close_cb), cache, 0);
- priv->autosave_timeout = g_timeout_add (CACHE_SAVE_INTERVAL,
+ priv->autosave_timeout = g_timeout_add_seconds (CACHE_SAVE_INTERVAL,
(GSourceFunc) periodic_save_cb,
cache);
- priv->cleanup_timeout = g_timeout_add (CACHE_CLEANUP_INTERVAL,
+ priv->cleanup_timeout = g_timeout_add_seconds (CACHE_CLEANUP_INTERVAL,
(GSourceFunc) periodic_cleanup_cb,
cache);
}
diff --git a/embed/ephy-history.c b/embed/ephy-history.c
index 494c1e00d..4b2876665 100644
--- a/embed/ephy-history.c
+++ b/embed/ephy-history.c
@@ -29,6 +29,7 @@
#include "ephy-node-common.h"
#include "eel-gconf-extensions.h"
#include "ephy-prefs.h"
+#include "ephy-glib-compat.h"
#include <time.h>
#include <string.h>
@@ -38,8 +39,8 @@
#define EPHY_HISTORY_XML_ROOT (const xmlChar *)"ephy_history"
#define EPHY_HISTORY_XML_VERSION (const xmlChar *)"1.0"
-/* how often to save the history, in milliseconds */
-#define HISTORY_SAVE_INTERVAL (5 * 60 * 1000)
+/* how often to save the history, in seconds */
+#define HISTORY_SAVE_INTERVAL (5 * 60)
/* if you change this remember to change also the user interface description */
#define HISTORY_PAGE_OBSOLETE_DAYS 10
@@ -606,7 +607,7 @@ ephy_history_init (EphyHistory *eb)
/* setup the periodic history saving callback */
eb->priv->autosave_timeout =
- g_timeout_add (HISTORY_SAVE_INTERVAL,
+ g_timeout_add_seconds (HISTORY_SAVE_INTERVAL,
(GSourceFunc)periodic_save_cb,
eb);