summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2019-08-04 10:47:34 +0100
committerDaniel Silverstone <dsilvers@digital-scurf.org>2019-08-04 11:22:40 +0100
commit19052001541aeac269b846d2a81e7f78e7c26c2d (patch)
treecc4ff33954ed03d166e5d0eb1f9b18eec2dde462
parent3bd7a2ddd6fc84127625a7fce43dfc9e215a6d7f (diff)
downloadnetsurf-19052001541aeac269b846d2a81e7f78e7c26c2d.tar.gz
netsurf-19052001541aeac269b846d2a81e7f78e7c26c2d.tar.bz2
Add content handlers for queries
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
-rw-r--r--content/handlers/css/css.c9
-rw-r--r--content/handlers/html/html_css.c10
-rw-r--r--content/handlers/html/html_object.c10
-rw-r--r--content/handlers/html/html_script.c30
-rw-r--r--desktop/browser_window.c24
-rw-r--r--desktop/searchweb.c20
-rw-r--r--desktop/treeview.c10
-rw-r--r--frontends/riscos/gui/url_bar.c10
8 files changed, 122 insertions, 1 deletions
diff --git a/content/handlers/css/css.c b/content/handlers/css/css.c
index 0dcbe9907..3e00879f3 100644
--- a/content/handlers/css/css.c
+++ b/content/handlers/css/css.c
@@ -642,7 +642,14 @@ nserror nscss_import(hlcache_handle *handle,
error = nscss_import_complete(ctx);
/* Already released handle */
break;
-
+ case CONTENT_MSG_QUERY:
+ /** \todo QUERY - Decide what is right here */
+ /* For now, the only safe decision is to cancel the fetch */
+ event->data.query_msg->cb(false, event->data.query_msg->cb_pw);
+ break;
+ case CONTENT_MSG_QUERY_FINISHED:
+ /** \todo QUERY - Decide what is right here */
+ break;
default:
break;
}
diff --git a/content/handlers/html/html_css.c b/content/handlers/html/html_css.c
index 2a2fde6c6..f65c2559c 100644
--- a/content/handlers/html/html_css.c
+++ b/content/handlers/html/html_css.c
@@ -129,6 +129,16 @@ html_convert_css_callback(hlcache_handle *css,
/* Really don't want this to continue after the switch */
return NSERROR_OK;
+ case CONTENT_MSG_QUERY:
+ /** \todo QUERY - Decide what is right here */
+ /* For now, the only safe decision is to cancel the fetch */
+ event->data.query_msg->cb(false, event->data.query_msg->cb_pw);
+ return NSERROR_OK;
+
+ case CONTENT_MSG_QUERY_FINISHED:
+ /** \todo QUERY - Decide what is right here */
+ return NSERROR_OK;
+
default:
break;
}
diff --git a/content/handlers/html/html_object.c b/content/handlers/html/html_object.c
index 1dc8e645d..f49af6505 100644
--- a/content/handlers/html/html_object.c
+++ b/content/handlers/html/html_object.c
@@ -454,6 +454,16 @@ html_object_callback(hlcache_handle *object,
}
break;
+ case CONTENT_MSG_QUERY:
+ /** \todo QUERY - Decide what is right here */
+ /* For now, the only safe decision is to cancel the fetch */
+ event->data.query_msg->cb(false, event->data.query_msg->cb_pw);
+ return NSERROR_OK;
+
+ case CONTENT_MSG_QUERY_FINISHED:
+ /** \todo QUERY - Decide what is right here */
+ return NSERROR_OK;
+
default:
break;
}
diff --git a/content/handlers/html/html_script.c b/content/handlers/html/html_script.c
index 2a72d512e..5af4750ff 100644
--- a/content/handlers/html/html_script.c
+++ b/content/handlers/html/html_script.c
@@ -195,6 +195,16 @@ convert_script_async_cb(hlcache_handle *script,
break;
+ case CONTENT_MSG_QUERY:
+ /** \todo QUERY - Decide what is right here */
+ /* For now, the only safe decision is to cancel the fetch */
+ event->data.query_msg->cb(false, event->data.query_msg->cb_pw);
+ return NSERROR_OK;
+
+ case CONTENT_MSG_QUERY_FINISHED:
+ /** \todo QUERY - Decide what is right here */
+ return NSERROR_OK;
+
default:
break;
}
@@ -261,6 +271,16 @@ convert_script_defer_cb(hlcache_handle *script,
break;
+ case CONTENT_MSG_QUERY:
+ /** \todo QUERY - Decide what is right here */
+ /* For now, the only safe decision is to cancel the fetch */
+ event->data.query_msg->cb(false, event->data.query_msg->cb_pw);
+ return NSERROR_OK;
+
+ case CONTENT_MSG_QUERY_FINISHED:
+ /** \todo QUERY - Decide what is right here */
+ return NSERROR_OK;
+
default:
break;
}
@@ -353,6 +373,16 @@ convert_script_sync_cb(hlcache_handle *script,
break;
+ case CONTENT_MSG_QUERY:
+ /** \todo QUERY - Decide what is right here */
+ /* For now, the only safe decision is to cancel the fetch */
+ event->data.query_msg->cb(false, event->data.query_msg->cb_pw);
+ return NSERROR_OK;
+
+ case CONTENT_MSG_QUERY_FINISHED:
+ /** \todo QUERY - Decide what is right here */
+ return NSERROR_OK;
+
default:
break;
}
diff --git a/desktop/browser_window.c b/desktop/browser_window.c
index 920004aa2..e3eae6cf2 100644
--- a/desktop/browser_window.c
+++ b/desktop/browser_window.c
@@ -446,6 +446,16 @@ browser_window_favicon_callback(hlcache_handle *c,
}
break;
+ case CONTENT_MSG_QUERY:
+ /** \todo QUERY - Decide what is right here */
+ /* For now, the only safe decision is to cancel the fetch */
+ event->data.query_msg->cb(false, event->data.query_msg->cb_pw);
+ break;
+
+ case CONTENT_MSG_QUERY_FINISHED:
+ /** \todo QUERY - Decide what is right here */
+ break;
+
default:
break;
}
@@ -1124,6 +1134,20 @@ browser_window_callback(hlcache_handle *c, const hlcache_event *event, void *pw)
break;
+ case CONTENT_MSG_QUERY:
+ /** \todo QUERY - Decide what is right here */
+ /* For now, we directly invoke the known global handler for queries */
+ return netsurf_llcache_query_handler(
+ event->data.query_msg->query,
+ NULL,
+ event->data.query_msg->cb,
+ event->data.query_msg->cb_pw);
+ break;
+
+ case CONTENT_MSG_QUERY_FINISHED:
+ /** \todo QUERY - Decide what is right here */
+ break;
+
default:
break;
}
diff --git a/desktop/searchweb.c b/desktop/searchweb.c
index c07cac9d5..fed6f3e75 100644
--- a/desktop/searchweb.c
+++ b/desktop/searchweb.c
@@ -307,6 +307,16 @@ search_web_ico_callback(hlcache_handle *ico,
provider->ico_handle = NULL;
break;
+ case CONTENT_MSG_QUERY:
+ /** \todo QUERY - Decide what is right here */
+ /* For now, the only safe decision is to cancel the fetch */
+ event->data.query_msg->cb(false, event->data.query_msg->cb_pw);
+ return NSERROR_OK;
+
+ case CONTENT_MSG_QUERY_FINISHED:
+ /** \todo QUERY - Decide what is right here */
+ return NSERROR_OK;
+
default:
break;
}
@@ -467,6 +477,16 @@ default_ico_callback(hlcache_handle *ico,
ctx->default_ico_handle = NULL;
break;
+ case CONTENT_MSG_QUERY:
+ /** \todo QUERY - Decide what is right here */
+ /* For now, the only safe decision is to cancel the fetch */
+ event->data.query_msg->cb(false, event->data.query_msg->cb_pw);
+ return NSERROR_OK;
+
+ case CONTENT_MSG_QUERY_FINISHED:
+ /** \todo QUERY - Decide what is right here */
+ return NSERROR_OK;
+
default:
break;
}
diff --git a/desktop/treeview.c b/desktop/treeview.c
index 807366422..d730e748a 100644
--- a/desktop/treeview.c
+++ b/desktop/treeview.c
@@ -4945,6 +4945,16 @@ treeview_res_cb(struct hlcache_handle *handle,
r->height = content_get_height(handle);
break;
+ case CONTENT_MSG_QUERY:
+ /** \todo QUERY - Decide what is right here */
+ /* For now, the only safe decision is to cancel the fetch */
+ event->data.query_msg->cb(false, event->data.query_msg->cb_pw);
+ return NSERROR_OK;
+
+ case CONTENT_MSG_QUERY_FINISHED:
+ /** \todo QUERY - Decide what is right here */
+ return NSERROR_OK;
+
default:
break;
}
diff --git a/frontends/riscos/gui/url_bar.c b/frontends/riscos/gui/url_bar.c
index ee5c689df..6fb3b2a2a 100644
--- a/frontends/riscos/gui/url_bar.c
+++ b/frontends/riscos/gui/url_bar.c
@@ -1327,6 +1327,16 @@ static nserror ro_gui_url_bar_res_cb(hlcache_handle *handle,
r->height = content_get_height(handle);
break;
+ case CONTENT_MSG_QUERY:
+ /** \todo QUERY - Decide what is right here */
+ /* For now, the only safe decision is to cancel the fetch */
+ event->data.query_msg->cb(false, event->data.query_msg->cb_pw);
+ return NSERROR_OK;
+
+ case CONTENT_MSG_QUERY_FINISHED:
+ /** \todo QUERY - Decide what is right here */
+ return NSERROR_OK;
+
default:
break;
}