Re: Reverting to non-async file chooser

On 8/17/06, Federico Mena Quintero <federico ximian com> wrote:

OK, so here's the plan of action.

Semantics of callbacks and cancellation

- You need to hit the idle loop for your callback to be called, just
  like in GnomeVFS.

- You do not need to ever ref/unref async handles; they are opaque

- Once you call gtk_file_system_cancel_operation(), you can assume
  that the callback corresponding to the handle will NOT be called.
  Therefore, the caller must free the stuff in the callback's closure
  as appropriate.

  Rationale:  the idle loop may be far away in time.  By that time, it
  is very likely that the closure of the callback is no longer valid.
  So, we want to get rid of it as soon as possible.

  Caveat:  gnome-vfs does not let you cancel the operation of mounting
  a drive or volume.  So if you cancel the handle from
  gtk_file_system_volume_mount(), your callback will not be called,
  but the volume *will* be mounted (unless an error occurs during
  mounting, of course).

  Notes:  The current scheme (callbacks get called even when
  cancelled; caller must unref the handle in the callback) doesn't
  make sense.  Callbacks test if the handle being passed is the same
  that got remembered; this causes leaks if an old handle had been
  canceled but the idle loop did not run yet.

Plan of action

1. Add assertions in GtkFileSystemGnomeVFS so that no async handles
   are outstanding when the file_system's finalizer gets run.  DONE.

2. Add assertions to GtkFileSystemUnix in a similar fashion.

3. Write a test suite for the async operations of GtkFileSystem,
   similar in spirit to gnome-vfs/test/test-async-cancel.c.  IN PROGRESS.

   [I think op_data is being leaked quite often in
   gtkfilesystemgnomevfs.c, but haven't proved it yet.]

4. Run that test suite against GtkFileSystemGnomeVFS.

5. Run that test suite against GtkFileSystemUnix.

6. Fix gtkfilechooser*.c to handle the new semantics for async
   handles.  See the patches in these bugs:

7. Ensure that autotestfilechooser passes all tests.  This will take
   care of the big overwrite-confirmation bug:

8. ???

9. Profit!!!

I'm getting kind of nervous that RC1 for GNOME 2.16 is a few days away.
Help is much appreciated to finish the tasks above that are not done.

Thanks for taking the initiative and coming up with this plan. Once I have
2.10.2 out, I'll see if I can help.


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