diff options
author | Xan Lopez <xan@igalia.com> | 2013-02-13 07:23:11 +0800 |
---|---|---|
committer | Xan Lopez <xan@igalia.com> | 2013-02-13 07:23:11 +0800 |
commit | 7e0161351339d96b49e3c504ab5a0c0834a259b7 (patch) | |
tree | 7264c8adf28f777561f4165dcd3b4c80ec8dfb82 | |
parent | d80f4d4074c9f7fe402d9c4757f1042a2106dc90 (diff) | |
download | gsoc2013-epiphany-7e0161351339d96b49e3c504ab5a0c0834a259b7.tar gsoc2013-epiphany-7e0161351339d96b49e3c504ab5a0c0834a259b7.tar.gz gsoc2013-epiphany-7e0161351339d96b49e3c504ab5a0c0834a259b7.tar.bz2 gsoc2013-epiphany-7e0161351339d96b49e3c504ab5a0c0834a259b7.tar.lz gsoc2013-epiphany-7e0161351339d96b49e3c504ab5a0c0834a259b7.tar.xz gsoc2013-epiphany-7e0161351339d96b49e3c504ab5a0c0834a259b7.tar.zst gsoc2013-epiphany-7e0161351339d96b49e3c504ab5a0c0834a259b7.zip |
ephy-web-view: a few more type checks for public methods
-rw-r--r-- | embed/ephy-web-view.c | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c index aa2c3453c..ca5b170fd 100644 --- a/embed/ephy-web-view.c +++ b/embed/ephy-web-view.c @@ -3349,7 +3349,11 @@ ephy_web_view_get_navigation_flags (EphyWebView *view) const char * ephy_web_view_get_status_message (EphyWebView *view) { - EphyWebViewPrivate *priv = view->priv; + EphyWebViewPrivate *priv; + + g_return_val_if_fail (EPHY_IS_WEB_VIEW (view), NULL); + + priv = view->priv; if (priv->link_message && priv->link_message[0] != '\0') { return priv->link_message; @@ -3389,6 +3393,8 @@ ephy_web_view_get_link_message (EphyWebView *view) gboolean ephy_web_view_get_visibility (EphyWebView *view) { + g_return_val_if_fail (EPHY_IS_WEB_VIEW (view), FALSE); + return view->priv->visibility; } @@ -3404,7 +3410,11 @@ void ephy_web_view_set_link_message (EphyWebView *view, const char *link_message) { - EphyWebViewPrivate *priv = view->priv; + EphyWebViewPrivate *priv; + + g_return_if_fail (EPHY_IS_WEB_VIEW (view)); + + priv = view->priv; g_free (priv->link_message); @@ -3427,6 +3437,8 @@ ephy_web_view_set_security_level (EphyWebView *view, { EphyWebViewPrivate *priv = view->priv; + g_return_if_fail (EPHY_IS_WEB_VIEW (view)); + if (priv->security_level != level) { priv->security_level = level; @@ -3448,6 +3460,8 @@ ephy_web_view_set_visibility (EphyWebView *view, { EphyWebViewPrivate *priv = view->priv; + g_return_if_fail (EPHY_IS_WEB_VIEW (view)); + if (priv->visibility != visibility) { priv->visibility = visibility; @@ -3531,6 +3545,8 @@ ephy_web_view_has_modified_forms (EphyWebView *view) gulong forms_n; int i; + g_return_val_if_fail (EPHY_IS_WEB_VIEW (view), FALSE); + document = webkit_web_view_get_dom_document (WEBKIT_WEB_VIEW (view)); forms = webkit_dom_document_get_forms (document); forms_n = webkit_dom_html_collection_get_length (forms); @@ -3703,6 +3719,8 @@ ephy_web_view_print (EphyWebView *view) EphyEmbedShell *shell; GtkPrintSettings *settings; + g_return_if_fail (EPHY_IS_WEB_VIEW (view)); + shell = ephy_embed_shell_get_default (); operation = webkit_print_operation_new (WEBKIT_WEB_VIEW (view)); @@ -4053,6 +4071,9 @@ ephy_web_view_save (EphyWebView *view, const char *uri) const GString *data; #endif + g_return_if_fail (EPHY_IS_WEB_VIEW (view)); + g_return_if_fail (uri); + file = g_file_new_for_uri (uri); #ifdef HAVE_WEBKIT2 @@ -4100,6 +4121,8 @@ ephy_web_view_save (EphyWebView *view, const char *uri) void ephy_web_view_load_homepage (EphyWebView *view) { + g_return_if_fail (EPHY_IS_WEB_VIEW (view)); + g_signal_emit_by_name (view, "loading-homepage"); ephy_web_view_set_visit_type (view, |