Bug 153233 - [GTK] Runtime critical warnings when loading a URL after a session restore
Summary: [GTK] Runtime critical warnings when loading a URL after a session restore
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: Gtk
Depends on:
Blocks:
 
Reported: 2016-01-19 06:48 PST by Carlos Garcia Campos
Modified: 2016-01-19 08:50 PST (History)
6 users (show)

See Also:


Attachments
Patch (6.25 KB, patch)
2016-01-19 06:51 PST, Carlos Garcia Campos
mcatanzaro: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Garcia Campos 2016-01-19 06:48:34 PST
This happens when doing a normal load after restoring the back forward list form session state and the list contained forward items. In that case the forward items are removed from the list and we try to reference a WebBackForwardListItem wrapper that hasn't been created. We create the wrappers on demand, and when the back forward list is populated form session state, items are added to the list without creating their wrappers. That was not possible before, and that's why we assumed that any item that is removed from the list should have a wrapper already created.

I wrote a new test case for this:

/webkit2/WebKitWebView/navigation-after-session-restore: 
(bin/TestWebKitAPI/WebKit2Gtk/TestBackForwardList:31773): GLib-GObject-CRITICAL **: g_object_ref: assertion 'G_IS_OBJECT (object)' failed
Comment 1 Carlos Garcia Campos 2016-01-19 06:51:16 PST
Created attachment 269266 [details]
Patch
Comment 2 WebKit Commit Bot 2016-01-19 06:52:58 PST
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Comment 3 Michael Catanzaro 2016-01-19 06:58:20 PST
Comment on attachment 269266 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=269266&action=review

> Source/WebKit2/ChangeLog:9
> +        forward list form session state and the list contained forward

form -> from

> Source/WebKit2/ChangeLog:13
> +        the back forward list is populated form session state, items are

form -> from

> Source/WebKit2/ChangeLog:16
> +        removed from the list should have a wrapper already created.

Good job! :p

> Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestBackForwardList.cpp:378
> +    // forward items doesn't produce any runtime critical warning. See bug #

See bug #153233.

> Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestBackForwardList.cpp:395
> +    // A normal load after a session restore should remove the forward list, add the new item and updated the current one.

updated -> update
Comment 4 Carlos Garcia Campos 2016-01-19 08:48:28 PST
(In reply to comment #3)
> Comment on attachment 269266 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=269266&action=review

Thanks for the review.

> > Source/WebKit2/ChangeLog:9
> > +        forward list form session state and the list contained forward
> 
> form -> from
> 
> > Source/WebKit2/ChangeLog:13
> > +        the back forward list is populated form session state, items are
> 
> form -> from
> 
> > Source/WebKit2/ChangeLog:16
> > +        removed from the list should have a wrapper already created.
> 
> Good job! :p

:-D It's seems I don't know how to type from.

> > Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestBackForwardList.cpp:378
> > +    // forward items doesn't produce any runtime critical warning. See bug #
> 
> See bug #153233.

I had already changed this, but forgot to save the files changes :-P

> > Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestBackForwardList.cpp:395
> > +    // A normal load after a session restore should remove the forward list, add the new item and updated the current one.
> 
> updated -> update

Thanks!
Comment 5 Carlos Garcia Campos 2016-01-19 08:50:18 PST
Committed r195288: <http://trac.webkit.org/changeset/195288>