Skip to content

Create WebKitFrameWrapper if it doesn't exist#1130

Merged
magomez merged 1 commit intoWebPlatformForEmbedded:wpe-2.38from
varumugam123:fix_is_main_frame_query
Aug 1, 2023
Merged

Create WebKitFrameWrapper if it doesn't exist#1130
magomez merged 1 commit intoWebPlatformForEmbedded:wpe-2.38from
varumugam123:fix_is_main_frame_query

Conversation

@varumugam123
Copy link
Copy Markdown

We see that with wpe-2.38 (07fdc07), when the browser instance is created a warning message as below is logged

gboolean webkit_frame_is_main_frame(WebKitFrame*): assertion 'WEBKIT_IS_FRAME(frame)' failed

On further check it is observed that, post WebKit/WebKit@4a9e02a commit, it is possible to emit DID_START_PROVISIONAL_LOAD_FOR_FRAME signal with a null "webKitFrame" from https://github.com/WebPlatformForEmbedded/WPEWebKit/blob/wpe-2.38/Source/WebKit/WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp#L198 (because at that moment webkitFrameGet() could return nullptr).

Replacing webkitFrameGet() with webkitFrameGetOrCreate() to be in sync with wpe-2.28 and to correctly emit signal with a valid frame.

@varumugam123 varumugam123 marked this pull request as ready for review July 28, 2023 14:16
@woutermeek woutermeek requested a review from magomez July 28, 2023 19:27
@varumugam123
Copy link
Copy Markdown
Author

varumugam123 commented Jul 31, 2023 via email

@varumugam123
Copy link
Copy Markdown
Author

The change I proposed too has some minor error that now, the signals (or even the URI update) is done only for main frames (due to the early check). I will correct it shortly...

@varumugam123 varumugam123 force-pushed the fix_is_main_frame_query branch from 1671b06 to b195fe7 Compare July 31, 2023 11:28
@magomez
Copy link
Copy Markdown

magomez commented Jul 31, 2023

I'm going to look into the consequences of using webkitFrameGetOrCreate instead of webkitFrameGet. If creating the frame at that point is not a problem this can be merged.
But please, merge both commits into a single one. It doesn't make sense to keep them separated.

@varumugam123 varumugam123 force-pushed the fix_is_main_frame_query branch from b195fe7 to ef60e97 Compare July 31, 2023 12:20
@varumugam123
Copy link
Copy Markdown
Author

varumugam123 commented Jul 31, 2023

I'm going to look into the consequences of using webkitFrameGetOrCreate instead of webkitFrameGet. If creating the frame at that point is not a problem this can be merged.

Thanks!

But please, merge both commits into a single one. It doesn't make sense to keep them separated.

Done

@magomez
Copy link
Copy Markdown

magomez commented Jul 31, 2023

@varumugam123 it seems that using webkitFrameGetOrCreate is fine. But the change should only be needed for didStartProvisionalLoadForFrame, which is where we need to have a WebKitFrame to use for the signal. We shouldn't need to force the creation of the WebKitFrame for the other cases that you modified. Did you find any problem with those as well? Or did you perform the same change on every function just to keep the coherency? If there are no concrete problems detected for the other functions, it would be better to leave them as they are, and fix only the problematic case.

@varumugam123
Copy link
Copy Markdown
Author

Right, didStartProvisionalLoadForFrame() is the only place which emits a signal and of concern. I carry forwarded the change over to the other functions just to be consistent with didStartProvisionalLoadForFrame (with wpe-2.28 as well).

But I can restrict the change only to didStartProvisionalLoadForFrame(), will update the PR shortly

@varumugam123 varumugam123 force-pushed the fix_is_main_frame_query branch from ef60e97 to bc89f63 Compare August 1, 2023 08:08
@magomez magomez merged commit d67f254 into WebPlatformForEmbedded:wpe-2.38 Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants