r10082 jmb - in /branches/jmb/new-cache: css/css.c image/bmp.c image/gif.c image/ico.c image/jpeg.c image/mng.c image/nssprite.c image/png.c render/box.c render/box_construct.c render/directory.c render/favicon.c render/html.c render/textplain.c

netsurf at semichrome.net netsurf at semichrome.net
Thu Feb 25 01:10:32 GMT 2010


Author: jmb
Date: Wed Feb 24 19:10:32 2010
New Revision: 10082

URL: http://source.netsurf-browser.org?rev=10082&view=rev
Log:
Make content handlers use protected content API

Modified:
    branches/jmb/new-cache/css/css.c
    branches/jmb/new-cache/image/bmp.c
    branches/jmb/new-cache/image/gif.c
    branches/jmb/new-cache/image/ico.c
    branches/jmb/new-cache/image/jpeg.c
    branches/jmb/new-cache/image/mng.c
    branches/jmb/new-cache/image/nssprite.c
    branches/jmb/new-cache/image/png.c
    branches/jmb/new-cache/render/box.c
    branches/jmb/new-cache/render/box_construct.c
    branches/jmb/new-cache/render/directory.c
    branches/jmb/new-cache/render/favicon.c
    branches/jmb/new-cache/render/html.c
    branches/jmb/new-cache/render/textplain.c

Modified: branches/jmb/new-cache/css/css.c
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/css/css.c?rev=10082&r1=10081&r2=10082&view=diff
==============================================================================
--- branches/jmb/new-cache/css/css.c (original)
+++ branches/jmb/new-cache/css/css.c Wed Feb 24 19:10:32 2010
@@ -77,7 +77,7 @@
 		charset = c->fallback_charset;
 	}
 
