mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
Rename cache_entry.id and related members.
cache_entry.id => cache_entry.cache_id
document.id => document.cache_id
ecmascript_interpreter.onload_snippets_owner => .onload_snippets_cache_id
This is a combination of:
commit 232c07aa7f
bug 1009: id variables renamed, added document_id to the document.
commit 6007043458bf8f14abfc18b9db60785bdc0279f6
Revert addition of document.document_id
This commit is contained in:
parent
c1ffba2f95
commit
018af50f1d
6
src/cache/cache.c
vendored
6
src/cache/cache.c
vendored
@ -153,7 +153,7 @@ get_cache_entry(struct uri *uri)
|
|||||||
cached->valid = 1;
|
cached->valid = 1;
|
||||||
|
|
||||||
init_list(cached->frag);
|
init_list(cached->frag);
|
||||||
cached->id = id_counter++;
|
cached->cache_id = id_counter++;
|
||||||
object_nolock(cached, "cache_entry"); /* Debugging purpose. */
|
object_nolock(cached, "cache_entry"); /* Debugging purpose. */
|
||||||
|
|
||||||
cached->box_item = add_listbox_leaf(&cache_browser, NULL, cached);
|
cached->box_item = add_listbox_leaf(&cache_browser, NULL, cached);
|
||||||
@ -388,7 +388,7 @@ add_fragment(struct cache_entry *cached, off_t offset,
|
|||||||
|
|
||||||
/* id marks each entry, and change each time it's modified,
|
/* id marks each entry, and change each time it's modified,
|
||||||
* used in HTML renderer. */
|
* used in HTML renderer. */
|
||||||
cached->id = id_counter++;
|
cached->cache_id = id_counter++;
|
||||||
|
|
||||||
/* Possibly insert the new data in the middle of existing fragment. */
|
/* Possibly insert the new data in the middle of existing fragment. */
|
||||||
foreach (f, cached->frag) {
|
foreach (f, cached->frag) {
|
||||||
@ -642,7 +642,7 @@ delete_entry_content(struct cache_entry *cached)
|
|||||||
del_from_list(f);
|
del_from_list(f);
|
||||||
frag_free(f);
|
frag_free(f);
|
||||||
}
|
}
|
||||||
cached->id = id_counter++;
|
cached->cache_id = id_counter++;
|
||||||
cached->length = 0;
|
cached->length = 0;
|
||||||
cached->incomplete = 1;
|
cached->incomplete = 1;
|
||||||
|
|
||||||
|
2
src/cache/cache.h
vendored
2
src/cache/cache.h
vendored
@ -42,7 +42,7 @@ struct cache_entry {
|
|||||||
unsigned char *ssl_info; /* SSL ciphers used during transfer */
|
unsigned char *ssl_info; /* SSL ciphers used during transfer */
|
||||||
unsigned char *encoding_info; /* Encoding used during transfer */
|
unsigned char *encoding_info; /* Encoding used during transfer */
|
||||||
|
|
||||||
unsigned int id; /* Change each time entry is modified. */
|
unsigned int cache_id; /* Change each time entry is modified. */
|
||||||
|
|
||||||
time_t seconds; /* Access time. Used by 'If-Modified-Since' */
|
time_t seconds; /* Access time. Used by 'If-Modified-Since' */
|
||||||
|
|
||||||
|
2
src/cache/dialogs.c
vendored
2
src/cache/dialogs.c
vendored
@ -128,7 +128,7 @@ get_cache_entry_info(struct listbox_item *item, struct terminal *term)
|
|||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_DEBUG
|
#ifdef CONFIG_DEBUG
|
||||||
add_format_to_string(&msg, "\n%s: %d", "Refcount", get_object_refcount(cached));
|
add_format_to_string(&msg, "\n%s: %d", "Refcount", get_object_refcount(cached));
|
||||||
add_format_to_string(&msg, "\n%s: %u", _("ID", term), cached->id);
|
add_format_to_string(&msg, "\n%s: %u", _("ID", term), cached->cache_id);
|
||||||
|
|
||||||
if (cached->head && *cached->head) {
|
if (cached->head && *cached->head) {
|
||||||
add_format_to_string(&msg, "\n%s:\n\n%s", _("Header", term),
|
add_format_to_string(&msg, "\n%s:\n\n%s", _("Header", term),
|
||||||
|
@ -33,7 +33,6 @@
|
|||||||
#include "util/string.h"
|
#include "util/string.h"
|
||||||
#include "viewer/text/link.h"
|
#include "viewer/text/link.h"
|
||||||
|
|
||||||
|
|
||||||
static INIT_LIST_OF(struct document, format_cache);
|
static INIT_LIST_OF(struct document, format_cache);
|
||||||
|
|
||||||
struct document *
|
struct document *
|
||||||
@ -46,7 +45,7 @@ init_document(struct cache_entry *cached, struct document_options *options)
|
|||||||
document->uri = get_uri_reference(cached->uri);
|
document->uri = get_uri_reference(cached->uri);
|
||||||
|
|
||||||
object_lock(cached);
|
object_lock(cached);
|
||||||
document->id = cached->id;
|
document->cache_id = cached->cache_id;
|
||||||
document->cached = cached;
|
document->cached = cached;
|
||||||
|
|
||||||
init_list(document->forms);
|
init_list(document->forms);
|
||||||
@ -210,7 +209,7 @@ get_document_css_magic(struct document *document)
|
|||||||
foreach_uri (uri, index, &document->css_imports) {
|
foreach_uri (uri, index, &document->css_imports) {
|
||||||
struct cache_entry *cached = find_in_cache(uri);
|
struct cache_entry *cached = find_in_cache(uri);
|
||||||
|
|
||||||
if (cached) css_magic += cached->id + cached->data_size;
|
if (cached) css_magic += cached->cache_id + cached->data_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
return css_magic;
|
return css_magic;
|
||||||
@ -252,7 +251,7 @@ get_cached_document(struct cache_entry *cached, struct document_options *options
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (options->no_cache
|
if (options->no_cache
|
||||||
|| cached->id != document->id
|
|| cached->cache_id != document->cache_id
|
||||||
|| !check_document_css_magic(document)) {
|
|| !check_document_css_magic(document)) {
|
||||||
if (!is_object_used(document)) {
|
if (!is_object_used(document)) {
|
||||||
done_document(document);
|
done_document(document);
|
||||||
@ -285,7 +284,7 @@ shrink_format_cache(int whole)
|
|||||||
|
|
||||||
/* Destroy obsolete renderer documents which are already
|
/* Destroy obsolete renderer documents which are already
|
||||||
* out-of-sync. */
|
* out-of-sync. */
|
||||||
if (document->cached->id == document->id)
|
if (document->cached->cache_id == document->cache_id)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
done_document(document);
|
done_document(document);
|
||||||
|
@ -202,7 +202,7 @@ struct document {
|
|||||||
unsigned char buf[7];
|
unsigned char buf[7];
|
||||||
unsigned char buf_length;
|
unsigned char buf_length;
|
||||||
#endif
|
#endif
|
||||||
unsigned int id; /**< Used to check cache entries. */
|
unsigned int cache_id; /**< Used to check cache entries. */
|
||||||
|
|
||||||
int cp;
|
int cp;
|
||||||
int width, height; /**< size of document */
|
int width, height; /**< size of document */
|
||||||
|
@ -388,11 +388,12 @@ render_document(struct view_state *vs, struct document_view *doc_view,
|
|||||||
* XXX: What happens if a document is still loading in the
|
* XXX: What happens if a document is still loading in the
|
||||||
* other tab when we press ^L here? */
|
* other tab when we press ^L here? */
|
||||||
if (vs->ecmascript_fragile
|
if (vs->ecmascript_fragile
|
||||||
|| (vs->ecmascript && vs->ecmascript->onload_snippets_owner
|
|| (vs->ecmascript
|
||||||
&& document->id != vs->ecmascript->onload_snippets_owner))
|
&& vs->ecmascript->onload_snippets_cache_id
|
||||||
|
&& document->cache_id != vs->ecmascript->onload_snippets_cache_id))
|
||||||
ecmascript_reset_state(vs);
|
ecmascript_reset_state(vs);
|
||||||
assert(vs->ecmascript);
|
assert(vs->ecmascript);
|
||||||
vs->ecmascript->onload_snippets_owner = document->id;
|
vs->ecmascript->onload_snippets_cache_id = document->cache_id;
|
||||||
|
|
||||||
/* Passing of the onload_snippets pointers gives *_snippets()
|
/* Passing of the onload_snippets pointers gives *_snippets()
|
||||||
* some feeling of universality, shall we ever get any other
|
* some feeling of universality, shall we ever get any other
|
||||||
|
@ -52,7 +52,7 @@ struct ecmascript_interpreter {
|
|||||||
* ecmascript_fragile, but it can happen i.e. when the urrent document
|
* ecmascript_fragile, but it can happen i.e. when the urrent document
|
||||||
* is reloaded in another tab and then you just cause the current tab
|
* is reloaded in another tab and then you just cause the current tab
|
||||||
* to redraw. */
|
* to redraw. */
|
||||||
unsigned int onload_snippets_owner;
|
unsigned int onload_snippets_cache_id;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Why is the interpreter bound to {struct view_state} instead of {struct
|
/* Why is the interpreter bound to {struct view_state} instead of {struct
|
||||||
|
@ -67,7 +67,7 @@ check_document_fragment(struct session *ses, struct document_view *doc_view)
|
|||||||
struct cache_entry *cached = document->cached;
|
struct cache_entry *cached = document->cached;
|
||||||
|
|
||||||
assert(cached);
|
assert(cached);
|
||||||
if (cached->incomplete || cached->id != document->id) {
|
if (cached->incomplete || cached->cache_id != document->cache_id) {
|
||||||
done_string(&fragment);
|
done_string(&fragment);
|
||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user