|
NetSurf
|
High-level resource cache interface. More...
#include "utils/errors.h"#include "utils/nsurl.h"#include "content/content.h"#include "content/llcache.h"Go to the source code of this file.
Data Structures | |
| struct | hlcache_child_context |
| Context for retrieving a child object. More... | |
| struct | hlcache_event |
| High-level cache event. More... | |
| struct | hlcache_parameters |
Typedefs | |
| typedef struct hlcache_handle | hlcache_handle |
| High-level cache handle. More... | |
| typedef struct hlcache_child_context | hlcache_child_context |
| Context for retrieving a child object. More... | |
| typedef struct hlcache_event | hlcache_event |
| High-level cache event. More... | |
| typedef nserror(* | hlcache_handle_callback) (hlcache_handle *handle, const hlcache_event *event, void *pw) |
| Client callback for high-level cache events. More... | |
Enumerations | |
| enum | hlcache_retrieve_flag { HLCACHE_RETRIEVE_MAY_DOWNLOAD = (1 << 31) , HLCACHE_RETRIEVE_SNIFF_TYPE = (1 << 30) } |
| Flags for high-level cache object retrieval. More... | |
Functions | |
| nserror | hlcache_initialise (const struct hlcache_parameters *hlcache_parameters) |
| Initialise the high-level cache, preparing the llcache also. More... | |
| void | hlcache_stop (void) |
| Stop the high-level cache periodic functionality so that the exit sequence can run. More... | |
| void | hlcache_finalise (void) |
| Finalise the high-level cache, destroying any remaining contents. More... | |
| nserror | hlcache_handle_retrieve (nsurl *url, uint32_t flags, nsurl *referer, llcache_post_data *post, hlcache_handle_callback cb, void *pw, hlcache_child_context *child, content_type accepted_types, hlcache_handle **result) |
| Retrieve a high-level cache handle for an object. More... | |
| nserror | hlcache_handle_release (hlcache_handle *handle) |
| Release a high-level cache handle. More... | |
| nserror | hlcache_handle_abort (hlcache_handle *handle) |
| Abort a high-level cache fetch. More... | |
| nserror | hlcache_handle_replace_callback (hlcache_handle *handle, hlcache_handle_callback cb, void *pw) |
| Replace a high-level cache handle's callback. More... | |
| struct content * | hlcache_handle_get_content (const hlcache_handle *handle) |
| Retrieve a content object from a cache handle. More... | |
| nserror | hlcache_handle_clone (hlcache_handle *handle, hlcache_handle **result) |
| Clone a high level cache handle. More... | |
High-level resource cache interface.
Definition in file hlcache.h.
| typedef struct hlcache_child_context hlcache_child_context |
Context for retrieving a child object.
| typedef struct hlcache_event hlcache_event |
High-level cache event.
| typedef struct hlcache_handle hlcache_handle |
| typedef nserror(* hlcache_handle_callback) (hlcache_handle *handle, const hlcache_event *event, void *pw) |
| void hlcache_finalise | ( | void | ) |
Finalise the high-level cache, destroying any remaining contents.
Definition at line 580 of file hlcache.c.
References hlcache_child_context::charset, hlcache_retrieval_ctx::child, hlcache_entry::content, content_count_users(), hlcache_s::content_list, guit, hlcache_retrieval_ctx::handle, hlcache_s::hit_count, hlcache, hlcache_clean(), hlcache_handle_get_url(), hlcache_retrieval_ctx::llcache, llcache_finalise(), llcache_handle_release(), netsurf_table::misc, hlcache_s::miss_count, hlcache_entry::next, NSLOG, nsurl_access(), hlcache_retrieval_ctx::r_next, hlcache_s::retrieval_ctx_ring, and gui_misc_table::schedule.
Referenced by netsurf_exit().
| nserror hlcache_handle_abort | ( | hlcache_handle * | handle | ) |
Abort a high-level cache fetch.
| handle | Handle to abort |
Definition at line 782 of file hlcache.c.
References hlcache_entry::content, content_abort(), content_add_user(), content_clone(), content_count_users(), content_destroy(), hlcache_s::content_list, content_remove_user(), hlcache_handle::entry, hlcache, hlcache_content_callback(), llcache_handle_abort(), llcache_handle_release(), hlcache_entry::next, NSERROR_NOMEM, NSERROR_OK, hlcache_entry::prev, hlcache_s::retrieval_ctx_ring, RING_ITERATE_END, RING_ITERATE_START, RING_ITERATE_STOP, and RING_REMOVE.
Referenced by browser_window_destroy_internal(), browser_window_stop(), html_css_process_modified_style(), and html_object_abort_objects().
| nserror hlcache_handle_clone | ( | hlcache_handle * | handle, |
| hlcache_handle ** | result | ||
| ) |
Clone a high level cache handle.
| handle | The handle to clone. |
| result | The cloned handle. |
Definition at line 865 of file hlcache.c.
References NSERROR_CLONE_FAILED, and result.
Referenced by print_init().
| struct content * hlcache_handle_get_content | ( | const hlcache_handle * | handle | ) |
Retrieve a content object from a cache handle.
| handle | Cache handle to dereference |
Definition at line 772 of file hlcache.c.
References hlcache_entry::content, and hlcache_handle::entry.
Referenced by browser_window_callback(), content_can_reformat(), content_clear_selection(), content_close(), content_debug(), content_debug_dump(), content_drop_file_at_point(), content_exec(), content_find_rfc5988_link(), content_get_available_width(), content_get_bitmap(), content_get_contextual_content(), content_get_encoding(), content_get_height(), content_get_mime_type(), content_get_opaque(), content_get_quirks(), content_get_refresh_url(), content_get_selection(), content_get_source_data(), content_get_status(), content_get_status_message(), content_get_title(), content_get_type(), content_get_width(), content_invalidate_reuse_data(), content_is_locked(), content_keypress(), content_mouse_action(), content_mouse_track(), content_open(), content_redraw(), content_reformat(), content_request_redraw(), content_saw_insecure_objects(), content_scaled_redraw(), content_scroll_at_point(), content_textsearch(), content_textsearch_clear(), html_get_base_target(), html_get_base_url(), html_get_box_tree(), html_get_document(), html_get_frameset(), html_get_iframe(), html_get_objects(), html_get_stylesheets(), html_set_file_gadget_filename(), nscss_content_done(), nscss_get_imports(), nscss_get_stylesheet(), nscss_register_import(), and save_complete_ctx_has_content().
| nserror hlcache_handle_release | ( | hlcache_handle * | handle | ) |
Release a high-level cache handle.
| handle | Handle to release |
Definition at line 736 of file hlcache.c.
References hlcache_handle::cb, hlcache_entry::content, content_remove_user(), hlcache_handle::entry, hlcache, hlcache_content_callback(), llcache_handle_abort(), llcache_handle_release(), NSERROR_OK, hlcache_handle::pw, hlcache_s::retrieval_ctx_ring, RING_ITERATE_END, RING_ITERATE_START, RING_ITERATE_STOP, and RING_REMOVE.
Referenced by browser_window__handle_error(), browser_window_content_ready(), browser_window_convert_to_download(), browser_window_destroy_internal(), browser_window_favicon_callback(), browser_window_stop(), convert_script_async_cb(), convert_script_defer_cb(), convert_script_sync_cb(), default_ico_callback(), html_convert_css_callback(), html_css_free_stylesheets(), html_css_process_modified_style(), html_object_abort_objects(), html_object_callback(), html_object_free_objects(), html_object_nobox_callback(), html_replace_object(), html_script_free(), nscss_destroy_css_data(), nscss_import(), print_cleanup(), ro_gui_url_bar_fini(), search_web_finalise(), search_web_ico_callback(), theme_install_close(), and treeview_fini().
| nserror hlcache_handle_replace_callback | ( | hlcache_handle * | handle, |
| hlcache_handle_callback | cb, | ||
| void * | pw | ||
| ) |
Replace a high-level cache handle's callback.
| handle | Handle to replace callback of |
| cb | New callback routine |
| pw | Private data for callback |
Definition at line 856 of file hlcache.c.
References hlcache_handle::cb, NSERROR_OK, and hlcache_handle::pw.
Referenced by theme_install_start().
| nserror hlcache_handle_retrieve | ( | nsurl * | url, |
| uint32_t | flags, | ||
| nsurl * | referer, | ||
| llcache_post_data * | post, | ||
| hlcache_handle_callback | cb, | ||
| void * | pw, | ||
| hlcache_child_context * | child, | ||
| content_type | accepted_types, | ||
| hlcache_handle ** | result | ||
| ) |
Retrieve a high-level cache handle for an object.
| url | URL of the object to retrieve handle for |
| flags | Object retrieval flags |
| referer | Referring URL, or NULL if none |
| post | POST data, or NULL for a GET request |
| cb | Callback to handle object events |
| pw | Pointer to client-specific data for callback |
| child | Child retrieval context, or NULL for top-level content |
| accepted_types | Bitmap of acceptable content types |
| result | Pointer to location to recieve cache handle |
Child contents are keyed on the tuple < URL, quirks >. The quirks field is ignored for child contents whose behaviour is not affected by quirks mode.
Definition at line 675 of file hlcache.c.
References hlcache_retrieval_ctx::accepted_types, hlcache_handle::cb, hlcache_child_context::charset, hlcache_retrieval_ctx::child, hlcache_retrieval_ctx::flags, hlcache_retrieval_ctx::handle, hlcache, hlcache_llcache_callback(), hlcache_retrieval_ctx::llcache, llcache_handle_retrieve(), NSERROR_NOMEM, NSERROR_OK, hlcache_handle::pw, hlcache_child_context::quirks, result, hlcache_s::retrieval_ctx_ring, and RING_INSERT.
Referenced by browser_window_favicon_callback(), browser_window_update_favicon(), exec_src_script(), html_css_new_stylesheets(), html_css_process_link(), html_css_quirks_stylesheets(), html_fetch_object(), html_replace_object(), html_stylesheet_from_domnode(), navigate_internal_real(), nscss_handle_import(), ro_gui_url_bar_init(), search_web_init(), search_web_select_provider(), and treeview_init_resources().
| nserror hlcache_initialise | ( | const struct hlcache_parameters * | hlcache_parameters | ) |
Initialise the high-level cache, preparing the llcache also.
| hlcache_parameters | Settings to initialise cache with |
Definition at line 548 of file hlcache.c.
References hlcache_parameters::bg_clean_time, guit, hlcache, hlcache_clean(), hlcache_parameters::llcache, llcache_initialise(), netsurf_table::misc, NSERROR_NOMEM, NSERROR_OK, hlcache_s::params, and gui_misc_table::schedule.
Referenced by netsurf_init().
| void hlcache_stop | ( | void | ) |
Stop the high-level cache periodic functionality so that the exit sequence can run.
Definition at line 573 of file hlcache.c.
References guit, hlcache_clean(), netsurf_table::misc, and gui_misc_table::schedule.
Referenced by netsurf_exit().