-	if (nscss_create_css_data(&c->data.css, c->dict, content_get_url(c),
+	if (nscss_create_css_data(&c->data.css, c->dict, content__get_url(c),
 			charset, origin, media, c->quirks) != NSERROR_OK) {
 		msg_data.error = messages_get("NoMemory");
 		content_broadcast(c, CONTENT_MSG_ERROR, msg_data);

Modified: branches/jmb/new-cache/image/bmp.c
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/image/bmp.c?rev=10082&r1=10081&r2=10082&view=diff
==============================================================================
--- branches/jmb/new-cache/image/bmp.c (original)
+++ branches/jmb/new-cache/image/bmp.c Wed Feb 24 19:10:32 2010
@@ -76,7 +76,7 @@
 	/* set the bmp data */
 	bmp = c->data.bmp.bmp;
 
-	data = content_get_source_data(c, &size);
+	data = content__get_source_data(c, &size);
 
 	/* analyse the BMP */
 	res = bmp_analyse(bmp, size, (unsigned char *) data);

Modified: branches/jmb/new-cache/image/gif.c
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/image/gif.c?rev=10082&r1=10081&r2=10082&view=diff
==============================================================================
--- branches/jmb/new-cache/image/gif.c (original)
+++ branches/jmb/new-cache/image/gif.c Wed Feb 24 19:10:32 2010
@@ -90,7 +90,7 @@
 	/* Get the animation */
 	gif = c->data.gif.gif;
 
-	data = content_get_source_data(c, &size);
+	data = content__get_source_data(c, &size);
 
 	/* Initialise the GIF */
 	do {

Modified: branches/jmb/new-cache/image/ico.c
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/image/ico.c?rev=10082&r1=10081&r2=10082&view=diff
==============================================================================
--- branches/jmb/new-cache/image/ico.c (original)
+++ branches/jmb/new-cache/image/ico.c Wed Feb 24 19:10:32 2010
@@ -63,7 +63,7 @@
 	/* set the ico data */
 	ico = c->data.ico.ico;
 
-	data = content_get_source_data(c, &size);
+	data = content__get_source_data(c, &size);
 
 	/* analyse the ico */
 	res = ico_analyse(ico, size, (unsigned char *) data);

Modified: branches/jmb/new-cache/image/jpeg.c
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/image/jpeg.c?rev=10082&r1=10081&r2=10082&view=diff
==============================================================================
--- branches/jmb/new-cache/image/jpeg.c (original)
+++ branches/jmb/new-cache/image/jpeg.c Wed Feb 24 19:10:32 2010
@@ -92,7 +92,7 @@
 	const char *data;
 	unsigned long size;
 
-	data = content_get_source_data(c, &size);
+	data = content__get_source_data(c, &size);
 
 	cinfo.err = jpeg_std_error(&jerr.pub);
 	jerr.pub.error_exit = nsjpeg_error_exit;

Modified: branches/jmb/new-cache/image/mng.c
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/image/mng.c?rev=10082&r1=10081&r2=10082&view=diff
==============================================================================
--- branches/jmb/new-cache/image/mng.c (original)
+++ branches/jmb/new-cache/image/mng.c Wed Feb 24 19:10:32 2010
@@ -192,7 +192,7 @@
 
 	/*	Copy any data we have (maximum of 'size')
 	*/
-	data = content_get_source_data(c, &data_size);
+	data = content__get_source_data(c, &data_size);
 
 	*bytesread = ((data_size - c->data.mng.read_size) < size) ?
 			(data_size - c->data.mng.read_size) : size;
@@ -309,7 +309,7 @@
 
 	assert(c != NULL);
 
-	data = content_get_source_data(c, &size);
+	data = content__get_source_data(c, &size);
 
 	/* by this point, the png should have been parsed
 	 * and the bitmap created, so ensure that's the case
@@ -665,7 +665,7 @@
 	chunk[4] = '\0';
 
 	LOG(("error playing '%s' chunk %s (%d):", 
-			content_get_url(c), chunk, chunkseq));
+			content__get_url(c), chunk, chunkseq));
 	LOG(("code %d severity %d extra1 %d extra2 %d text:'%s'", code,
 					severity, extra1, extra2, text));
 

Modified: branches/jmb/new-cache/image/nssprite.c
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/image/nssprite.c?rev=10082&r1=10081&r2=10082&view=diff
==============================================================================
--- branches/jmb/new-cache/image/nssprite.c (original)
+++ branches/jmb/new-cache/image/nssprite.c Wed Feb 24 19:10:32 2010
@@ -65,7 +65,7 @@
 	const char *data;
 	unsigned long size;
 
-	data = content_get_source_data(c, &size);
+	data = content__get_source_data(c, &size);
 
 	ERRCHK(rosprite_create_mem_context((uint8_t *) data, size, &ctx));
 

Modified: branches/jmb/new-cache/image/png.c
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/image/png.c?rev=10082&r1=10081&r2=10082&view=diff
==============================================================================
--- branches/jmb/new-cache/image/png.c (original)
+++ branches/jmb/new-cache/image/png.c Wed Feb 24 19:10:32 2010
@@ -258,7 +258,7 @@
 	assert(c->data.png.png != NULL);
 	assert(c->data.png.info != NULL);
 
-	data = content_get_source_data(c, &size);
+	data = content__get_source_data(c, &size);
 
 	png_destroy_read_struct(&c->data.png.png, &c->data.png.info, 0);
 

Modified: branches/jmb/new-cache/render/box.c
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/render/box.c?rev=10082&r1=10081&r2=10082&view=diff
==============================================================================
--- branches/jmb/new-cache/render/box.c (original)
+++ branches/jmb/new-cache/render/box.c Wed Feb 24 19:10:32 2010
@@ -663,8 +663,10 @@
 				(int) box->length, box->text);
 	if (box->space)
 		fprintf(stream, "space ");
-	if (box->object)
-		fprintf(stream, "(object '%s') ", content_get_url(box->object));
+	if (box->object) {
+		fprintf(stream, "(object '%s') ", 
+				content__get_url(box->object));
+	}
 	if (box->gadget)
 		fprintf(stream, "(gadget) ");
 	if (box->style)

Modified: branches/jmb/new-cache/render/box_construct.c
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/render/box_construct.c?rev=10082&r1=10081&r2=10082&view=diff
==============================================================================
--- branches/jmb/new-cache/render/box_construct.c (original)
+++ branches/jmb/new-cache/render/box_construct.c Wed Feb 24 19:10:32 2010
@@ -841,7 +841,7 @@
 	if ((s = (char *) xmlGetProp(n, (const xmlChar *) "style"))) {
 		inline_style = nscss_create_inline_style(
 				(uint8_t *) s, strlen(s),
-				c->data.html.encoding, content_get_url(c), 
+				c->data.html.encoding, content__get_url(c), 
 				c->data.html.quirks != BINDING_QUIRKS_MODE_NONE,
 				c->data.html.dict, myrealloc, c);
 

Modified: branches/jmb/new-cache/render/directory.c
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/render/directory.c?rev=10082&r1=10081&r2=10082&view=diff
==============================================================================
--- branches/jmb/new-cache/render/directory.c (original)
+++ branches/jmb/new-cache/render/directory.c Wed Feb 24 19:10:32 2010
@@ -63,7 +63,7 @@
 	bool compare;
 	char *up;
 
-	path = url_to_path(content_get_url(c));
+	path = url_to_path(content__get_url(c));
 	if (!path) {
 		msg_data.error = messages_get("NoMemory");
 		content_broadcast(c, CONTENT_MSG_ERROR, msg_data);
@@ -99,9 +99,9 @@
 	binding_parse_chunk(c->data.html.parser_binding,
 			(uint8_t *) buffer, strlen(buffer));
 
-	res = url_parent(content_get_url(c), &up);
+	res = url_parent(content__get_url(c), &up);
 	if (res == URL_FUNC_OK) {
-		res = url_compare(content_get_url(c), up, false, &compare);
+		res = url_compare(content__get_url(c), up, false, &compare);
 		if ((res == URL_FUNC_OK) && !compare) {
 			snprintf(buffer, sizeof(buffer),
 				"<a href=\"..\">[..]</a>\n");
@@ -123,7 +123,7 @@
 			continue;
 
 		snprintf(buffer, sizeof(buffer), "<a href=\"%s/%s\">%s</a>\n",
-				content_get_url(c), entry->d_name, 
+				content__get_url(c), entry->d_name, 
 				entry->d_name);
 
 		binding_parse_chunk(c->data.html.parser_binding,

Modified: branches/jmb/new-cache/render/favicon.c
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/render/favicon.c?rev=10082&r1=10081&r2=10082&view=diff
==============================================================================
--- branches/jmb/new-cache/render/favicon.c (original)
+++ branches/jmb/new-cache/render/favicon.c Wed Feb 24 19:10:32 2010
@@ -154,7 +154,7 @@
 
 	c->data.html.favicon = favcontent;
 	
-	fetchcache_go(favcontent, content_get_url(c), 
+	fetchcache_go(favcontent, content__get_url(c), 
 			favicon_callback, (intptr_t) c, 0,
 			c->width, c->height, 0, 0, false, c);
 
@@ -193,7 +193,7 @@
 
 		if (*type == CONTENT_UNKNOWN) {
 			c->data.html.favicon = 0;
-			LOG(("%s is not a favicon", content_get_url(icon)));
+			LOG(("%s is not a favicon", content__get_url(icon)));
 			content_add_error(c, "NotFavIco", 0);
 			html_set_status(c, messages_get("NotFavIco"));
 			content_broadcast(c, CONTENT_MSG_STATUS, data);
@@ -213,14 +213,14 @@
 		break;
 
 	case CONTENT_MSG_DONE:
-		LOG(("got favicon '%s'", content_get_url(icon)));
+		LOG(("got favicon '%s'", content__get_url(icon)));
 		break;
 
 	case CONTENT_MSG_LAUNCH:
 		/* Fall through */
 	case CONTENT_MSG_ERROR:
 		LOG(("favicon %s failed: %s", 
-				content_get_url(icon), data.error));
+				content__get_url(icon), data.error));
 		/* The favicon we were fetching may have been
 		* redirected, in that case, the object pointers
 		* will differ, so ensure that the object that's

Modified: branches/jmb/new-cache/render/html.c
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/render/html.c?rev=10082&r1=10081&r2=10082&view=diff
==============================================================================
--- branches/jmb/new-cache/render/html.c (original)
+++ branches/jmb/new-cache/render/html.c Wed Feb 24 19:10:32 2010
@@ -126,7 +126,7 @@
 	html->document = 0;
 	html->quirks = BINDING_QUIRKS_MODE_NONE;
 	html->encoding = 0;
-	html->base_url = (char *) content_get_url(c);
+	html->base_url = (char *) content__get_url(c);
 	html->base_target = NULL;
 	html->layout = 0;
 	html->background_colour = NS_TRANSPARENT;
@@ -297,7 +297,7 @@
 		const char *source_data;
 		unsigned long source_size;
 
-		source_data = content_get_source_data(c, &source_size);
+		source_data = content__get_source_data(c, &source_size);
 
 		/* Recurse to reprocess all that data.  This is safe because
 		 * the encoding is now specified at parser-start which means
@@ -332,7 +332,7 @@
 	struct form *f;
 
 	/* finish parsing */
-	content_get_source_data(c, &size);
+	content__get_source_data(c, &size);
 	if (size == 0) {
 		/* Destroy current binding */
 		binding_destroy_tree(c->data.html.parser_binding);
@@ -697,7 +697,7 @@
 			/* Just delay specified, so refresh current page */
 			xmlFree(content);
 
-			c->refresh = talloc_strdup(c, content_get_url(c));
+			c->refresh = talloc_strdup(c, content__get_url(c));
 			if (!c->refresh) {
 				msg_data.error = messages_get("NoMemory");
 				content_broadcast(c,
@@ -848,7 +848,7 @@
 		goto no_memory;
 	c->active++;
 	fetchcache_go(c->data.html.stylesheets[STYLESHEET_BASE].data.external,
-			content_get_url(c), 
+			content__get_url(c), 
 			html_convert_css_callback, (intptr_t) c,
 			STYLESHEET_BASE, c->width, c->height,
 			0, 0, false, c);
@@ -865,7 +865,7 @@
 		c->active++;
 		fetchcache_go(c->data.html.stylesheets[STYLESHEET_QUIRKS].
 				data.external,
-				content_get_url(c), html_convert_css_callback,
+				content__get_url(c), html_convert_css_callback,
 				(intptr_t) c, STYLESHEET_QUIRKS, c->width,
 				c->height, 0, 0, false, c);
 	}
@@ -882,7 +882,7 @@
 		c->active++;
 		fetchcache_go(c->data.html.stylesheets[STYLESHEET_ADBLOCK].
 				data.external,
-				content_get_url(c), html_convert_css_callback,
+				content__get_url(c), html_convert_css_callback,
 				(intptr_t) c, STYLESHEET_ADBLOCK, c->width,
 				c->height, 0, 0, false, c);
 	}
@@ -994,7 +994,7 @@
 
 			c->active++;
 			fetchcache_go(c->data.html.stylesheets[i].data.external,
-					content_get_url(c),
+					content__get_url(c),
 					html_convert_css_callback,
 					(intptr_t) c, i, c->width, c->height,
 					0, 0, false, c);
@@ -1307,7 +1307,7 @@
 	c->active++;
 
 	/* start fetch */
-	fetchcache_go(c_fetch, content_get_url(c),
+	fetchcache_go(c_fetch, content__get_url(c),
 			html_object_callback, (intptr_t) c, i,
 			available_width, available_height,
 			0, 0, false, c);
@@ -1374,7 +1374,7 @@
 	}
 
 	/* start fetch */
-	fetchcache_go(c_fetch, content_get_url(c),
+	fetchcache_go(c_fetch, content__get_url(c),
 			html_object_callback, (intptr_t) c, i,
 			c->data.html.object[i].box->width,
 			c->data.html.object[i].box->height,

Modified: branches/jmb/new-cache/render/textplain.c
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/render/textplain.c?rev=10082&r1=10081&r2=10082&view=diff
==============================================================================
--- branches/jmb/new-cache/render/textplain.c (original)
+++ branches/jmb/new-cache/render/textplain.c Wed Feb 24 19:10:32 2010
@@ -143,7 +143,7 @@
 	const char *source_data;
 	unsigned long source_size;
 
-	source_data = content_get_source_data(c, &source_size);
+	source_data = content__get_source_data(c, &source_size);
 
 	do {
 		char *inbuf = (char *) source_data + 




More information about the netsurf-commits mailing list