GNOME Bugzilla – Bug 681832
Save the session asynchronously
Last modified: 2013-01-09 14:07:18 UTC
Created attachment 221132 [details] [review] Patch Using a thread to avoid doing IO in the main thread and blocking the UI while saving the session.
Created attachment 223282 [details] [review] Updated patch for current git master
Created attachment 223505 [details] [review] Use a XML memory writer and save the contents with g_file_replace_contents() The code is simpler and g_file_replace_contents() can be cancelled.
Created attachment 226028 [details] [review] Updated patch Updated for the changes in bug #641734 (ephy_shell_has_windows() has been removed)
Review of attachment 226028 [details] [review]: OK, this patch looks great to me. I especially like the cleanups in the write (windows/tabs/data) methods, good job!
Review of attachment 223505 [details] [review]: ::: src/ephy-session.c @@ +591,3 @@ + buffer->use, + NULL, TRUE, 0, NULL, + cancellable, &error)) The ephy switch_temp_file method goes to some lengths to make sure we can never lose data (making backups, doing the switch atomatically, etc.) Does this thing do the same? I'd say it's important to be really sure we can never screw the session file here.
Review of attachment 223505 [details] [review]: ::: src/ephy-session.c @@ +591,3 @@ + buffer->use, + NULL, TRUE, 0, NULL, + cancellable, &error)) Yes, it even has several approaches to make sure the replacement is atomic depending on the platform. I'm also using the make_backup (it's the TRUE you see in the call) option that creates a backup file before replacing it
(In reply to comment #6) > Review of attachment 223505 [details] [review]: > > ::: src/ephy-session.c > @@ +591,3 @@ > + buffer->use, > + NULL, TRUE, 0, NULL, > + cancellable, &error)) > > Yes, it even has several approaches to make sure the replacement is atomic > depending on the platform. I'm also using the make_backup (it's the TRUE you > see in the call) option that creates a backup file before replacing it And the major advantage is that it can be cancelled, which happens several times during the startup when there are several tabs in the session.
Comment on attachment 223505 [details] [review] Use a XML memory writer and save the contents with g_file_replace_contents() OK, cool, let's do it.
Thanks, pushed both patches to git master.