[Webkit-unassigned] [Bug 22898] [GTK] need proper API for printing

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Apr 3 06:45:21 PDT 2009


https://bugs.webkit.org/show_bug.cgi?id=22898





------- Comment #37 from gns at gnome.org  2009-04-03 06:45 PDT -------
yo!

(In reply to comment #35)
> (From update of attachment 29122 [review])
> > +
> > +    // Does printing directly to a file?
> > +    GError *error = NULL;
> > +    gchar* temporaryFilename = NULL;
> > +    gint fd = g_file_open_tmp ("webkit-testwebframe-XXXXXX", &temporaryFilename, &error);
> > +    close(fd);
> > +
> > +    // We delete the file, so that we can easily figure out that the
> > +    // file got printed;
> > +    if (error || (g_unlink(temporaryFilename) == -1)) {
> > +        g_critical("Failed to open a temporary file for writing: %s.", error->message);
> > +        g_error_free(error);
> > +        goto cleanup;
> > +    }
> 
> 
> > +    gtk_print_operation_set_export_filename(operation, temporaryFilename);
> > +    result = webkit_web_frame_print_full (webFrame, operation, action, error);
> 
> 
> This looks like a race. Will GtkPrint just overwrite the export file?
> 

Yes. That doesn't seem to be documented, but from what I could understand from
gtk+'s source code, and from my tests, the file is simply overwritten. Why do
you think there is a race here?


-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list