diff --git a/src/ecmascript/see/window.c b/src/ecmascript/see/window.c index bfe37e353..fbf1b4069 100644 --- a/src/ecmascript/see/window.c +++ b/src/ecmascript/see/window.c @@ -49,7 +49,6 @@ static struct js_window_object *js_get_global_object(void *); static struct js_window_object *js_try_resolve_frame(struct document_view *, unsigned char *); static void delayed_open(void *); -static void delayed_goto_uri_frame(void *); static void window_get(struct SEE_interpreter *, struct SEE_object *, struct SEE_string *, struct SEE_value *); static void window_put(struct SEE_interpreter *, struct SEE_object *, struct SEE_string *, struct SEE_value *, int); static int window_canput(struct SEE_interpreter *, struct SEE_object *, struct SEE_string *); @@ -59,12 +58,6 @@ static void js_window_open(struct SEE_interpreter *, struct SEE_object *, struct void location_goto(struct document_view *, unsigned char *); -struct delayed_open { - struct session *ses; - struct uri *uri; - unsigned char *target; -}; - struct SEE_objectclass js_window_object_class = { NULL, window_get, @@ -113,21 +106,6 @@ delayed_open(void *data) mem_free(deo); } -static void -delayed_goto_uri_frame(void *data) -{ - struct delayed_open *deo = data; - struct frame *frame; - - assert(deo); - frame = ses_find_frame(deo->ses, deo->target); - if (frame) - goto_uri_frame(deo->ses, deo->uri, frame->name, CACHE_MODE_NORMAL); - done_uri(deo->uri); - mem_free(deo->target); - mem_free(deo); -} - static void diff --git a/src/ecmascript/spidermonkey/window.c b/src/ecmascript/spidermonkey/window.c index ad0017c1a..1bac6eebe 100644 --- a/src/ecmascript/spidermonkey/window.c +++ b/src/ecmascript/spidermonkey/window.c @@ -289,12 +289,6 @@ window_alert(JSContext *ctx, JSObject *obj, uintN argc, jsval *argv, jsval *rval return JS_TRUE; } -struct delayed_open { - struct session *ses; - struct uri *uri; - unsigned char *target; -}; - static void delayed_open(void *data) { @@ -306,17 +300,6 @@ delayed_open(void *data) mem_free(deo); } -static void -delayed_goto_uri_frame(void *data) -{ - struct delayed_open *deo = data; - - assert(deo); - goto_uri_frame(deo->ses, deo->uri, deo->target, CACHE_MODE_NORMAL); - done_uri(deo->uri); - mem_free(deo); -} - static JSBool window_open(JSContext *ctx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { diff --git a/src/session/session.h b/src/session/session.h index 1d16faf6f..bed302790 100644 --- a/src/session/session.h +++ b/src/session/session.h @@ -20,6 +20,13 @@ struct terminal; struct uri; struct window; +/* Used by delayed_open and delayed_goto_uri_frame. */ +struct delayed_open { + struct session *ses; + struct uri *uri; + unsigned char *target; +}; + enum remote_session_flags { SES_REMOTE_NEW_TAB = 1, SES_REMOTE_NEW_WINDOW = 2, diff --git a/src/session/task.c b/src/session/task.c index 5297ca904..81c8142aa 100644 --- a/src/session/task.c +++ b/src/session/task.c @@ -662,6 +662,21 @@ goto_uri_frame(struct session *ses, struct uri *uri, follow_url(ses, uri, target, TASK_FORWARD, cache_mode, 1); } +void +delayed_goto_uri_frame(void *data) +{ + struct delayed_open *deo = data; + struct frame *frame; + + assert(deo); + frame = ses_find_frame(deo->ses, deo->target); + if (frame) + goto_uri_frame(deo->ses, deo->uri, frame->name, CACHE_MODE_NORMAL); + done_uri(deo->uri); + mem_free(deo->target); + mem_free(deo); +} + /* menu_func_T */ void map_selected(struct terminal *term, void *ld_, void *ses_) diff --git a/src/session/task.h b/src/session/task.h index e1a7c9a8f..f61747bbc 100644 --- a/src/session/task.h +++ b/src/session/task.h @@ -27,6 +27,7 @@ struct uri *get_hooked_uri(unsigned char *uristring, struct session *ses, unsign void goto_uri(struct session *ses, struct uri *uri); void goto_uri_frame(struct session *, struct uri *, unsigned char *, enum cache_mode); +void delayed_goto_uri_frame(void *); void goto_url(struct session *, unsigned char *); void goto_url_with_hook(struct session *, unsigned char *); int goto_url_home(struct session *ses);