summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorcorvid <corvid@lavabit.com>2011-09-09 22:46:26 +0000
committercorvid <corvid@lavabit.com>2011-09-09 22:46:26 +0000
commit385da8286ca8f001a6f734dd322e5957ba50b63b (patch)
treecb8efd5ffe7330e923c46dfd417f0c77356856a3 /src
parent453b40b9ac2cab77f711286a0d7bd05197ec9499 (diff)
tiny a_Web_new() cleanup
Diffstat (limited to 'src')
-rw-r--r--src/html.cc6
-rw-r--r--src/nav.c6
-rw-r--r--src/web.cc5
-rw-r--r--src/web.hh3
4 files changed, 9 insertions, 11 deletions
diff --git a/src/html.cc b/src/html.cc
index 4cbcef1b..a50a183f 100644
--- a/src/html.cc
+++ b/src/html.cc
@@ -2138,8 +2138,7 @@ static bool Html_load_image(BrowserWindow *bw, DilloUrl *url,
DilloWeb *Web;
int ClientKey;
/* Fill a Web structure for the cache query */
- Web = a_Web_new(url, requester);
- Web->bw = bw;
+ Web = a_Web_new(bw, url, requester);
Web->Image = Image;
a_Image_ref(Image);
Web->flags |= WEB_Image;
@@ -2967,8 +2966,7 @@ void a_Html_load_stylesheet(DilloHtml *html, DilloUrl *url)
} else {
/* Fill a Web structure for the cache query */
int ClientKey;
- DilloWeb *Web = a_Web_new(url, html->page_url);
- Web->bw = html->bw;
+ DilloWeb *Web = a_Web_new(html->bw, url, html->page_url);
if ((ClientKey = a_Capi_open_url(Web, Html_css_load_callback, NULL))) {
++html->bw->NumPendingStyleSheets;
a_Bw_add_client(html->bw, ClientKey, 0);
diff --git a/src/nav.c b/src/nav.c
index 8dbb5044..bea90dd3 100644
--- a/src/nav.c
+++ b/src/nav.c
@@ -232,8 +232,7 @@ static void Nav_open_url(BrowserWindow *bw, const DilloUrl *url,
// a_Menu_pagemarks_new(bw);
- Web = a_Web_new(url, requester);
- Web->bw = bw;
+ Web = a_Web_new(bw, url, requester);
Web->flags |= WEB_RootUrl;
if ((ClientKey = a_Capi_open_url(Web, NULL, NULL)) != 0) {
a_Bw_add_client(bw, ClientKey, 1);
@@ -566,8 +565,7 @@ static void Nav_save_cb(int Op, CacheClient_t *Client)
void a_Nav_save_url(BrowserWindow *bw,
const DilloUrl *url, const char *filename)
{
- DilloWeb *Web = a_Web_new(url, NULL);
- Web->bw = bw;
+ DilloWeb *Web = a_Web_new(bw, url, NULL);
Web->filename = dStrdup(filename);
Web->flags |= WEB_Download;
/* TODO: keep track of this client */
diff --git a/src/web.cc b/src/web.cc
index 9daccdec..74851f2b 100644
--- a/src/web.cc
+++ b/src/web.cc
@@ -109,14 +109,15 @@ int a_Web_dispatch_by_type (const char *Type, DilloWeb *Web,
/*
* Allocate and set safe values for a DilloWeb structure
*/
-DilloWeb* a_Web_new(const DilloUrl *url, const DilloUrl *requester)
+DilloWeb* a_Web_new(BrowserWindow *bw, const DilloUrl *url,
+ const DilloUrl *requester)
{
DilloWeb *web= dNew(DilloWeb, 1);
_MSG(" a_Web_new: ValidWebs ==> %d\n", dList_length(ValidWebs));
web->url = a_Url_dup(url);
web->requester = a_Url_dup(requester);
- web->bw = NULL;
+ web->bw = bw;
web->flags = 0;
web->Image = NULL;
web->filename = NULL;
diff --git a/src/web.hh b/src/web.hh
index d017903a..2c22edb5 100644
--- a/src/web.hh
+++ b/src/web.hh
@@ -36,7 +36,8 @@ struct _DilloWeb {
};
void a_Web_init(void);
-DilloWeb* a_Web_new (const DilloUrl* url, const DilloUrl *requester);
+DilloWeb* a_Web_new (BrowserWindow *bw, const DilloUrl* url,
+ const DilloUrl *requester);
int a_Web_valid(DilloWeb *web);
void a_Web_free (DilloWeb*);
int a_Web_dispatch_by_type (const char *Type, DilloWeb *web,