|author||John Mark Bell <email@example.com>||2009-08-26 11:22:48 +0000|
|committer||John Mark Bell <firstname.lastname@example.org>||2009-08-26 11:22:48 +0000|
Hack around cache issue. The entire cache layer needs a redesign asap.
svn path=/trunk/netsurf/; revision=9460
Diffstat (limited to 'content/content.c')
1 files changed, 27 insertions, 0 deletions
diff --git a/content/content.c b/content/content.c
index 828423603..8a5cbe8d1 100644
@@ -489,6 +489,33 @@ struct content * content_get(const char *url)
if (c->status == CONTENT_STATUS_ERROR)
/* error state */
+ /** \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)
if (c->type != CONTENT_UNKNOWN &&