[epiphany] Purge g_return from src/



commit 4436c462de2c42f4b95e8b7ae305b57238bc16a6
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Wed Sep 13 09:33:33 2017 -0500

    Purge g_return from src/

 TODO                                          |    7 +---
 src/bookmarks/ephy-add-bookmark-popover.c     |    2 +-
 src/bookmarks/ephy-bookmark-properties-grid.c |    6 ++--
 src/bookmarks/ephy-bookmark-row.c             |    4 +-
 src/bookmarks/ephy-bookmark.c                 |   36 +++++++++---------
 src/bookmarks/ephy-bookmarks-manager.c        |   40 ++++++++++----------
 src/ephy-encoding-dialog.c                    |   10 +++---
 src/ephy-encoding-row.c                       |    4 +-
 src/ephy-header-bar.c                         |    8 ++--
 src/ephy-history-dialog.c                     |    4 +-
 src/ephy-location-controller.c                |    4 +-
 src/ephy-notebook.c                           |   10 +++---
 src/ephy-session.c                            |   24 ++++++------
 src/ephy-shell.c                              |   28 +++++++-------
 src/ephy-suggestion-model.c                   |   18 +++++-----
 src/ephy-window.c                             |   47 ++++++++++++-------------
 src/popup-commands.c                          |   10 +++---
 src/prefs-dialog.c                            |    6 ++--
 src/window-commands.c                         |   36 +++++++++---------
 19 files changed, 150 insertions(+), 154 deletions(-)
---
diff --git a/TODO b/TODO
index 840022f..31f8f96 100644
--- a/TODO
+++ b/TODO
@@ -6,13 +6,10 @@ Some TODO items, in no particular order:
 - Use G_SOURCE_CONTINUE/G_SOURCE_REMOVE.
 - Name all timeout and idle sources
 - Replace constructor functions with constructed functions
-- Use g_clear_object in dispose/finalize
-- Get rid of object references in dispose, not finalize
-- embed/ does not make much sense anymore as a name. Rename to
-  something else, perhaps core/? webview/?
+- Use g_clear_object/g_clear_pointer in dispose/finalize
+- Replace dispose with finalize wherever possible
 - Use GtkBuilder instead of declaring the UIs with C
 - We practically don't test any part of Epiphany, change that (how do
   you test UI code? There's like 3 or 4 frameworks for this, pick one?
   What does Chrome do?)
 - g_str_equal -> g_strcmp0 or strcmp except in hash maps
