Skip to content

[webview_flutter] Refactor the C++ code #383

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

Merged
merged 5 commits into from
May 24, 2022

Conversation

swift-kim
Copy link
Member

Part of the code refactoring project.

BufferUnit and BufferPool:

  • Use in-class initializers (instead of initializer list in the constructor) for constant values.
  • Remove unused BufferUnit::Index.
  • Inline simple accessor functions (BufferUnit::IsUsed and BufferUnit::GpuBuffer).

WebView:

  • Change the type of params (constructor argument) to EncodableValue to reuse the GetValueFromEncodableMap function.
  • Never throw exceptions that are not explicitly handled in their call trees.
  • Rename RequestErrorType to ResourceErrorType.
  • Rename NeedsSwBackend to IsRunningOnEmulator.
  • Make texture_variant_ a unique pointer.
  • Make HandleMethodCall always send a result. (Fixes Improve HandleMethodCall method not to return without sending a result. #376.)
  • Remove unused IMF context-related code. The code has been unused since Refactor TextInputChannel engine#142. The code may reland in the future when the related functionality is reimplemented. @bbrto21
    • Registration of idle callbacks has been removed from DispatchKeyDownEvent and DispatchKeyUpEvent because HidePanel is no longer used.
    • "Select" has been added to KeyNameToKeyValue with KeyValue::EnterKey as a return value.

WebViewFactory:

  • Remove textureRegistrar from constructor arguments. It can be taken from registrar.
  • Extract GetAppDataPath as a function.
  • Remove unnecessary try-catch.

Other changes not listed in the above are style and readability fixes that are quite straightforward.

Copy link
Contributor

@bbrto21 bbrto21 left a comment

Choose a reason for hiding this comment

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

Overall, I think it's good.

@bbrto21
Copy link
Contributor

bbrto21 commented May 20, 2022

@seungsoo47 @bwikbs @JSUYA @Swanseo0
Please review this PR.

Copy link
Member

@bwikbs bwikbs left a comment

Choose a reason for hiding this comment

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

I agree with the overall direction. I'm happy with this refactoring.
Thanks. 👍

@swift-kim swift-kim force-pushed the refactor-webview-flutter branch from 84f34de to e457f49 Compare May 23, 2022 02:32
@bwikbs bwikbs merged commit edb60f7 into flutter-tizen:master May 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve HandleMethodCall method not to return without sending a result.
3 participants