RESOLVED FIXED Bug 129869
[GTK] Runtime error when page is closed while print operation is in progress
https://bugs.webkit.org/show_bug.cgi?id=129869
Summary [GTK] Runtime error when page is closed while print operation is in progress
Carlos Garcia Campos
Reported 2014-03-07 01:49:11 PST
It doesn't always happen, but it can be easily reproduced running test /webkit2/WebKitPrintOperation/close-after-print $ Programs/TestWebKitAPI/WebKit2Gtk/TestPrinting -p /webkit2/WebKitPrintOperation/close-after-print /webkit2/WebKitPrintOperation/close-after-print: OK pure virtual method called terminate called without an active exception This happens because the page is closed when the pages have been printed, but print job is still ongoing sending the data to the printer. When print job finishes, we try to notify the UI process sending the print callback message using WebPage::send(), but the web page object has been destroyed. The virtual method it complains about is probably MessageSender::messageSenderDestinationID() used by send(). Since our print operation is always asynchronous, we need a way to notify the web page when the print operation has actually finished to clean it up, but also notify the print operation when the page has been closed to not try to notify the UI process in that case.
Attachments
Patch (6.61 KB, patch)
2014-03-07 01:57 PST, Carlos Garcia Campos
andersca: review+
Carlos Garcia Campos
Comment 1 2014-03-07 01:57:33 PST
Martin Robinson
Comment 2 2014-03-07 09:39:16 PST
Comment on attachment 226099 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=226099&action=review GTK+ bits look good to me. I'll leave the rest to the WebKit2 owners. > Source/WebKit2/WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:418 > +void WebPrintOperationGtk::disconnectFromPage() Maybe call this didDisconnectFromPage or notifyDisconnectFromPage since the disconnection actually happens earlier?
Carlos Garcia Campos
Comment 3 2014-03-07 09:52:09 PST
(In reply to comment #2) > (From update of attachment 226099 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=226099&action=review > > GTK+ bits look good to me. I'll leave the rest to the WebKit2 owners. Thanks for the review. > > Source/WebKit2/WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:418 > > +void WebPrintOperationGtk::disconnectFromPage() > > Maybe call this didDisconnectFromPage or notifyDisconnectFromPage since the disconnection actually happens earlier? I followed other similar existing methods that are disconnectFromPage. This happens when the page is closed, and is telling the print operation to disconnect from the page. It's consistent with WebColorChooser::disconnectFromPage(), WebPopupMenu::disconnectFromPage(), WebOpenPanelResultListener::disconnectFromPage(), etc.
Carlos Garcia Campos
Comment 4 2014-03-12 11:27:08 PDT
Note You need to log in before you can comment on or make changes to this bug.