[WIP] Refactor InfiniFrame.Native#267
Draft
freakdaniel wants to merge 1 commit intoInfiniLore:corefrom
Draft
Conversation
- Introduced InfiniFrameNativeStatusCode enum to represent native call status - Updated InfiniFrameNative methods to return status codes instead of void - Added EnsureSucceeded method to handle error checking and throw exceptions with detailed messages - Modified InvokeUtilities to use status codes in callbacks - Updated MonitorsUtility and InfiniFrameWindow to handle status codes and ensure proper error handling - Added tests for native export guards to validate error handling and status codes - Divide Exports to logical code-zones - Update clang and testing utilities - Add native_quality.sh for QA CI - Update CMakeLists for new native structure - Create & Update Interop layer
Contributor
Author
|
It will be a big headache |
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Major refactoring of the InfiniFrame.Native interop layer to address issue #260. PR introduces a status-code-based error propagation model, modularizes platform-specific code into focused components, establishes native CI quality gates, and centralizes memory ownership contracts. The monolithic Exports.cpp and platform window files are split into logical modules with consistent precondition guards
Type of Change
Affected Modules / Scope
Changes Introduced
Interop Layer Redesign
InfiniFrameNativeStatusCodeenum for consistent native call status reportingNativeResult.hwithEnsureSucceeded()method for error checking and detailed exception messagesNativeString.handNativeBuffer.hto centralize string/buffer ownership contractsInitParamsReader.hfor validated init parameter parsingExportApi.hwith shared export declarationsExport Modularization
Exports.cpp- main entry/exit with guardsExports.Browser.cpp- browser operations (navigation, web messaging, notifications, custom schemes)Exports.Dialog.cpp- dialog operationsExports.Events.cpp- event callbacks (monitors, closing, focus, moved, resized, invoke)Exports.Lifecycle.cpp- window lifecycle (ctor/dtor/close)Exports.Memory.cpp- memory operations (FreeString, FreeStringArray)Exports.Platform.cpp- platform-specific APIsExports.WindowCommands.cpp- window commands (center, restore, minimize, maximize, etc.)Platform Modularization
Window.cppintoWindowProc.Win32.cpp/h,WebView2Host.Win32.cpp,WebView2CustomSchemes.Win32.cpp/h,WebView2Messaging.Win32.cpp,WebView2ResourceRequests.Win32.cpp,WebView2Settings.Win32.cpp,WebView2Bridge.Win32.cpp,Monitors.Win32.cpp,Notifications.WinToast.cpp,UiDispatcher.Win32.cpp,WindowImpl.Win32.hWindow.cppintoWebKitBridge.Gtk.cpp,WebKitCustomSchemes.Gtk.cpp,WebKitMessaging.Gtk.cpp/h,WebKitSettings.Gtk.cpp,Monitors.Gtk.cpp,Notifications.LibNotify.cpp,UiDispatcher.Gtk.cpp,WindowState.Gtk.cpp,WindowImpl.Gtk.hWKWebViewBridge.Cocoa.mm,WKWebViewSettings.Cocoa.mm,WKCustomSchemes.Cocoa.mm,WKJsInterop.Cocoa.mm,Monitors.Cocoa.mm,Notifications.UserNotifications.Cocoa.mm,UiDispatcher.Cocoa.mm,WindowState.Cocoa.mm,WindowImpl.Cocoa.hError Handling Improvements
exit(0)paths in window construction with error propagation viaEnsureSucceeded()InvokeUtilitiesandMonitorsUtilityto use status codes in callbacksInfiniFrameWindowto handle status codes and ensure proper error propagationTest Infrastructure
Exports.Tests.cpp) now behindINFINIFRAME_BUILD_TEST_EXPORTScmake optionInfiniFrameNativeExportGuardTests.csto validate error handling and status codesInfiniFrameNativeTestExports=truefor test buildsCI Quality Gates
native_quality.shscript with clang-format, clang-tidy, and sanitizer build modesShared Components
CustomSchemeResponse.hfor cross-platform custom scheme response handlingInfiniWindowExtensions.csFluent API with status code supportInfiniFrameNative.csto return status codesInfiniFrameNativeStatusCode.csenumRelated Issues
exit(0)on errorsChecklist