You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: Align Windows Analytics stubs with SDK patterns
This commit incorporates detailed review feedback to align the
Windows Analytics C++ implementation (src/analytics_desktop.cc)
with common Firebase C++ SDK patterns for managing Futures and
including headers.
Key changes:
1. **Future Management for Stubbed APIs:**
- Replaced the previous Future creation mechanism (MakeFuture) for
stubbed functions (GetAnalyticsInstanceId, GetSessionId, and their
LastResult counterparts) with the standard FutureData pattern.
- Added a static FutureData instance (g_future_data), initialized in
firebase::analytics::Initialize() and cleaned up in Terminate().
- Defined an internal AnalyticsFn enum for Future function tracking.
- Stubbed Future-returning methods now use g_future_data to create
and complete Futures.
- As per feedback, these Futures are completed with error code 0
and a null error message. A LogWarning is now used to inform
developers that the called API is not supported on Desktop.
- Added checks for g_future_data initialization in these methods.
2. **Include Path Updates:**
- Corrected #include paths for common Firebase headers (app.h,
variant.h, future.h, log.h) to use full module-prefixed paths
(e.g., "app/src/include/firebase/app.h") instead of direct
"firebase/" paths.
- Removed a stale include comment.
These changes improve the consistency of the Windows Analytics stubs
with the rest of the Firebase C++ SDK.
0 commit comments