diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2009-08-26 11:22:48 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2009-08-26 11:22:48 +0000 |
commit | e580e2bea9c05ad16fecd564eaf767fa34061859 (patch) | |
tree | 2448d9251762a41b4d9527cf6228f1ab923e1720 | |
parent | defdc423b57110040ce14b4eb9646aa36eaaada2 (diff) | |
download | netsurf-e580e2bea9c05ad16fecd564eaf767fa34061859.tar.gz netsurf-e580e2bea9c05ad16fecd564eaf767fa34061859.tar.bz2 |
Hack around cache issue. The entire cache layer needs a redesign asap.
svn path=/trunk/netsurf/; revision=9460
-rw-r--r-- | content/content.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/content/content.c b/content/content.c index 828423603..8a5cbe8d1 100644 --- a/content/content.c +++ b/content/content.c @@ -489,6 +489,33 @@ struct content * content_get(const char *url) if (c->status == CONTENT_STATUS_ERROR) /* error state */ continue; + /** \todo We need to reconsider the entire caching strategy in + * the light of data being shared between specific contents. + * + * For example, string dictionaries are owned by the document, + * and all stylesheets used by the document share the same + * dictionary. + * + * The CSS content handler retrieves the dictionary from its + * parent content. This relies upon there being a 1:1 mapping + * between documents and stylesheets. + * + * The type of a content is only known once we've received the + * headers from the fetch layer (and potentially some of the + * content data, too, if we ever sniff for the type). There + * is thus a problem with returning contents of unknown type + * here -- when we subsequently discover that they must only + * have one user, we clone them. By that point, however, we've + * no idea what the parent content is, which means that they + * end up with the wrong parent (and thus wrong dictionary). + * + * Of course, the problem with ignoring unknown content types + * here is that, for all the content types which may be shared, + * we end up duplicating them and wasting memory. Hence the + * need to reconsider everything. + */ + if (c->type == CONTENT_UNKNOWN) + continue; if (c->type != CONTENT_UNKNOWN && handler_map[c->type].no_share && c->user_list->next) |