Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop copying content stream in .NET MAUI Blazor Windows #9254

Conversation

TanayParikh
Copy link
Contributor

Fixes: #9206

microsoft/CsWinRT#670 and https://task.ms/31565319 have been marked as resolved. This PR removes the existing logic which copies the content into a memory stream, and replaces it with a call to AsRandomAccessStream() (IRandomAccessStream is still required per the CoreWebView2 API).

I tried out CSS hot reload with this change and things are working as expected. Not sure if there's a particular behavior/technique we can use to verify the validity of this change. Spoke with @Eilon regarding this, and per his recollection things were immediately hanging, and that's why this change was necessitated.

I believe this will also end up fixing #9197, however that's a bit tougher to validate as the issue only repros on a new maui-blazor app, and not the sample app in the MAUI repo which we use to test the actual changes. Will have to do a quick validation after this merges to see if that's fixed as well.

Fixes: #9206

microsoft/CsWinRT#670 and https://task.ms/31565319 have been marked as resolved. This PR removes the existing logic which copies the content into a memory stream, and replaces it with a call to `AsRandomAccessStream()` (`IRandomAccessStream` is still required per the `CoreWebView2` API).

I tried out CSS hot reload with this change and things are working as expected. Not sure if there's a particular behavior/technique we can use to verify the validity of this change. Spoke with @Eilon regarding this, and per his recollection things were immediately hanging, and that's why this change was necessitated.
@TanayParikh TanayParikh requested a review from Eilon August 8, 2022 02:48
@TanayParikh TanayParikh requested a review from a team as a code owner August 8, 2022 02:48
@TanayParikh TanayParikh self-assigned this Aug 8, 2022
@TanayParikh TanayParikh added the 7.0-rc1 Created by mkArtakMSFT label Aug 8, 2022
@TanayParikh TanayParikh added this to the 7.0-rc1 milestone Aug 8, 2022
@Eilon Eilon added the area-blazor Blazor Hybrid / Desktop, BlazorWebView label Aug 8, 2022
Copy link
Member

@Eilon Eilon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is good. If it's bad, we will find out very quickly, I think.

@TanayParikh TanayParikh merged commit 060839f into main Aug 8, 2022
@TanayParikh TanayParikh deleted the taparik/mauiWindowsStopCopyingContentBeforeSendingToWebView branch August 8, 2022 21:18
@github-actions github-actions bot locked and limited conversation to collaborators Dec 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
7.0-rc1 Created by mkArtakMSFT area-blazor Blazor Hybrid / Desktop, BlazorWebView fixed-in-7.0.0-rc.1.6683 platform/windows 🪟
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Explore removing resource copy into memory for .NET MAUI Blazor WebView on Windows
3 participants