-- g_return -> g_assert more or less everywhere
diff --git a/src/bookmarks/ephy-add-bookmark-popover.c b/src/bookmarks/ephy-add-bookmark-popover.c
index bfe041b..c30350e 100644
--- a/src/bookmarks/ephy-add-bookmark-popover.c
+++ b/src/bookmarks/ephy-add-bookmark-popover.c
@@ -140,7 +140,7 @@ ephy_add_bookmark_popover_init (EphyAddBookmarkPopover *self)
 GtkWidget *
 ephy_add_bookmark_popover_new (EphyHeaderBar *header_bar)
 {
-  g_return_val_if_fail (EPHY_IS_HEADER_BAR (header_bar), NULL);
+  g_assert (EPHY_IS_HEADER_BAR (header_bar));
 
   return g_object_new (EPHY_TYPE_ADD_BOOKMARK_POPOVER,
                        "header-bar", header_bar,
diff --git a/src/bookmarks/ephy-bookmark-properties-grid.c b/src/bookmarks/ephy-bookmark-properties-grid.c
index eedb1f1..3bdd701 100644
--- a/src/bookmarks/ephy-bookmark-properties-grid.c
+++ b/src/bookmarks/ephy-bookmark-properties-grid.c
@@ -537,8 +537,8 @@ ephy_bookmark_properties_grid_new (EphyBookmark                   *bookmark,
                                    EphyBookmarkPropertiesGridType  type,
                                    GtkWidget                      *parent)
 {
-  g_return_val_if_fail (EPHY_IS_BOOKMARK (bookmark), NULL);
-  g_return_val_if_fail (GTK_IS_WIDGET (parent), NULL);
+  g_assert (EPHY_IS_BOOKMARK (bookmark));
+  g_assert (GTK_IS_WIDGET (parent));
 
   return g_object_new (EPHY_TYPE_BOOKMARK_PROPERTIES_GRID,
                        "bookmark", bookmark,
@@ -550,7 +550,7 @@ ephy_bookmark_properties_grid_new (EphyBookmark                   *bookmark,
 GtkWidget *
 ephy_bookmark_properties_grid_get_add_tag_button (EphyBookmarkPropertiesGrid *self)
 {
-  g_return_val_if_fail (EPHY_IS_BOOKMARK_PROPERTIES_GRID (self), NULL);
+  g_assert (EPHY_IS_BOOKMARK_PROPERTIES_GRID (self));
 
   return self->add_tag_button;
 }
diff --git a/src/bookmarks/ephy-bookmark-row.c b/src/bookmarks/ephy-bookmark-row.c
index 7d2526a..5027444 100644
--- a/src/bookmarks/ephy-bookmark-row.c
+++ b/src/bookmarks/ephy-bookmark-row.c
@@ -234,7 +234,7 @@ ephy_bookmark_row_new (EphyBookmark *bookmark)
 EphyBookmark *
 ephy_bookmark_row_get_bookmark (EphyBookmarkRow *self)
 {
-  g_return_val_if_fail (EPHY_IS_BOOKMARK_ROW (self), NULL);
+  g_assert (EPHY_IS_BOOKMARK_ROW (self));
 
   return self->bookmark;
 }
@@ -242,7 +242,7 @@ ephy_bookmark_row_get_bookmark (EphyBookmarkRow *self)
 const char *
 ephy_bookmark_row_get_bookmark_url (EphyBookmarkRow *self)
 {
-  g_return_val_if_fail (EPHY_IS_BOOKMARK_ROW (self), NULL);
+  g_assert (EPHY_IS_BOOKMARK_ROW (self));
 
   return ephy_bookmark_get_url (self->bookmark);
 }
diff --git a/src/bookmarks/ephy-bookmark.c b/src/bookmarks/ephy-bookmark.c
index 0bb4cbb..2af41e0 100644
--- a/src/bookmarks/ephy-bookmark.c
+++ b/src/bookmarks/ephy-bookmark.c
@@ -305,7 +305,7 @@ void
 ephy_bookmark_set_time_added (EphyBookmark *self,
                               gint64        time_added)
 {
-  g_return_if_fail (EPHY_IS_BOOKMARK (self));
+  g_assert (EPHY_IS_BOOKMARK (self));
   g_assert (time_added >= 0);
 
   self->time_added = time_added;
@@ -314,7 +314,7 @@ ephy_bookmark_set_time_added (EphyBookmark *self,
 gint64
 ephy_bookmark_get_time_added (EphyBookmark *self)
 {
-  g_return_val_if_fail (EPHY_IS_BOOKMARK (self), 0);
+  g_assert (EPHY_IS_BOOKMARK (self));
 
   return self->time_added;
 }
@@ -323,7 +323,7 @@ ephy_bookmark_get_time_added (EphyBookmark *self)
 void
 ephy_bookmark_set_url (EphyBookmark *self, const char *url)
 {
-  g_return_if_fail (EPHY_IS_BOOKMARK (self));
+  g_assert (EPHY_IS_BOOKMARK (self));
 
   g_free (self->url);
   self->url = g_strdup (url);
@@ -332,7 +332,7 @@ ephy_bookmark_set_url (EphyBookmark *self, const char *url)
 const char *
 ephy_bookmark_get_url (EphyBookmark *self)
 {
-  g_return_val_if_fail (EPHY_IS_BOOKMARK (self), NULL);
+  g_assert (EPHY_IS_BOOKMARK (self));
 
   return self->url;
 }
@@ -340,7 +340,7 @@ ephy_bookmark_get_url (EphyBookmark *self)
 void
 ephy_bookmark_set_title (EphyBookmark *self, const char *title)
 {
-  g_return_if_fail (EPHY_IS_BOOKMARK (self));
+  g_assert (EPHY_IS_BOOKMARK (self));
 
   g_free (self->title);
   self->title = g_strdup (title);
@@ -350,7 +350,7 @@ ephy_bookmark_set_title (EphyBookmark *self, const char *title)
 const char *
 ephy_bookmark_get_title (EphyBookmark *bookmark)
 {
-  g_return_val_if_fail (EPHY_IS_BOOKMARK (bookmark), NULL);
+  g_assert (EPHY_IS_BOOKMARK (bookmark));
 
   return bookmark->title;
 }
@@ -359,8 +359,8 @@ void
 ephy_bookmark_set_id (EphyBookmark *self,
                       const char   *id)
 {
-  g_return_if_fail (EPHY_IS_BOOKMARK (self));
-  g_return_if_fail (id != NULL);
+  g_assert (EPHY_IS_BOOKMARK (self));
+  g_assert (id != NULL);
 
   g_free (self->id);
   self->id = g_strdup (id);
@@ -369,7 +369,7 @@ ephy_bookmark_set_id (EphyBookmark *self,
 const char *
 ephy_bookmark_get_id (EphyBookmark *self)
 {
-  g_return_val_if_fail (EPHY_IS_BOOKMARK (self), NULL);
+  g_assert (EPHY_IS_BOOKMARK (self));
 
   return self->id;
 }
@@ -381,7 +381,7 @@ ephy_bookmark_set_is_uploaded (EphyBookmark *self,
 
   /* FIXME: This is no longer used for Firefox Sync, but bookmarks import/export
    * expects it. We need to delete it and write a migrator for bookmarks. */
-  g_return_if_fail (EPHY_IS_BOOKMARK (self));
+  g_assert (EPHY_IS_BOOKMARK (self));
 }
 
 gboolean
@@ -389,7 +389,7 @@ ephy_bookmark_is_uploaded (EphyBookmark *self)
 {
   /* FIXME: This is no longer used for Firefox Sync, but bookmarks import/export
    * expects it. We need to delete it and write a migrator for bookmarks. */
-  g_return_val_if_fail (EPHY_IS_BOOKMARK (self), FALSE);
+  g_assert (EPHY_IS_BOOKMARK (self));
 
   return FALSE;
 }
@@ -401,8 +401,8 @@ ephy_bookmark_add_tag (EphyBookmark *self,
   GSequenceIter *tag_iter;
   GSequenceIter *prev_tag_iter;
 
-  g_return_if_fail (EPHY_IS_BOOKMARK (self));
-  g_return_if_fail (tag != NULL);
+  g_assert (EPHY_IS_BOOKMARK (self));
+  g_assert (tag != NULL);
 
   tag_iter = g_sequence_search (self->tags,
                                 (gpointer)tag,
@@ -423,8 +423,8 @@ ephy_bookmark_remove_tag (EphyBookmark *self,
 {
   GSequenceIter *tag_iter;
 
-  g_return_if_fail (EPHY_IS_BOOKMARK (self));
-  g_return_if_fail (tag != NULL);
+  g_assert (EPHY_IS_BOOKMARK (self));
+  g_assert (tag != NULL);
 
   tag_iter = g_sequence_lookup (self->tags,
                                 (gpointer)tag,
@@ -442,8 +442,8 @@ ephy_bookmark_has_tag (EphyBookmark *self, const char *tag)
 {
   GSequenceIter *tag_iter;
 
-  g_return_val_if_fail (EPHY_IS_BOOKMARK (self), FALSE);
-  g_return_val_if_fail (tag != NULL, FALSE);
+  g_assert (EPHY_IS_BOOKMARK (self));
+  g_assert (tag != NULL);
 
   tag_iter = g_sequence_lookup (self->tags,
                                 (gpointer)tag,
@@ -456,7 +456,7 @@ ephy_bookmark_has_tag (EphyBookmark *self, const char *tag)
 GSequence *
 ephy_bookmark_get_tags (EphyBookmark *self)
 {
-  g_return_val_if_fail (EPHY_IS_BOOKMARK (self), NULL);
+  g_assert (EPHY_IS_BOOKMARK (self));
 
   return self->tags;
 }
diff --git a/src/bookmarks/ephy-bookmarks-manager.c b/src/bookmarks/ephy-bookmarks-manager.c
index 93a8f0a..ae0ce13 100644
--- a/src/bookmarks/ephy-bookmarks-manager.c
+++ b/src/bookmarks/ephy-bookmarks-manager.c
@@ -338,8 +338,8 @@ void
 ephy_bookmarks_manager_add_bookmark (EphyBookmarksManager *self,
                                      EphyBookmark         *bookmark)
 {
-  g_return_if_fail (EPHY_IS_BOOKMARKS_MANAGER (self));
-  g_return_if_fail (EPHY_IS_BOOKMARK (bookmark));
+  g_assert (EPHY_IS_BOOKMARKS_MANAGER (self));
+  g_assert (EPHY_IS_BOOKMARK (bookmark));
 
   ephy_bookmarks_manager_add_bookmark_internal (self, bookmark, TRUE);
   g_signal_emit_by_name (self, "synchronizable-modified", bookmark, FALSE);
@@ -351,8 +351,8 @@ ephy_bookmarks_manager_add_bookmarks (EphyBookmarksManager *self,
 {
   GSequenceIter *iter;
 
-  g_return_if_fail (EPHY_IS_BOOKMARKS_MANAGER (self));
-  g_return_if_fail (bookmarks != NULL);
+  g_assert (EPHY_IS_BOOKMARKS_MANAGER (self));
+  g_assert (bookmarks != NULL);
 
   for (iter = g_sequence_get_begin_iter (bookmarks);
        !g_sequence_iter_is_end (iter); iter = g_sequence_iter_next (iter)) {
@@ -407,8 +407,8 @@ ephy_bookmarks_manager_remove_bookmark_internal (EphyBookmarksManager *self,
 void ephy_bookmarks_manager_remove_bookmark (EphyBookmarksManager *self,
                                              EphyBookmark         *bookmark)
 {
-  g_return_if_fail (EPHY_IS_BOOKMARKS_MANAGER (self));
-  g_return_if_fail (EPHY_IS_BOOKMARK (bookmark));
+  g_assert (EPHY_IS_BOOKMARKS_MANAGER (self));
+  g_assert (EPHY_IS_BOOKMARK (bookmark));
 
   g_signal_emit_by_name (self, "synchronizable-deleted", bookmark);
   ephy_bookmarks_manager_remove_bookmark_internal (self, bookmark);
@@ -420,8 +420,8 @@ ephy_bookmarks_manager_get_bookmark_by_url (EphyBookmarksManager *self,
 {
   GSequenceIter *iter;
 
-  g_return_val_if_fail (EPHY_IS_BOOKMARKS_MANAGER (self), FALSE);
-  g_return_val_if_fail (url != NULL, FALSE);
+  g_assert (EPHY_IS_BOOKMARKS_MANAGER (self));
+  g_assert (url != NULL);
 
   for (iter = g_sequence_get_begin_iter (self->bookmarks);
          !g_sequence_iter_is_end (iter);
@@ -441,8 +441,8 @@ ephy_bookmarks_manager_get_bookmark_by_id (EphyBookmarksManager *self,
 {
   GSequenceIter *iter;
 
-  g_return_val_if_fail (EPHY_IS_BOOKMARKS_MANAGER (self), FALSE);
-  g_return_val_if_fail (id != NULL, FALSE);
+  g_assert (EPHY_IS_BOOKMARKS_MANAGER (self));
+  g_assert (id != NULL);
 
   for (iter = g_sequence_get_begin_iter (self->bookmarks);
        !g_sequence_iter_is_end (iter);
@@ -462,8 +462,8 @@ ephy_bookmarks_manager_create_tag (EphyBookmarksManager *self, const char *tag)
   GSequenceIter *tag_iter;
   GSequenceIter *prev_tag_iter;
 
-  g_return_if_fail (EPHY_IS_BOOKMARKS_MANAGER (self));
-  g_return_if_fail (tag != NULL);
+  g_assert (EPHY_IS_BOOKMARKS_MANAGER (self));
+  g_assert (tag != NULL);
 
   tag_iter = g_sequence_search (self->tags,
                                 (gpointer)tag,
@@ -484,8 +484,8 @@ ephy_bookmarks_manager_delete_tag (EphyBookmarksManager *self, const char *tag)
   GSequenceIter *iter = NULL;
   int position;
 
-  g_return_if_fail (EPHY_IS_BOOKMARKS_MANAGER (self));
-  g_return_if_fail (tag != NULL);
+  g_assert (EPHY_IS_BOOKMARKS_MANAGER (self));
+  g_assert (tag != NULL);
 
   if (strcmp (tag, EPHY_BOOKMARKS_FAVORITES_TAG) == 0)
     return;
@@ -511,8 +511,8 @@ ephy_bookmarks_manager_tag_exists (EphyBookmarksManager *self, const char *tag)
 {
   GSequenceIter *iter;
 
-  g_return_val_if_fail (EPHY_IS_BOOKMARKS_MANAGER (self), FALSE);
-  g_return_val_if_fail (tag != NULL, FALSE);
+  g_assert (EPHY_IS_BOOKMARKS_MANAGER (self));
+  g_assert (tag != NULL);
 
   iter = g_sequence_lookup (self->tags,
                             (gpointer)tag,
@@ -525,7 +525,7 @@ ephy_bookmarks_manager_tag_exists (EphyBookmarksManager *self, const char *tag)
 GSequence *
 ephy_bookmarks_manager_get_bookmarks (EphyBookmarksManager *self)
 {
-  g_return_val_if_fail (EPHY_IS_BOOKMARKS_MANAGER (self), NULL);
+  g_assert (EPHY_IS_BOOKMARKS_MANAGER (self));
 
   return self->bookmarks;
 }
@@ -537,7 +537,7 @@ ephy_bookmarks_manager_get_bookmarks_with_tag (EphyBookmarksManager *self,
   GSequence *bookmarks;
   GSequenceIter *iter;
 
-  g_return_val_if_fail (EPHY_IS_BOOKMARKS_MANAGER (self), NULL);
+  g_assert (EPHY_IS_BOOKMARKS_MANAGER (self));
 
   bookmarks = g_sequence_new (g_object_unref);
 
@@ -574,7 +574,7 @@ ephy_bookmarks_manager_get_bookmarks_with_tag (EphyBookmarksManager *self,
 GSequence *
 ephy_bookmarks_manager_get_tags (EphyBookmarksManager *self)
 {
-  g_return_val_if_fail (EPHY_IS_BOOKMARKS_MANAGER (self), NULL);
+  g_assert (EPHY_IS_BOOKMARKS_MANAGER (self));
 
   return self->tags;
 }
@@ -599,7 +599,7 @@ ephy_bookmarks_manager_save_to_file_finish (EphyBookmarksManager *self,
                                             GAsyncResult         *result,
                                             GError              **error)
 {
-  g_return_val_if_fail (g_task_is_valid (result, self), FALSE);
+  g_assert (g_task_is_valid (result, self));
 
   return g_task_propagate_boolean (G_TASK (result), error);
 }
diff --git a/src/ephy-encoding-dialog.c b/src/ephy-encoding-dialog.c
index f3b7468..f9304a2 100644
--- a/src/ephy-encoding-dialog.c
+++ b/src/ephy-encoding-dialog.c
@@ -113,7 +113,7 @@ sync_encoding_against_embed (EphyEncodingDialog *dialog)
 
   dialog->update_embed_tag = TRUE;
 
-  g_return_if_fail (EPHY_IS_EMBED (dialog->embed));
+  g_assert (EPHY_IS_EMBED (dialog->embed));
   view = EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (dialog->embed);
 
   encoding = webkit_web_view_get_custom_charset (view);
@@ -170,7 +170,7 @@ ephy_encoding_dialog_attach_embed (EphyEncodingDialog *dialog)
   EphyEmbed **embedptr;
 
   embed = ephy_embed_container_get_active_child (EPHY_EMBED_CONTAINER (dialog->window));
-  g_return_if_fail (EPHY_IS_EMBED (embed));
+  g_assert (EPHY_IS_EMBED (embed));
 
   g_signal_connect (G_OBJECT (ephy_embed_get_web_view (embed)), "load-changed",
                     G_CALLBACK (embed_net_stop_cb), dialog);
@@ -195,7 +195,7 @@ activate_choice (EphyEncodingDialog *dialog)
 {
   WebKitWebView *view;
 
-  g_return_if_fail (EPHY_IS_EMBED (dialog->embed));
+  g_assert (EPHY_IS_EMBED (dialog->embed));
   view = EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (dialog->embed);
 
   if (gtk_switch_get_active (dialog->default_switch)) {
@@ -381,7 +381,7 @@ ephy_encoding_dialog_constructed (GObject *object)
   /* selected encoding */
   dialog = EPHY_ENCODING_DIALOG (object);
 
-  g_return_if_fail (EPHY_IS_EMBED (dialog->embed));
+  g_assert (EPHY_IS_EMBED (dialog->embed));
   view = EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (dialog->embed);
 
   dialog->selected_encoding = webkit_web_view_get_custom_charset (view);
@@ -434,7 +434,7 @@ static void
 ephy_encoding_dialog_set_parent_window (EphyEncodingDialog *dialog,
                                         EphyWindow         *window)
 {
-  g_return_if_fail (EPHY_IS_WINDOW (window));
+  g_assert (EPHY_IS_WINDOW (window));
 
   g_signal_connect (G_OBJECT (window), "notify::active-child",
                     G_CALLBACK (ephy_encoding_dialog_sync_embed), dialog);
diff --git a/src/ephy-encoding-row.c b/src/ephy-encoding-row.c
index 2779767..3fabc1e 100644
--- a/src/ephy-encoding-row.c
+++ b/src/ephy-encoding-row.c
@@ -50,7 +50,7 @@ void
 ephy_encoding_row_set_selected (EphyEncodingRow *row,
                                 gboolean         selected)
 {
-  g_return_if_fail (EPHY_IS_ENCODING_ROW (row));
+  g_assert (EPHY_IS_ENCODING_ROW (row));
 
   if (selected)
     gtk_widget_show (GTK_WIDGET (row->selected_image));
@@ -68,7 +68,7 @@ static void
 ephy_encoding_row_set_encoding (EphyEncodingRow *self,
                                 EphyEncoding    *encoding)
 {
-  g_return_if_fail (EPHY_IS_ENCODING (encoding));
+  g_assert (EPHY_IS_ENCODING (encoding));
 
   self->encoding = encoding;
   gtk_label_set_text (self->encoding_label,
diff --git a/src/ephy-header-bar.c b/src/ephy-header-bar.c
index 4169dcd..dca18dc 100644
--- a/src/ephy-header-bar.c
+++ b/src/ephy-header-bar.c
@@ -283,7 +283,7 @@ new_history_menu_item (EphyWebView *view,
   WebKitFaviconDatabase *database;
   EphyEmbedShell *shell = ephy_embed_shell_get_default ();
 
-  g_return_val_if_fail (address != NULL && origtext != NULL, NULL);
+  g_assert (address != NULL && origtext != NULL);
 
   box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
 
@@ -328,7 +328,7 @@ middle_click_handle_on_history_menu_item (EphyEmbed                 *embed,
                                   EPHY_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (embed))),
                                   embed,
                                   0);
-  g_return_if_fail (new_embed != NULL);
+  g_assert (new_embed != NULL);
 
   /* Load the new URL */
   url = webkit_back_forward_list_item_get_original_uri (item);
@@ -383,7 +383,7 @@ build_dropdown_menu (EphyWindow                    *window,
   WebKitWebView *web_view;
 
   embed = ephy_embed_container_get_active_child (EPHY_EMBED_CONTAINER (window));
-  g_return_val_if_fail (embed != NULL, NULL);
+  g_assert (embed != NULL);
 
   menu = GTK_MENU_SHELL (gtk_menu_new ());
 
@@ -877,7 +877,7 @@ ephy_header_bar_class_init (EphyHeaderBarClass *klass)
 GtkWidget *
 ephy_header_bar_new (EphyWindow *window)
 {
-  g_return_val_if_fail (EPHY_IS_WINDOW (window), NULL);
+  g_assert (EPHY_IS_WINDOW (window));
 
   return GTK_WIDGET (g_object_new (EPHY_TYPE_HEADER_BAR,
                                    "show-close-button", TRUE,
diff --git a/src/ephy-history-dialog.c b/src/ephy-history-dialog.c
index 72d93c5..0e617d9 100644
--- a/src/ephy-history-dialog.c
+++ b/src/ephy-history-dialog.c
@@ -475,7 +475,7 @@ on_treeview_row_activated (GtkTreeView       *view,
   window = EPHY_WINDOW (get_target_window (self));
   url = get_url_from_path (gtk_tree_view_get_model (view),
                            path);
-  g_return_if_fail (url != NULL);
+  g_assert (url != NULL);
 
   embed = ephy_shell_new_tab (ephy_shell_get_default (),
                               window, NULL, EPHY_NEW_TAB_JUMP);
@@ -741,7 +741,7 @@ ephy_history_dialog_new (EphyHistoryService *history_service)
 {
   EphyHistoryDialog *self;
 
-  g_return_val_if_fail (history_service != NULL, NULL);
+  g_assert (history_service != NULL);
 
   self = g_object_new (EPHY_TYPE_HISTORY_DIALOG,
                        "use-header-bar", TRUE,
diff --git a/src/ephy-location-controller.c b/src/ephy-location-controller.c
index 9e8ddba..f46e232 100644
--- a/src/ephy-location-controller.c
+++ b/src/ephy-location-controller.c
@@ -489,7 +489,7 @@ ephy_location_controller_finalize (GObject *object)
 const char *
 ephy_location_controller_get_address (EphyLocationController *controller)
 {
-  g_return_val_if_fail (EPHY_IS_LOCATION_CONTROLLER (controller), "");
+  g_assert (EPHY_IS_LOCATION_CONTROLLER (controller));
 
   return controller->address;
 }
@@ -505,7 +505,7 @@ void
 ephy_location_controller_set_address (EphyLocationController *controller,
                                       const char             *address)
 {
-  g_return_if_fail (EPHY_IS_LOCATION_CONTROLLER (controller));
+  g_assert (EPHY_IS_LOCATION_CONTROLLER (controller));
 
   LOG ("set_address %s", address);
 
diff --git a/src/ephy-notebook.c b/src/ephy-notebook.c
index 333cb5f..1510830 100644
--- a/src/ephy-notebook.c
+++ b/src/ephy-notebook.c
@@ -187,7 +187,7 @@ find_tab_num_at_pos (EphyNotebook *notebook, gint abs_x, gint abs_y)
     gint x_root, y_root;
 
     tab = gtk_notebook_get_tab_label (nb, page);
-    g_return_val_if_fail (tab != NULL, -1);
+    g_assert (tab != NULL);
 
     if (!gtk_widget_get_mapped (GTK_WIDGET (tab))) {
       page_num++;
@@ -604,7 +604,7 @@ sync_load_status (EphyWebView *view, GParamSpec *pspec, GtkWidget *proxy)
 
   spinner = GTK_WIDGET (g_object_get_data (G_OBJECT (proxy), "spinner"));
   icon = GTK_WIDGET (g_object_get_data (G_OBJECT (proxy), "icon"));
-  g_return_if_fail (spinner != NULL && icon != NULL);
+  g_assert (spinner != NULL && icon != NULL);
 
   embed = EPHY_GET_EMBED_FROM_EPHY_WEB_VIEW (view);
   if (ephy_web_view_is_loading (view) && !ephy_embed_has_load_pending (embed)) {
@@ -852,7 +852,7 @@ ephy_notebook_add_tab (EphyNotebook *notebook,
 {
   GtkNotebook *gnotebook = GTK_NOTEBOOK (notebook);
 
-  g_return_val_if_fail (EPHY_IS_NOTEBOOK (notebook), -1);
+  g_assert (EPHY_IS_NOTEBOOK (notebook));
 
   position = gtk_notebook_insert_page (GTK_NOTEBOOK (notebook),
                                        GTK_WIDGET (embed),
@@ -992,7 +992,7 @@ ephy_notebook_next_page (EphyNotebook *notebook)
 {
   gint current_page, n_pages;
 
-  g_return_if_fail (EPHY_IS_NOTEBOOK (notebook));
+  g_assert (EPHY_IS_NOTEBOOK (notebook));
 
   current_page = gtk_notebook_get_current_page (GTK_NOTEBOOK (notebook));
   n_pages = gtk_notebook_get_n_pages (GTK_NOTEBOOK (notebook));
@@ -1024,7 +1024,7 @@ ephy_notebook_prev_page (EphyNotebook *notebook)
 {
   gint current_page;
 
-  g_return_if_fail (EPHY_IS_NOTEBOOK (notebook));
+  g_assert (EPHY_IS_NOTEBOOK (notebook));
 
   current_page = gtk_notebook_get_current_page (GTK_NOTEBOOK (notebook));
 
diff --git a/src/ephy-session.c b/src/ephy-session.c
index b07346f..4d6ac54 100644
--- a/src/ephy-session.c
+++ b/src/ephy-session.c
@@ -230,7 +230,7 @@ ephy_session_undo_close_tab (EphySession *session)
   EphyNotebook *notebook;
   EphyNewTabFlags flags = EPHY_NEW_TAB_JUMP;
 
-  g_return_if_fail (EPHY_IS_SESSION (session));
+  g_assert (EPHY_IS_SESSION (session));
 
   tab = g_queue_pop_head (session->closed_tabs);
   if (tab == NULL)
@@ -317,7 +317,7 @@ ephy_session_tab_closed (EphySession  *session,
 gboolean
 ephy_session_get_can_undo_tab_closed (EphySession *session)
 {
-  g_return_val_if_fail (EPHY_IS_SESSION (session), FALSE);
+  g_assert (EPHY_IS_SESSION (session));
 
   return g_queue_is_empty (session->closed_tabs) == FALSE;
 }
@@ -505,7 +505,7 @@ ephy_session_close (EphySession *session)
 {
   EphyPrefsRestoreSessionPolicy policy;
 
-  g_return_if_fail (EPHY_IS_SESSION (session));
+  g_assert (EPHY_IS_SESSION (session));
 
   LOG ("ephy_session_close");
 
@@ -985,7 +985,7 @@ ephy_session_save (EphySession *session)
 {
   EphyPrefsRestoreSessionPolicy policy;
 
-  g_return_if_fail (EPHY_IS_SESSION (session));
+  g_assert (EPHY_IS_SESSION (session));
 
   if (session->save_source_id) {
     return;
@@ -1399,8 +1399,8 @@ ephy_session_load_from_stream (EphySession        *session,
   GMarkupParseContext *parser;
   LoadFromStreamAsyncData *data;
 
-  g_return_if_fail (EPHY_IS_SESSION (session));
-  g_return_if_fail (G_IS_INPUT_STREAM (stream));
+  g_assert (EPHY_IS_SESSION (session));
+  g_assert (G_IS_INPUT_STREAM (stream));
 
   g_application_hold (G_APPLICATION (ephy_shell_get_default ()));
 
@@ -1438,7 +1438,7 @@ ephy_session_load_from_stream_finish (EphySession  *session,
                                       GAsyncResult *result,
                                       GError      **error)
 {
-  g_return_val_if_fail (g_task_is_valid (result, session), FALSE);
+  g_assert (g_task_is_valid (result, session));
 
   return g_task_propagate_boolean (G_TASK (result), error);
 }
@@ -1538,8 +1538,8 @@ ephy_session_load (EphySession        *session,
   GTask *task;
   LoadAsyncData *data;
 
-  g_return_if_fail (EPHY_IS_SESSION (session));
-  g_return_if_fail (filename);
+  g_assert (EPHY_IS_SESSION (session));
+  g_assert (filename);
 
   LOG ("ephy_sesion_load %s", filename);
 
@@ -1574,7 +1574,7 @@ ephy_session_load_finish (EphySession  *session,
                           GAsyncResult *result,
                           GError      **error)
 {
-  g_return_val_if_fail (g_task_is_valid (result, session), FALSE);
+  g_assert (g_task_is_valid (result, session));
 
   return g_task_propagate_boolean (G_TASK (result), error);
 }
@@ -1660,7 +1660,7 @@ ephy_session_resume_finish (EphySession  *session,
                             GAsyncResult *result,
                             GError      **error)
 {
-  g_return_val_if_fail (g_task_is_valid (result, session), FALSE);
+  g_assert (g_task_is_valid (result, session));
 
   return g_task_propagate_boolean (G_TASK (result), error);
 }
@@ -1672,7 +1672,7 @@ ephy_session_clear (EphySession *session)
   EphyShell *shell;
   GList *windows, *p;
 
-  g_return_if_fail (EPHY_IS_SESSION (session));
+  g_assert (EPHY_IS_SESSION (session));
 
   shell = ephy_shell_get_default ();
   windows = g_list_copy (gtk_application_get_windows (GTK_APPLICATION (shell)));
diff --git a/src/ephy-shell.c b/src/ephy-shell.c
index 6d20dc8..efa7f54 100644
--- a/src/ephy-shell.c
+++ b/src/ephy-shell.c
@@ -615,7 +615,7 @@ ephy_shell_before_emit (GApplication *application,
 static GObject *
 ephy_shell_get_lockdown (EphyShell *shell)
 {
-  g_return_val_if_fail (EPHY_IS_SHELL (shell), NULL);
+  g_assert (EPHY_IS_SHELL (shell));
 
   if (shell->lockdown == NULL)
     shell->lockdown = g_object_new (EPHY_TYPE_LOCKDOWN, NULL);
@@ -752,9 +752,9 @@ ephy_shell_new_tab_full (EphyShell      *shell,
   gboolean jump_to = FALSE;
   int position = -1;
 
-  g_return_val_if_fail (EPHY_IS_SHELL (shell), NULL);
-  g_return_val_if_fail (EPHY_IS_WINDOW (window), NULL);
-  g_return_val_if_fail (EPHY_IS_EMBED (previous_embed) || !previous_embed, NULL);
+  g_assert (EPHY_IS_SHELL (shell));
+  g_assert (EPHY_IS_WINDOW (window));
+  g_assert (EPHY_IS_EMBED (previous_embed) || !previous_embed);
 
   embed_shell = EPHY_EMBED_SHELL (shell);
 
@@ -831,7 +831,7 @@ ephy_shell_get_session (EphyShell *shell)
 {
   EphyEmbedShellMode mode;
 
-  g_return_val_if_fail (EPHY_IS_SHELL (shell), NULL);
+  g_assert (EPHY_IS_SHELL (shell));
 
   mode = ephy_embed_shell_get_mode (EPHY_EMBED_SHELL (shell));
   if (mode ==  EPHY_EMBED_SHELL_MODE_APPLICATION || mode == EPHY_EMBED_SHELL_MODE_INCOGNITO)
@@ -854,7 +854,7 @@ ephy_shell_get_session (EphyShell *shell)
 EphySyncService *
 ephy_shell_get_sync_service (EphyShell *shell)
 {
-  g_return_val_if_fail (EPHY_IS_SHELL (shell), NULL);
+  g_assert (EPHY_IS_SHELL (shell));
 
   if (shell->sync_service == NULL) {
     shell->sync_service = ephy_sync_service_new (TRUE);
@@ -883,7 +883,7 @@ ephy_shell_get_sync_service (EphyShell *shell)
 EphyBookmarksManager *
 ephy_shell_get_bookmarks_manager (EphyShell *shell)
 {
-  g_return_val_if_fail (EPHY_IS_SHELL (shell), NULL);
+  g_assert (EPHY_IS_SHELL (shell));
 
   if (shell->bookmarks_manager == NULL)
     shell->bookmarks_manager = ephy_bookmarks_manager_new ();
@@ -902,7 +902,7 @@ ephy_shell_get_bookmarks_manager (EphyShell *shell)
 EphyPasswordManager *
 ephy_shell_get_password_manager (EphyShell *shell)
 {
-  g_return_val_if_fail (EPHY_IS_SHELL (shell), NULL);
+  g_assert (EPHY_IS_SHELL (shell));
 
   if (shell->password_manager == NULL)
     shell->password_manager = ephy_password_manager_new ();
@@ -924,7 +924,7 @@ ephy_shell_get_history_manager (EphyShell *shell)
   EphyEmbedShell *embed_shell;
   EphyHistoryService *service;
 
-  g_return_val_if_fail (EPHY_IS_SHELL (shell), NULL);
+  g_assert (EPHY_IS_SHELL (shell));
 
   if (shell->history_manager == NULL) {
     embed_shell = ephy_embed_shell_get_default ();
@@ -938,7 +938,7 @@ ephy_shell_get_history_manager (EphyShell *shell)
 EphyOpenTabsManager *
 ephy_shell_get_open_tabs_manager (EphyShell *shell)
 {
-  g_return_val_if_fail (EPHY_IS_SHELL (shell), NULL);
+  g_assert (EPHY_IS_SHELL (shell));
 
   if (shell->open_tabs_manager == NULL)
     shell->open_tabs_manager = ephy_open_tabs_manager_new (EPHY_TABS_CATALOG (shell));
@@ -1036,7 +1036,7 @@ void
 ephy_shell_set_startup_context (EphyShell               *shell,
                                 EphyShellStartupContext *ctx)
 {
-  g_return_if_fail (EPHY_IS_SHELL (shell));
+  g_assert (EPHY_IS_SHELL (shell));
 
   g_assert (shell->local_startup_context == NULL);
 
@@ -1048,7 +1048,7 @@ ephy_shell_get_n_windows (EphyShell *shell)
 {
   GList *list;
 
-  g_return_val_if_fail (EPHY_IS_SHELL (shell), 0);
+  g_assert (EPHY_IS_SHELL (shell));
 
   list = gtk_application_get_windows (GTK_APPLICATION (shell));
   return g_list_length (list);
@@ -1061,7 +1061,7 @@ ephy_shell_close_all_windows (EphyShell *shell)
   gboolean retval = TRUE;
   EphySession *session = ephy_shell_get_session (shell);
 
-  g_return_val_if_fail (EPHY_IS_SHELL (shell), FALSE);
+  g_assert (EPHY_IS_SHELL (shell));
 
   if (session)
     ephy_session_close (session);
@@ -1228,7 +1228,7 @@ ephy_shell_open_uris (EphyShell       *shell,
   OpenURIsData *data;
   guint id;
 
-  g_return_if_fail (EPHY_IS_SHELL (shell));
+  g_assert (EPHY_IS_SHELL (shell));
 
   data = open_uris_data_new (shell, uris, startup_flags, user_time);
   id = g_idle_add_full (G_PRIORITY_DEFAULT_IDLE,
diff --git a/src/ephy-suggestion-model.c b/src/ephy-suggestion-model.c
index 2dd5994..8913347 100644
--- a/src/ephy-suggestion-model.c
+++ b/src/ephy-suggestion-model.c
@@ -174,8 +174,8 @@ EphySuggestionModel *
 ephy_suggestion_model_new (EphyHistoryService   *history_service,
                            EphyBookmarksManager *bookmarks_manager)
 {
-  g_return_val_if_fail (EPHY_IS_HISTORY_SERVICE (history_service), NULL);
-  g_return_val_if_fail (EPHY_IS_BOOKMARKS_MANAGER (bookmarks_manager), NULL);
+  g_assert (EPHY_IS_HISTORY_SERVICE (history_service));
+  g_assert (EPHY_IS_BOOKMARKS_MANAGER (bookmarks_manager));
 
   return g_object_new (EPHY_TYPE_SUGGESTION_MODEL,
                        "history-service", history_service,
@@ -363,9 +363,9 @@ ephy_suggestion_model_query_async (EphySuggestionModel *self,
   char **strings;
   GList *qlist = NULL;
 
-  g_return_if_fail (EPHY_IS_SUGGESTION_MODEL (self));
-  g_return_if_fail (query != NULL);
-  g_return_if_fail (!cancellable || G_IS_CANCELLABLE (cancellable));
+  g_assert (EPHY_IS_SUGGESTION_MODEL (self));
+  g_assert (query != NULL);
+  g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
 
   task = g_task_new (self, cancellable, callback, user_data);
   g_task_set_source_tag (task, ephy_suggestion_model_query_async);
@@ -395,8 +395,8 @@ ephy_suggestion_model_query_finish (EphySuggestionModel  *self,
                                     GAsyncResult         *result,
                                     GError              **error)
 {
-  g_return_val_if_fail (EPHY_IS_SUGGESTION_MODEL (self), FALSE);
-  g_return_val_if_fail (G_IS_TASK (result), FALSE);
+  g_assert (EPHY_IS_SUGGESTION_MODEL (self));
+  g_assert (G_IS_TASK (result));
 
   return g_task_propagate_boolean (G_TASK (result), error);
 }
@@ -407,8 +407,8 @@ ephy_suggestion_model_get_suggestion_with_uri (EphySuggestionModel *self,
 {
   GSequenceIter *iter;
 
-  g_return_val_if_fail (EPHY_IS_SUGGESTION_MODEL (self), NULL);
-  g_return_val_if_fail (uri != NULL && *uri != '\0', NULL);
+  g_assert (EPHY_IS_SUGGESTION_MODEL (self));
+  g_assert (uri != NULL && *uri != '\0');
 
   for (iter = g_sequence_get_begin_iter (self->items);
        !g_sequence_iter_is_end (iter); iter = g_sequence_iter_next (iter)) {
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 749aad3..05dd005 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -201,8 +201,7 @@ impl_add_child (EphyEmbedContainer *container,
 {
   EphyWindow *window = EPHY_WINDOW (container);
 
-  g_return_val_if_fail (!window->is_popup ||
-                        gtk_notebook_get_n_pages (GTK_NOTEBOOK (window->notebook)) < 1, -1);
+  g_assert (!window->is_popup || gtk_notebook_get_n_pages (GTK_NOTEBOOK (window->notebook)) < 1);
 
   return ephy_notebook_add_tab (EPHY_NOTEBOOK (window->notebook),
                                 child, position, jump_to);
@@ -717,7 +716,7 @@ update_edit_actions_sensitivity (EphyWindow *window, gboolean hide)
     CanEditCommandAsyncData *data;
 
     embed = window->active_embed;
-    g_return_if_fail (embed != NULL);
+    g_assert (embed != NULL);
 
     view = EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (embed);
 
@@ -1179,8 +1178,8 @@ sync_tab_popups_allowed (EphyWebView *view,
   GAction *action;
   gboolean allow;
 
-  g_return_if_fail (EPHY_IS_WEB_VIEW (view));
-  g_return_if_fail (EPHY_IS_WINDOW (window));
+  g_assert (EPHY_IS_WEB_VIEW (view));
+  g_assert (EPHY_IS_WINDOW (window));
 
   action_group = gtk_widget_get_action_group (GTK_WIDGET (window), "win");
   action = g_action_map_lookup_action (G_ACTION_MAP (action_group),
@@ -2041,7 +2040,7 @@ ephy_window_connect_active_embed (EphyWindow *window)
   WebKitWebView *web_view;
   EphyWebView *view;
 
-  g_return_if_fail (window->active_embed != NULL);
+  g_assert (window->active_embed != NULL);
 
   embed = window->active_embed;
   view = ephy_embed_get_web_view (embed);
@@ -2120,7 +2119,7 @@ ephy_window_disconnect_active_embed (EphyWindow *window)
   WebKitWebView *web_view;
   EphyWebView *view;
 
-  g_return_if_fail (window->active_embed != NULL);
+  g_assert (window->active_embed != NULL);
 
   embed = window->active_embed;
   web_view = EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (embed);
@@ -2178,8 +2177,8 @@ ephy_window_set_active_tab (EphyWindow *window, EphyEmbed *new_embed)
 {
   EphyEmbed *old_embed;
 
-  g_return_if_fail (EPHY_IS_WINDOW (window));
-  g_return_if_fail (gtk_widget_get_toplevel (GTK_WIDGET (new_embed)) == GTK_WIDGET (window));
+  g_assert (EPHY_IS_WINDOW (window));
+  g_assert (gtk_widget_get_toplevel (GTK_WIDGET (new_embed)) == GTK_WIDGET (window));
 
   old_embed = window->active_embed;
 
@@ -2391,7 +2390,7 @@ notebook_page_added_cb (EphyNotebook *notebook,
 {
   LOG ("page-added notebook %p embed %p position %u\n", notebook, embed, position);
 
-  g_return_if_fail (EPHY_IS_EMBED (embed));
+  g_assert (EPHY_IS_EMBED (embed));
 
   g_signal_connect_object (ephy_embed_get_web_view (embed), "download-only-load",
                            G_CALLBACK (download_only_load_cb), window, G_CONNECT_AFTER);
@@ -2415,7 +2414,7 @@ notebook_page_removed_cb (EphyNotebook *notebook,
   if (window->closing)
     return;
 
-  g_return_if_fail (EPHY_IS_EMBED (embed));
+  g_assert (EPHY_IS_EMBED (embed));
 
   g_signal_handlers_disconnect_by_func
     (ephy_embed_get_web_view (embed), G_CALLBACK (download_only_load_cb), window);
@@ -2507,7 +2506,7 @@ real_get_active_tab (EphyWindow *window, int page_num)
 
   embed = gtk_notebook_get_nth_page (window->notebook, page_num);
 
-  g_return_val_if_fail (EPHY_IS_EMBED (embed), NULL);
+  g_assert (EPHY_IS_EMBED (embed));
 
   return EPHY_EMBED (embed);
 }
@@ -2812,13 +2811,13 @@ allow_popups_notifier (GSettings  *settings,
   GList *tabs;
   EphyEmbed *embed;
 
-  g_return_if_fail (EPHY_IS_WINDOW (window));
+  g_assert (EPHY_IS_WINDOW (window));
 
   tabs = impl_get_children (EPHY_EMBED_CONTAINER (window));
 
   for (; tabs; tabs = g_list_next (tabs)) {
     embed = EPHY_EMBED (tabs->data);
-    g_return_if_fail (EPHY_IS_EMBED (embed));
+    g_assert (EPHY_IS_EMBED (embed));
 
     g_object_notify (G_OBJECT (ephy_embed_get_web_view (embed)), "popups-allowed");
   }
@@ -3192,7 +3191,7 @@ ephy_window_new (void)
 GtkWidget *
 ephy_window_get_notebook (EphyWindow *window)
 {
-  g_return_val_if_fail (EPHY_IS_WINDOW (window), NULL);
+  g_assert (EPHY_IS_WINDOW (window));
 
   return GTK_WIDGET (window->notebook);
 }
@@ -3208,7 +3207,7 @@ ephy_window_get_notebook (EphyWindow *window)
 GtkWidget *
 ephy_window_get_current_find_toolbar (EphyWindow *window)
 {
-  g_return_val_if_fail (EPHY_IS_WINDOW (window), NULL);
+  g_assert (EPHY_IS_WINDOW (window));
 
   return GTK_WIDGET (ephy_embed_get_find_toolbar (window->active_embed));
 }
@@ -3227,7 +3226,7 @@ void
 ephy_window_load_url (EphyWindow *window,
                       const char *url)
 {
-  g_return_if_fail (url != NULL);
+  g_assert (url != NULL);
 
   ephy_link_open (EPHY_LINK (window), url, NULL, 0);
 }
@@ -3268,10 +3267,10 @@ ephy_window_set_zoom (EphyWindow *window,
   double current_zoom = 1.0;
   WebKitWebView *web_view;
 
-  g_return_if_fail (EPHY_IS_WINDOW (window));
+  g_assert (EPHY_IS_WINDOW (window));
 
   embed = window->active_embed;
-  g_return_if_fail (embed != NULL);
+  g_assert (embed != NULL);
 
   web_view = EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (embed);
 
@@ -3295,10 +3294,10 @@ ephy_window_change_allow_popup_windows_state (GSimpleAction *action,
   EphyEmbed *embed;
   gboolean allow;
 
-  g_return_if_fail (EPHY_IS_WINDOW (window));
+  g_assert (EPHY_IS_WINDOW (window));
 
   embed = window->active_embed;
-  g_return_if_fail (EPHY_IS_EMBED (embed));
+  g_assert (EPHY_IS_EMBED (embed));
 
   allow = g_variant_get_boolean (state);
 
@@ -3318,7 +3317,7 @@ ephy_window_change_allow_popup_windows_state (GSimpleAction *action,
 EphyEmbedEvent *
 ephy_window_get_context_event (EphyWindow *window)
 {
-  g_return_val_if_fail (EPHY_IS_WINDOW (window), NULL);
+  g_assert (EPHY_IS_WINDOW (window));
 
   return window->context_event;
 }
@@ -3367,7 +3366,7 @@ ephy_window_set_location (EphyWindow *window,
 EphyLocationController *
 ephy_window_get_location_controller (EphyWindow *window)
 {
-  g_return_val_if_fail (EPHY_IS_WINDOW (window), NULL);
+  g_assert (EPHY_IS_WINDOW (window));
 
   return window->location_controller;
 }
@@ -3529,7 +3528,7 @@ ephy_window_close (EphyWindow *window)
 EphyWindowChrome
 ephy_window_get_chrome (EphyWindow *window)
 {
-  g_return_val_if_fail (EPHY_IS_WINDOW (window), EPHY_WINDOW_CHROME_DEFAULT);
+  g_assert (EPHY_IS_WINDOW (window));
 
   return window->chrome;
 }
diff --git a/src/popup-commands.c b/src/popup-commands.c
index 0432549..de70976 100644
--- a/src/popup-commands.c
+++ b/src/popup-commands.c
@@ -57,10 +57,10 @@ view_in_destination (EphyWindow     *window,
   EphyNewTabFlags flags = 0;
 
   event = ephy_window_get_context_event (window);
-  g_return_if_fail (event != NULL);
+  g_assert (event != NULL);
 
   embed = ephy_embed_container_get_active_child (EPHY_EMBED_CONTAINER (window));
-  g_return_if_fail (embed != NULL);
+  g_assert (embed != NULL);
 
   ephy_embed_event_get_property (event, property_name, &value);
   switch (destination) {
@@ -119,7 +119,7 @@ popup_cmd_copy_link_address (GSimpleAction *action,
   GValue value = { 0, };
 
   event = ephy_window_get_context_event (EPHY_WINDOW (user_data));
-  g_return_if_fail (event != NULL);
+  g_assert (event != NULL);
 
   context = ephy_embed_event_get_context (event);
 
@@ -206,7 +206,7 @@ save_property_url (const char *title,
   GValue value = G_VALUE_INIT;
 
   event = ephy_window_get_context_event (window);
-  g_return_if_fail (event != NULL);
+  g_assert (event != NULL);
 
   ephy_embed_event_get_property (event, property, &value);
   location = g_value_get_string (&value);
@@ -269,7 +269,7 @@ popup_cmd_set_image_as_background (GSimpleAction *action,
   EphyDownload *download;
 
   event = ephy_window_get_context_event (EPHY_WINDOW (user_data));
-  g_return_if_fail (event != NULL);
+  g_assert (event != NULL);
 
   ephy_embed_event_get_property (event, "image-uri", &value);
   location = g_value_get_string (&value);
diff --git a/src/prefs-dialog.c b/src/prefs-dialog.c
index 580292f..f16e81d 100644
--- a/src/prefs-dialog.c
+++ b/src/prefs-dialog.c
@@ -819,7 +819,7 @@ language_editor_add (PrefsDialog *pd,
 {
   GtkTreeIter iter;
 
-  g_return_if_fail (code != NULL && desc != NULL);
+  g_assert (code != NULL && desc != NULL);
 
   if (gtk_tree_model_get_iter_first (pd->lang_model, &iter)) {
     do {
@@ -927,7 +927,7 @@ add_lang_dialog_response_cb (GtkWidget   *widget,
   GtkTreeIter iter;
   GList *rows, *r;
 
-  g_return_if_fail (dialog != NULL);
+  g_assert (dialog != NULL);
 
   if (response == GTK_RESPONSE_ACCEPT) {
     selection = gtk_tree_view_get_selection (pd->add_lang_treeview);
@@ -973,7 +973,7 @@ get_name_for_lang_code (PrefsDialog *pd,
 
   str = g_strsplit (code, "-", -1);
   len = g_strv_length (str);
-  g_return_val_if_fail (len != 0, NULL);
+  g_assert (len != 0);
 
   langname = (const char *)g_hash_table_lookup (pd->iso_639_table, str[0]);
 
diff --git a/src/window-commands.c b/src/window-commands.c
index 3d7d603..3671add 100644
--- a/src/window-commands.c
+++ b/src/window-commands.c
@@ -694,7 +694,7 @@ window_cmd_navigation (GSimpleAction *action,
   WebKitWebView *web_view;
 
   embed = ephy_embed_container_get_active_child (EPHY_EMBED_CONTAINER (window));
-  g_return_if_fail (embed != NULL);
+  g_assert (embed != NULL);
 
   web_view = EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (embed);
 
@@ -717,7 +717,7 @@ window_cmd_navigation_new_tab (GSimpleAction *action,
   WebKitWebView *web_view;
 
   embed = ephy_embed_container_get_active_child (EPHY_EMBED_CONTAINER (window));
-  g_return_if_fail (embed != NULL);
+  g_assert (embed != NULL);
 
   web_view = EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (embed);
 
@@ -770,7 +770,7 @@ window_cmd_stop (GSimpleAction *action,
 
   embed = ephy_embed_container_get_active_child
             (EPHY_EMBED_CONTAINER (window));
-  g_return_if_fail (embed != NULL);
+  g_assert (embed != NULL);
 
   gtk_widget_grab_focus (GTK_WIDGET (embed));
 
@@ -811,7 +811,7 @@ window_cmd_reload (GSimpleAction *action,
 
   embed = ephy_embed_container_get_active_child
             (EPHY_EMBED_CONTAINER (window));
-  g_return_if_fail (embed != NULL);
+  g_assert (embed != NULL);
 
   gtk_widget_grab_focus (GTK_WIDGET (embed));
 
@@ -1358,7 +1358,7 @@ window_cmd_save_as_application (GSimpleAction *action,
   char *escaped_address;
 
   embed = ephy_embed_container_get_active_child (EPHY_EMBED_CONTAINER (window));
-  g_return_if_fail (embed != NULL);
+  g_assert (embed != NULL);
 
   view = EPHY_WEB_VIEW (EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (embed));
 
@@ -1495,7 +1495,7 @@ window_cmd_save_as (GSimpleAction *action,
   char *suggested_filename;
 
   embed = ephy_embed_container_get_active_child (EPHY_EMBED_CONTAINER (window));
-  g_return_if_fail (embed != NULL);
+  g_assert (embed != NULL);
 
   dialog = ephy_create_file_chooser (_("Save"),
                                      GTK_WIDGET (window),
@@ -1574,7 +1574,7 @@ window_cmd_cut (GSimpleAction *action,
   } else {
     EphyEmbed *embed;
     embed = ephy_embed_container_get_active_child (EPHY_EMBED_CONTAINER (window));
-    g_return_if_fail (embed != NULL);
+    g_assert (embed != NULL);
 
     webkit_web_view_execute_editing_command (EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (embed), 
WEBKIT_EDITING_COMMAND_CUT);
   }
@@ -1594,7 +1594,7 @@ window_cmd_copy (GSimpleAction *action,
     EphyEmbed *embed;
 
     embed = ephy_embed_container_get_active_child (EPHY_EMBED_CONTAINER (window));
-    g_return_if_fail (embed != NULL);
+    g_assert (embed != NULL);
 
     webkit_web_view_execute_editing_command (EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (embed), 
WEBKIT_EDITING_COMMAND_COPY);
   }
@@ -1614,7 +1614,7 @@ window_cmd_paste (GSimpleAction *action,
     EphyEmbed *embed;
 
     embed = ephy_embed_container_get_active_child (EPHY_EMBED_CONTAINER (window));
-    g_return_if_fail (embed != NULL);
+    g_assert (embed != NULL);
 
     webkit_web_view_execute_editing_command (EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (embed), 
WEBKIT_EDITING_COMMAND_PASTE);
   }
@@ -1634,7 +1634,7 @@ window_cmd_delete (GSimpleAction *action,
     EphyEmbed *embed;
 
     embed = ephy_embed_container_get_active_child (EPHY_EMBED_CONTAINER (window));
-    g_return_if_fail (embed != NULL);
+    g_assert (embed != NULL);
 
     /* FIXME: TODO */
 #if 0
@@ -1655,7 +1655,7 @@ window_cmd_print (GSimpleAction *action,
 
   embed = ephy_embed_container_get_active_child
             (EPHY_EMBED_CONTAINER (window));
-  g_return_if_fail (EPHY_IS_EMBED (embed));
+  g_assert (EPHY_IS_EMBED (embed));
   view = ephy_embed_get_web_view (embed);
 
   ephy_web_view_print (view);
@@ -1971,7 +1971,7 @@ window_cmd_page_source (GSimpleAction *action,
 
   embed = ephy_embed_container_get_active_child
             (EPHY_EMBED_CONTAINER (window));
-  g_return_if_fail (embed != NULL);
+  g_assert (embed != NULL);
 
   address = ephy_web_view_get_address (ephy_embed_get_web_view (embed));
 
@@ -2011,7 +2011,7 @@ window_cmd_toggle_inspector (GSimpleAction *action,
 
   embed = ephy_embed_container_get_active_child
             (EPHY_EMBED_CONTAINER (window));
-  g_return_if_fail (embed != NULL);
+  g_assert (embed != NULL);
 
   gtk_widget_grab_focus (GTK_WIDGET (embed));
 
@@ -2041,7 +2041,7 @@ window_cmd_select_all (GSimpleAction *action,
 
     embed = ephy_embed_container_get_active_child
               (EPHY_EMBED_CONTAINER (window));
-    g_return_if_fail (embed != NULL);
+    g_assert (embed != NULL);
 
     webkit_web_view_execute_editing_command (EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (embed), "SelectAll");
   }
@@ -2060,7 +2060,7 @@ window_cmd_send_to (GSimpleAction *action,
 
   embed = ephy_embed_container_get_active_child
             (EPHY_EMBED_CONTAINER (window));
-  g_return_if_fail (embed != NULL);
+  g_assert (embed != NULL);
 
   location = ephy_web_view_get_address (ephy_embed_get_web_view (embed));
   title = ephy_embed_get_title (embed);
@@ -2166,7 +2166,7 @@ window_cmd_tabs_previous (GSimpleAction *action,
   GtkWidget *nb;
 
   nb = ephy_window_get_notebook (EPHY_WINDOW (user_data));
-  g_return_if_fail (nb != NULL);
+  g_assert (nb != NULL);
 
   ephy_notebook_prev_page (EPHY_NOTEBOOK (nb));
 }
@@ -2179,7 +2179,7 @@ window_cmd_tabs_next (GSimpleAction *action,
   GtkWidget *nb;
 
   nb = ephy_window_get_notebook (EPHY_WINDOW (user_data));
-  g_return_if_fail (nb != NULL);
+  g_assert (nb != NULL);
 
   ephy_notebook_next_page (EPHY_NOTEBOOK (nb));
 }
@@ -2296,7 +2296,7 @@ window_cmd_tabs_close (GSimpleAction *action,
   }
 
   embed = ephy_embed_container_get_active_child (EPHY_EMBED_CONTAINER (window));
-  g_return_if_fail (embed != NULL);
+  g_assert (embed != NULL);
 
   g_signal_emit_by_name (notebook, "tab-close-request", embed);
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]