Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/19052001541aeac269b846d2a81e7f78e7c26c2d
...commit
http://git.netsurf-browser.org/netsurf.git/commit/19052001541aeac269b846d2a81e7f78e7c26c2d
...tree
http://git.netsurf-browser.org/netsurf.git/tree/19052001541aeac269b846d2a81e7f78e7c26c2d
The branch, master has been updated
via 19052001541aeac269b846d2a81e7f78e7c26c2d (commit)
via 3bd7a2ddd6fc84127625a7fce43dfc9e215a6d7f (commit)
via 6b4610edc9bfe67692a2182afc584ea4e6fa5cb9 (commit)
via b48e462f0f542f82db95d9b8613339a9b748808e (commit)
via f59a726f6899bd970ab5c1b853323442a6a9e473 (commit)
via 386d803371c94a4b10154fa544374dc7b09fb14a (commit)
from 90fe920e07c78e4f65f5df84498c570892e5e2c0 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=19052001541aeac269b846d2a81e7f78e7c26c2d
commit 19052001541aeac269b846d2a81e7f78e7c26c2d
Author: Daniel Silverstone <[email protected]>
Commit: Daniel Silverstone <[email protected]>
Add content handlers for queries
Signed-off-by: Daniel Silverstone <[email protected]>
diff --git a/content/handlers/css/css.c b/content/handlers/css/css.c
index 0dcbe99..3e00879 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 2a2fde6..f65c255 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 1dc8e64..f49af65 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 2a72d51..5af4750 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 920004a..e3eae6c 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 c07cac9..fed6f3e 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 8073664..d730e74 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 ee5c689..6fb3b2a 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;
}
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=3bd7a2ddd6fc84127625a7fce43dfc9e215a6d7f
commit 3bd7a2ddd6fc84127625a7fce43dfc9e215a6d7f
Author: Daniel Silverstone <[email protected]>
Commit: Daniel Silverstone <[email protected]>
desktop: Expose llcache query handler temporarily
Signed-off-by: Daniel Silverstone <[email protected]>
diff --git a/desktop/browser_private.h b/desktop/browser_private.h
index 31c261f..23fbf89 100644
--- a/desktop/browser_private.h
+++ b/desktop/browser_private.h
@@ -359,4 +359,11 @@ nserror browser_window_history_get_scroll(struct
browser_window *bw,
void browser_window_history_destroy(struct browser_window *bw);
+/** \todo QUERY - Remove this include */
+#include "content/llcache.h"
+/** \todo QUERY - Remove this import */
+nserror netsurf_llcache_query_handler(
+ const llcache_query *query,
+ void *pw, llcache_query_response cb, void *cbpw);
+
#endif
diff --git a/desktop/netsurf.c b/desktop/netsurf.c
index 73c91ea..041e98a 100644
--- a/desktop/netsurf.c
+++ b/desktop/netsurf.c
@@ -52,6 +52,10 @@
#include "desktop/gui_internal.h"
#include "netsurf/netsurf.h"
+
+/** \todo QUERY - Remove this import later */
+#include "desktop/browser_private.h"
+
/** speculative pre-conversion small image size
*
* Experimenting by visiting every page from default page in order and
@@ -293,13 +297,18 @@ static nserror netsurf__handle_login(const llcache_query
*query,
/**
* Dispatch a low-level cache query to the frontend
*
+ * \todo QUERY - This should end up as part of browser_window_callback
+ *
+ * NOTE: Right now this is exported so that it can be invoked from the
+ * browser window callback
+ *
* \param query Query descriptor
* \param pw Private data
* \param cb Continuation callback
* \param cbpw Private data for continuation
* \return NSERROR_OK
*/
-static nserror netsurf_llcache_query_handler(const llcache_query *query,
+nserror netsurf_llcache_query_handler(const llcache_query *query,
void *pw, llcache_query_response cb, void *cbpw)
{
nserror res = NSERROR_OK;
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=6b4610edc9bfe67692a2182afc584ea4e6fa5cb9
commit 6b4610edc9bfe67692a2182afc584ea4e6fa5cb9
Author: Daniel Silverstone <[email protected]>
Commit: Daniel Silverstone <[email protected]>
llcache: Do not delete objects if they were iterator targets
Signed-off-by: Daniel Silverstone <[email protected]>
diff --git a/content/llcache.c b/content/llcache.c
index 06951e2..f3f4b68 100644
--- a/content/llcache.c
+++ b/content/llcache.c
@@ -397,7 +397,7 @@ static nserror llcache_send_event_to_users(llcache_object
*object,
user->iterator_target = was_target;
- if (user->queued_for_delete) {
+ if (user->queued_for_delete && !was_target) {
llcache_object_remove_user(object, user);
llcache_object_user_destroy(user);
}
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=b48e462f0f542f82db95d9b8613339a9b748808e
commit b48e462f0f542f82db95d9b8613339a9b748808e
Author: Daniel Silverstone <[email protected]>
Commit: Daniel Silverstone <[email protected]>
content, hlcache: Propagate query events upward
Signed-off-by: Daniel Silverstone <[email protected]>
diff --git a/content/content.h b/content/content.h
index 2d0646d..304384b 100644
--- a/content/content.h
+++ b/content/content.h
@@ -43,6 +43,7 @@ struct hlcache_handle;
struct object_params;
struct rect;
struct redraw_context;
+struct llcache_query_msg;
/** Status of a content */
typedef enum {
@@ -58,6 +59,8 @@ typedef enum {
/** Used in callbacks to indicate what has occurred. */
typedef enum {
CONTENT_MSG_LOG, /**< Content wishes to log something */
+ CONTENT_MSG_QUERY, /**< Something under the content has a query */
+ CONTENT_MSG_QUERY_FINISHED, /**< Something under the content finished
its query */
CONTENT_MSG_LOADING, /**< fetching or converting */
CONTENT_MSG_READY, /**< may be displayed */
CONTENT_MSG_DONE, /**< finished */
@@ -105,6 +108,10 @@ union content_msg_data {
size_t msglen; /**< The length of that message */
browser_window_console_flags flags; /**< The flags of the
logging */
} log;
+ /** CONTENT_MSG_QUERY - Query from underlying object somewhere */
+ const struct llcache_query_msg *query_msg;
+ /** CONTENT_MSG_QUERY_FINISHED - Query from underlying object finished
*/
+ void *query_finished_pw;
/** CONTENT_MSG_ERROR - Error message */
const char *error;
/** CONTENT_MSG_ERRORCODE - Error code */
diff --git a/content/hlcache.c b/content/hlcache.c
index c07c5a1..92bf690 100644
--- a/content/hlcache.c
+++ b/content/hlcache.c
@@ -519,18 +519,26 @@ static nserror hlcache_llcache_callback(llcache_handle
*handle,
}
break;
case LLCACHE_EVENT_QUERY:
- if (hlcache->params.llcache.cb != NULL) {
- return hlcache->params.llcache.cb(
- event->data.query.query,
- hlcache->params.llcache.cb_ctx,
- event->data.query.cb,
- event->data.query.cb_pw);
+ if (ctx->handle->cb != NULL) {
+ hlcache_event hlevent;
+
+ hlevent.type = CONTENT_MSG_QUERY;
+ hlevent.data.query_msg = &event->data.query;
+
+ ctx->handle->cb(ctx->handle, &hlevent, ctx->handle->pw);
} else {
return NSERROR_NOT_IMPLEMENTED;
}
break;
case LLCACHE_EVENT_QUERY_FINISHED:
- /* Currently nothing to do */
+ if (ctx->handle->cb != NULL) {
+ hlcache_event hlevent;
+
+ hlevent.type = CONTENT_MSG_QUERY_FINISHED;
+ hlevent.data.query_finished_pw =
event->data.query.cb_pw;
+
+ ctx->handle->cb(ctx->handle, &hlevent, ctx->handle->pw);
+ }
break;
}
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=f59a726f6899bd970ab5c1b853323442a6a9e473
commit f59a726f6899bd970ab5c1b853323442a6a9e473
Author: Daniel Silverstone <[email protected]>
Commit: Daniel Silverstone <[email protected]>
llcache.h: Migrate query event to own struct type
Signed-off-by: Daniel Silverstone <[email protected]>
diff --git a/content/llcache.h b/content/llcache.h
index 762edf0..dd2dadc 100644
--- a/content/llcache.h
+++ b/content/llcache.h
@@ -117,6 +117,15 @@ typedef enum {
} llcache_event_type;
/**
+ * Low-level cache query message
+ */
+typedef struct llcache_query_msg {
+ llcache_query *query; /**< Query information */
+ llcache_query_response cb; /**< Response callback */
+ void *cb_pw; /**< Response callback private word */
+} llcache_query_msg;
+
+/**
* Low-level cache events.
*
* Lifetime of contained information is only for the duration of the event
@@ -134,11 +143,7 @@ typedef struct {
nsurl *from; /**< Redirect origin */
nsurl *to; /**< Redirect target */
} redirect; /**< Fetch URL redirect occured */
- struct {
- llcache_query *query; /**< Query information */
- llcache_query_response cb; /**< Response callback */
- void *cb_pw; /**< Response callback private word */
- } query; /**< Query event */
+ llcache_query_msg query;/**< Query event */
} data; /**< Event data */
} llcache_event;
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=386d803371c94a4b10154fa544374dc7b09fb14a
commit 386d803371c94a4b10154fa544374dc7b09fb14a
Author: Daniel Silverstone <[email protected]>
Commit: Daniel Silverstone <[email protected]>
llcache: pass the cb_pw in query_finished
Signed-off-by: Daniel Silverstone <[email protected]>
diff --git a/content/llcache.c b/content/llcache.c
index 71282f2..06951e2 100644
--- a/content/llcache.c
+++ b/content/llcache.c
@@ -2270,6 +2270,7 @@ static nserror llcache_query_handle_response(bool
proceed, void *cbpw)
/* Tell all the users that we're leaving query state */
event.type = LLCACHE_EVENT_QUERY_FINISHED;
+ event.data.query.cb_pw = object;
/* Refetch, using existing fetch parameters, if client allows us to */
if (llcache_send_event_to_users(object, &event) == NSERROR_OK &&
proceed)
-----------------------------------------------------------------------
Summary of changes:
content/content.h | 7 +++++++
content/handlers/css/css.c | 9 ++++++++-
content/handlers/html/html_css.c | 10 ++++++++++
content/handlers/html/html_object.c | 10 ++++++++++
content/handlers/html/html_script.c | 30 ++++++++++++++++++++++++++++++
content/hlcache.c | 22 +++++++++++++++-------
content/llcache.c | 3 ++-
content/llcache.h | 15 ++++++++++-----
desktop/browser_private.h | 7 +++++++
desktop/browser_window.c | 24 ++++++++++++++++++++++++
desktop/netsurf.c | 11 ++++++++++-
desktop/searchweb.c | 20 ++++++++++++++++++++
desktop/treeview.c | 10 ++++++++++
frontends/riscos/gui/url_bar.c | 10 ++++++++++
14 files changed, 173 insertions(+), 15 deletions(-)
diff --git a/content/content.h b/content/content.h
index 2d0646d..304384b 100644
--- a/content/content.h
+++ b/content/content.h
@@ -43,6 +43,7 @@ struct hlcache_handle;
struct object_params;
struct rect;
struct redraw_context;
+struct llcache_query_msg;
/** Status of a content */
typedef enum {
@@ -58,6 +59,8 @@ typedef enum {
/** Used in callbacks to indicate what has occurred. */
typedef enum {
CONTENT_MSG_LOG, /**< Content wishes to log something */
+ CONTENT_MSG_QUERY, /**< Something under the content has a query */
+ CONTENT_MSG_QUERY_FINISHED, /**< Something under the content finished
its query */
CONTENT_MSG_LOADING, /**< fetching or converting */
CONTENT_MSG_READY, /**< may be displayed */
CONTENT_MSG_DONE, /**< finished */
@@ -105,6 +108,10 @@ union content_msg_data {
size_t msglen; /**< The length of that message */
browser_window_console_flags flags; /**< The flags of the
logging */
} log;
+ /** CONTENT_MSG_QUERY - Query from underlying object somewhere */
+ const struct llcache_query_msg *query_msg;
+ /** CONTENT_MSG_QUERY_FINISHED - Query from underlying object finished
*/
+ void *query_finished_pw;
/** CONTENT_MSG_ERROR - Error message */
const char *error;
/** CONTENT_MSG_ERRORCODE - Error code */
diff --git a/content/handlers/css/css.c b/content/handlers/css/css.c
index 0dcbe99..3e00879 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 2a2fde6..f65c255 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 1dc8e64..f49af65 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 2a72d51..5af4750 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/content/hlcache.c b/content/hlcache.c
index c07c5a1..92bf690 100644
--- a/content/hlcache.c
+++ b/content/hlcache.c
@@ -519,18 +519,26 @@ static nserror hlcache_llcache_callback(llcache_handle
*handle,
}
break;
case LLCACHE_EVENT_QUERY:
- if (hlcache->params.llcache.cb != NULL) {
- return hlcache->params.llcache.cb(
- event->data.query.query,
- hlcache->params.llcache.cb_ctx,
- event->data.query.cb,
- event->data.query.cb_pw);
+ if (ctx->handle->cb != NULL) {
+ hlcache_event hlevent;
+
+ hlevent.type = CONTENT_MSG_QUERY;
+ hlevent.data.query_msg = &event->data.query;
+
+ ctx->handle->cb(ctx->handle, &hlevent, ctx->handle->pw);
} else {
return NSERROR_NOT_IMPLEMENTED;
}
break;
case LLCACHE_EVENT_QUERY_FINISHED:
- /* Currently nothing to do */
+ if (ctx->handle->cb != NULL) {
+ hlcache_event hlevent;
+
+ hlevent.type = CONTENT_MSG_QUERY_FINISHED;
+ hlevent.data.query_finished_pw =
event->data.query.cb_pw;
+
+ ctx->handle->cb(ctx->handle, &hlevent, ctx->handle->pw);
+ }
break;
}
diff --git a/content/llcache.c b/content/llcache.c
index 71282f2..f3f4b68 100644
--- a/content/llcache.c
+++ b/content/llcache.c
@@ -397,7 +397,7 @@ static nserror llcache_send_event_to_users(llcache_object
*object,
user->iterator_target = was_target;
- if (user->queued_for_delete) {
+ if (user->queued_for_delete && !was_target) {
llcache_object_remove_user(object, user);
llcache_object_user_destroy(user);
}
@@ -2270,6 +2270,7 @@ static nserror llcache_query_handle_response(bool
proceed, void *cbpw)
/* Tell all the users that we're leaving query state */
event.type = LLCACHE_EVENT_QUERY_FINISHED;
+ event.data.query.cb_pw = object;
/* Refetch, using existing fetch parameters, if client allows us to */
if (llcache_send_event_to_users(object, &event) == NSERROR_OK &&
proceed)
diff --git a/content/llcache.h b/content/llcache.h
index 762edf0..dd2dadc 100644
--- a/content/llcache.h
+++ b/content/llcache.h
@@ -117,6 +117,15 @@ typedef enum {
} llcache_event_type;
/**
+ * Low-level cache query message
+ */
+typedef struct llcache_query_msg {
+ llcache_query *query; /**< Query information */
+ llcache_query_response cb; /**< Response callback */
+ void *cb_pw; /**< Response callback private word */
+} llcache_query_msg;
+
+/**
* Low-level cache events.
*
* Lifetime of contained information is only for the duration of the event
@@ -134,11 +143,7 @@ typedef struct {
nsurl *from; /**< Redirect origin */
nsurl *to; /**< Redirect target */
} redirect; /**< Fetch URL redirect occured */
- struct {
- llcache_query *query; /**< Query information */
- llcache_query_response cb; /**< Response callback */
- void *cb_pw; /**< Response callback private word */
- } query; /**< Query event */
+ llcache_query_msg query;/**< Query event */
} data; /**< Event data */
} llcache_event;
diff --git a/desktop/browser_private.h b/desktop/browser_private.h
index 31c261f..23fbf89 100644
--- a/desktop/browser_private.h
+++ b/desktop/browser_private.h
@@ -359,4 +359,11 @@ nserror browser_window_history_get_scroll(struct
browser_window *bw,
void browser_window_history_destroy(struct browser_window *bw);
+/** \todo QUERY - Remove this include */
+#include "content/llcache.h"
+/** \todo QUERY - Remove this import */
+nserror netsurf_llcache_query_handler(
+ const llcache_query *query,
+ void *pw, llcache_query_response cb, void *cbpw);
+
#endif
diff --git a/desktop/browser_window.c b/desktop/browser_window.c
index 920004a..e3eae6c 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/netsurf.c b/desktop/netsurf.c
index 73c91ea..041e98a 100644
--- a/desktop/netsurf.c
+++ b/desktop/netsurf.c
@@ -52,6 +52,10 @@
#include "desktop/gui_internal.h"
#include "netsurf/netsurf.h"
+
+/** \todo QUERY - Remove this import later */
+#include "desktop/browser_private.h"
+
/** speculative pre-conversion small image size
*
* Experimenting by visiting every page from default page in order and
@@ -293,13 +297,18 @@ static nserror netsurf__handle_login(const llcache_query
*query,
/**
* Dispatch a low-level cache query to the frontend
*
+ * \todo QUERY - This should end up as part of browser_window_callback
+ *
+ * NOTE: Right now this is exported so that it can be invoked from the
+ * browser window callback
+ *
* \param query Query descriptor
* \param pw Private data
* \param cb Continuation callback
* \param cbpw Private data for continuation
* \return NSERROR_OK
*/
-static nserror netsurf_llcache_query_handler(const llcache_query *query,
+nserror netsurf_llcache_query_handler(const llcache_query *query,
void *pw, llcache_query_response cb, void *cbpw)
{
nserror res = NSERROR_OK;
diff --git a/desktop/searchweb.c b/desktop/searchweb.c
index c07cac9..fed6f3e 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 8073664..d730e74 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 ee5c689..6fb3b2a 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;
}
--
NetSurf Browser
_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org