WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
184823
REGRESSION(
r230812
): [WPE][GTK] WebKitWebViewSessionState.cpp throws away encoded BackForwardList identifier
https://bugs.webkit.org/show_bug.cgi?id=184823
Summary
REGRESSION(r230812): [WPE][GTK] WebKitWebViewSessionState.cpp throws away enc...
Michael Catanzaro
Reported
2018-04-20 09:30:53 PDT
Since
r230812
, decodeBackForwardListItemState in WebKitWebViewSessionState.cpp no longer reads the encoded BackForwardList identifier. First, we should figure out if this is bad. Does the BackForwardList still get deserialized properly? It's not clear to me. If it's not bad, we should at least stop encoding the identifier, since it's silly to encode something that's never decoded. To avoid the need to change the serialization format, we could just start encoding 0, for example, with a comment to indicate that it should be dropped if we ever need to bump the serialization format.
Attachments
Patch
(9.13 KB, patch)
2018-04-26 03:54 PDT
,
Carlos Garcia Campos
mcatanzaro
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Carlos Garcia Campos
Comment 1
2018-04-21 00:01:38 PDT
(In reply to Michael Catanzaro from
comment #0
)
> Since
r230812
, decodeBackForwardListItemState in > WebKitWebViewSessionState.cpp no longer reads the encoded BackForwardList > identifier.
Right.
> First, we should figure out if this is bad. Does the BackForwardList still > get deserialized properly? It's not clear to me.
Nah, it's not bad because WebBackForwardList::restoreFromState() assigns a new identifier to the item without checking the saved one. This was done before as well, so I think we were saving the identifier in the state for nothing. Brady, correct me if I'm wrong.
> If it's not bad, we should at least stop encoding the identifier, since it's > silly to encode something that's never decoded. To avoid the need to change > the serialization format, we could just start encoding 0, for example, with > a comment to indicate that it should be dropped if we ever need to bump the > serialization format.
It should be easy to handle this change, I think.
Carlos Garcia Campos
Comment 2
2018-04-26 03:54:04 PDT
Created
attachment 338868
[details]
Patch
EWS Watchlist
Comment 3
2018-04-26 03:55:54 PDT
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
Michael Catanzaro
Comment 4
2018-04-26 09:36:57 PDT
Comment on
attachment 338868
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=338868&action=review
> Source/WebKit/UIProcess/API/glib/WebKitWebViewSessionState.cpp:394 > + GRefPtr<GVariant> variant; > + for (unsigned i = 0; sessionStateTypeStringVersions[i]; ++i) { > + sessionStateTypeString = sessionStateTypeStringVersions[i]; > + variant = g_variant_new_from_bytes(G_VARIANT_TYPE(sessionStateTypeString), data, FALSE); > + if (g_variant_is_normal_form(variant.get())) > + break; > + variant = nullptr; > + }
You've tested this to ensure it doesn't emit a bunch of warnings or criticals when the type doesn't match?
Carlos Garcia Campos
Comment 5
2018-04-26 23:37:03 PDT
(In reply to Michael Catanzaro from
comment #4
)
> Comment on
attachment 338868
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=338868&action=review
> > > Source/WebKit/UIProcess/API/glib/WebKitWebViewSessionState.cpp:394 > > + GRefPtr<GVariant> variant; > > + for (unsigned i = 0; sessionStateTypeStringVersions[i]; ++i) { > > + sessionStateTypeString = sessionStateTypeStringVersions[i]; > > + variant = g_variant_new_from_bytes(G_VARIANT_TYPE(sessionStateTypeString), data, FALSE); > > + if (g_variant_is_normal_form(variant.get())) > > + break; > > + variant = nullptr; > > + } > > You've tested this to ensure it doesn't emit a bunch of warnings or > criticals when the type doesn't match?
Yes, of course I tested it. My ephy history was successfully encoded with version 1 (2 is tried first) and decoded with 2.
Carlos Garcia Campos
Comment 6
2018-04-26 23:37:35 PDT
(In reply to Carlos Garcia Campos from
comment #5
)
> (In reply to Michael Catanzaro from
comment #4
) > > Comment on
attachment 338868
[details]
> > Patch > > > > View in context: > >
https://bugs.webkit.org/attachment.cgi?id=338868&action=review
> > > > > Source/WebKit/UIProcess/API/glib/WebKitWebViewSessionState.cpp:394 > > > + GRefPtr<GVariant> variant; > > > + for (unsigned i = 0; sessionStateTypeStringVersions[i]; ++i) { > > > + sessionStateTypeString = sessionStateTypeStringVersions[i]; > > > + variant = g_variant_new_from_bytes(G_VARIANT_TYPE(sessionStateTypeString), data, FALSE); > > > + if (g_variant_is_normal_form(variant.get())) > > > + break; > > > + variant = nullptr; > > > + } > > > > You've tested this to ensure it doesn't emit a bunch of warnings or > > criticals when the type doesn't match? > > Yes, of course I tested it. My ephy history was successfully encoded with > version 1 (2 is tried first) and decoded with 2.
Ok, the opposite, decoded with 1 and encoded with 2 ...
Carlos Garcia Campos
Comment 7
2018-04-27 01:41:04 PDT
Committed
r231090
: <
https://trac.webkit.org/changeset/231090
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug