summaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2014-03-08 14:13:27 +0000
committerVincent Sanders <vince@kyllikki.org>2014-03-09 15:37:40 +0000
commit87f6314dabdc2067a19e01f8b29f9ecc38ed825b (patch)
tree78f8f8395e3bf3b7ee2c18a7b5a5e6d2d5ca9ddc /render
parentfb9b171e325488dc9792ee0f3062f15d8ec597ee (diff)
downloadnetsurf-87f6314dabdc2067a19e01f8b29f9ecc38ed825b.tar.gz
netsurf-87f6314dabdc2067a19e01f8b29f9ecc38ed825b.tar.bz2
move scheduleing into browser operation table
Diffstat (limited to 'render')
-rw-r--r--render/box_construct.c18
-rw-r--r--render/html.c2
-rw-r--r--render/html_css.c11
-rw-r--r--render/html_object.c22
4 files changed, 28 insertions, 25 deletions
diff --git a/render/box_construct.c b/render/box_construct.c
index f5ef099b4..699102563 100644
--- a/render/box_construct.c
+++ b/render/box_construct.c
@@ -31,25 +31,27 @@
#include <stdlib.h>
#include <string.h>
#include <strings.h>
+
#include "utils/config.h"
#include "content/content_protected.h"
#include "css/css.h"
#include "css/utils.h"
#include "css/select.h"
+#include "desktop/gui_factory.h"
#include "utils/nsoption.h"
-#include "render/box.h"
-#include "render/box_textarea.h"
-#include "render/form.h"
-#include "render/html_internal.h"
#include "utils/corestrings.h"
#include "utils/locale.h"
#include "utils/log.h"
#include "utils/messages.h"
-#include "utils/schedule.h"
#include "utils/talloc.h"
#include "utils/url.h"
#include "utils/utils.h"
+#include "render/box.h"
+#include "render/box_textarea.h"
+#include "render/form.h"
+#include "render/html_internal.h"
+
/**
* Context for box tree construction
*/
@@ -183,9 +185,7 @@ nserror dom_to_box(dom_node *n, html_content *c, box_construct_complete_cb cb)
ctx->cb = cb;
ctx->bctx = c->bctx;
- schedule(0, (schedule_callback_fn) convert_xml_to_box, ctx);
-
- return NSERROR_OK;
+ return guit->browser->schedule(0, (void *)convert_xml_to_box, ctx);
}
/* mapping from CSS display to box type
@@ -446,7 +446,7 @@ void convert_xml_to_box(struct box_construct_ctx *ctx)
} while (++num_processed < max_processed_before_yield);
/* More work to do: schedule a continuation */
- schedule(0, (schedule_callback_fn) convert_xml_to_box, ctx);
+ guit->browser->schedule(0, (void *)convert_xml_to_box, ctx);
}
/**
diff --git a/render/html.c b/render/html.c
index e375e62a5..bb24e585c 100644
--- a/render/html.c
+++ b/render/html.c
@@ -34,7 +34,6 @@
#include "utils/libdom.h"
#include "utils/log.h"
#include "utils/messages.h"
-#include "utils/schedule.h"
#include "utils/talloc.h"
#include "utils/url.h"
#include "utils/utf8.h"
@@ -591,6 +590,7 @@ void html_finish_conversion(html_content *c)
error = dom_to_box(html, c, html_box_convert_done);
if (error != NSERROR_OK) {
+ LOG(("box conversion failed"));
dom_node_unref(html);
html_object_free_objects(c);
content_broadcast_errorcode(&c->base, error);
diff --git a/render/html_css.c b/render/html_css.c
index ad24804a9..b4c25bae2 100644
--- a/render/html_css.c
+++ b/render/html_css.c
@@ -28,12 +28,13 @@
#include <stdlib.h>
#include "content/hlcache.h"
+#include "desktop/gui_factory.h"
#include "utils/nsoption.h"
-#include "render/html_internal.h"
#include "utils/corestrings.h"
#include "utils/config.h"
#include "utils/log.h"
-#include "utils/schedule.h"
+
+#include "render/html_internal.h"
static nsurl *html_default_stylesheet_url;
static nsurl *html_adblock_stylesheet_url;
@@ -307,7 +308,7 @@ static void html_css_process_modified_styles(void *pw)
/* If we failed to process any sheet, schedule a retry */
if (all_done == false) {
- schedule(100, html_css_process_modified_styles, c);
+ guit->browser->schedule(1000, html_css_process_modified_styles, c);
}
}
@@ -332,7 +333,7 @@ bool html_css_update_style(html_content *c, dom_node *style)
s->modified = true;
- schedule(0, html_css_process_modified_styles, c);
+ guit->browser->schedule(0, html_css_process_modified_styles, c);
return true;
}
@@ -462,7 +463,7 @@ nserror html_css_free_stylesheets(html_content *html)
{
unsigned int i;
- schedule_remove(html_css_process_modified_styles, html);
+ guit->browser->schedule(-1, html_css_process_modified_styles, html);
for (i = 0; i != html->stylesheet_count; i++) {
if (html->stylesheets[i].sheet != NULL) {
diff --git a/render/html_object.c b/render/html_object.c
index e76919dd4..6499f249a 100644
--- a/render/html_object.c
+++ b/render/html_object.c
@@ -31,12 +31,13 @@
#include "css/utils.h"
#include "utils/nsoption.h"
#include "desktop/scrollbar.h"
-#include "render/box.h"
-#include "render/html_internal.h"
+#include "desktop/gui_factory.h"
#include "utils/corestrings.h"
#include "utils/config.h"
#include "utils/log.h"
-#include "utils/schedule.h"
+
+#include "render/box.h"
+#include "render/html_internal.h"
/* break reference loop */
static void html_object_refresh(void *p);
@@ -335,7 +336,7 @@ html_object_callback(hlcache_handle *object,
case CONTENT_MSG_REFRESH:
if (content_get_type(object) == CONTENT_HTML) {
/* only for HTML objects */
- schedule(event->data.delay * 100,
+ guit->browser->schedule(event->data.delay * 1000,
html_object_refresh, o);
}
@@ -534,7 +535,7 @@ static bool html_replace_object(struct content_html_object *object, nsurl *url)
}
/**
- * schedule() callback for object refresh
+ * schedule callback for object refresh
*/
static void html_object_refresh(void *p)
@@ -630,8 +631,9 @@ nserror html_object_close_objects(html_content *html)
if (content_get_type(object->content) == CONTENT_NONE)
continue;
- if (content_get_type(object->content) == CONTENT_HTML)
- schedule_remove(html_object_refresh, object);
+ if (content_get_type(object->content) == CONTENT_HTML) {
+ guit->browser->schedule(-1, html_object_refresh, object);
+ }
content_close(object->content);
}
@@ -646,9 +648,9 @@ nserror html_object_free_objects(html_content *html)
if (victim->content != NULL) {
LOG(("object %p", victim->content));
- if (content_get_type(victim->content) == CONTENT_HTML)
- schedule_remove(html_object_refresh, victim);
-
+ if (content_get_type(victim->content) == CONTENT_HTML) {
+ guit->browser->schedule(-1, html_object_refresh, victim);
+ }
hlcache_handle_release(victim->content);
}