Remove legacy platform singleton accessor
This commit is contained in:
@@ -18,6 +18,13 @@ agent or engineer to remove them without reconstructing context from chat.
|
|||||||
|
|
||||||
## Reductions
|
## Reductions
|
||||||
|
|
||||||
|
- 2026-06-17: `DEBT-0017` was narrowed again.
|
||||||
|
`src/platform_legacy/legacy_platform_services.*` no longer exposes the dead
|
||||||
|
`pp::platform::legacy::platform_services()` fallback singleton; Linux,
|
||||||
|
WebGL, and Android already bind owned `create_platform_services(...)`
|
||||||
|
instances at their entrypoints, so the retained non-Windows debt is now
|
||||||
|
limited to the adapter implementation itself rather than a live global
|
||||||
|
accessor surface.
|
||||||
- 2026-06-16: `DEBT-0003` was narrowed again. `main.cpp` main-thread queued
|
- 2026-06-16: `DEBT-0003` was narrowed again. `main.cpp` main-thread queued
|
||||||
task state now lives behind a narrow retained helper instead of
|
task state now lives behind a narrow retained helper instead of
|
||||||
`RetainedState.main_tasklist` / `main_task_mutex` directly; broader Win32
|
`RetainedState.main_tasklist` / `main_task_mutex` directly; broader Win32
|
||||||
|
|||||||
@@ -70,6 +70,19 @@ What is already real:
|
|||||||
- `pp_app_core`
|
- `pp_app_core`
|
||||||
|
|
||||||
Latest slice:
|
Latest slice:
|
||||||
|
- `src/platform_legacy/legacy_platform_services.*` no longer exposes the dead
|
||||||
|
`pp::platform::legacy::platform_services()` singleton accessor.
|
||||||
|
- Linux, WebGL, and Android were already on owned
|
||||||
|
`create_platform_services(...)` instances, so removing that legacy singleton
|
||||||
|
surface does not change the live entrypoint ownership path.
|
||||||
|
- `src/platform_windows/windows_runtime_state.*` now owns the Win32 bound-app
|
||||||
|
and bound-tablet bindings beside the retained owned `App`, `AppRuntime*`,
|
||||||
|
and `WacomTablet` objects instead of leaving that binding surface in
|
||||||
|
`windows_runtime_shell.cpp`.
|
||||||
|
- `src/platform_windows/windows_runtime_shell.h` is now a thinner runtime
|
||||||
|
entrypoint header that picks up the retained binding surface from
|
||||||
|
`windows_runtime_state.h` instead of declaring a second shell-owned binding
|
||||||
|
API.
|
||||||
- `src/platform_windows/windows_runtime_session.*` now owns the bound-session
|
- `src/platform_windows/windows_runtime_session.*` now owns the bound-session
|
||||||
Win32 runtime loop/startup/shutdown body that had still been sitting inside
|
Win32 runtime loop/startup/shutdown body that had still been sitting inside
|
||||||
`windows_runtime_flow.cpp`.
|
`windows_runtime_flow.cpp`.
|
||||||
@@ -206,8 +219,8 @@ Latest slice:
|
|||||||
`PlatformServices` instance in `android_main()` and binds that owned service
|
`PlatformServices` instance in `android_main()` and binds that owned service
|
||||||
into `App` instead of binding the process-global fallback directly.
|
into `App` instead of binding the process-global fallback directly.
|
||||||
- `src/platform_legacy/legacy_platform_services.*` now exposes an ownable
|
- `src/platform_legacy/legacy_platform_services.*` now exposes an ownable
|
||||||
`create_platform_services()` entrypoint alongside the legacy fallback
|
`create_platform_services()` entrypoint for explicit per-entrypoint
|
||||||
accessor.
|
ownership.
|
||||||
- `linux/src/main.cpp` now owns a local legacy `PlatformServices` instance and
|
- `linux/src/main.cpp` now owns a local legacy `PlatformServices` instance and
|
||||||
binds it into `App` explicitly instead of binding the process-global legacy
|
binds it into `App` explicitly instead of binding the process-global legacy
|
||||||
accessor directly.
|
accessor directly.
|
||||||
@@ -215,9 +228,8 @@ Latest slice:
|
|||||||
`pp::platform::legacy::platform_services()` when `App` has no bound platform
|
`pp::platform::legacy::platform_services()` when `App` has no bound platform
|
||||||
services; the live app path now expects explicit platform-service ownership.
|
services; the live app path now expects explicit platform-service ownership.
|
||||||
- `linux/src/main.cpp`, `webgl/src/main.cpp`, and `android/src/cpp/main.cpp`
|
- `linux/src/main.cpp`, `webgl/src/main.cpp`, and `android/src/cpp/main.cpp`
|
||||||
now bind `pp::platform::legacy::platform_services()` explicitly at app
|
now bind owned `create_platform_services(...)` instances at app creation
|
||||||
creation instead of relying on the hidden fallback in `App` event/platform
|
instead of relying on a hidden fallback in `App` event/platform dispatch.
|
||||||
dispatch.
|
|
||||||
- `src/platform_windows/windows_runtime_shell.cpp` now owns the Windows tablet
|
- `src/platform_windows/windows_runtime_shell.cpp` now owns the Windows tablet
|
||||||
object directly; the composition edge no longer binds `&WacomTablet::I` into
|
object directly; the composition edge no longer binds `&WacomTablet::I` into
|
||||||
the Windows runtime path.
|
the Windows runtime path.
|
||||||
|
|||||||
@@ -78,6 +78,17 @@ Completed, blocked, and superseded task history moved to
|
|||||||
the queue is now ordered by code movement instead.
|
the queue is now ordered by code movement instead.
|
||||||
|
|
||||||
Current slice:
|
Current slice:
|
||||||
|
- `src/platform_legacy/legacy_platform_services.*` no longer exposes the dead
|
||||||
|
`pp::platform::legacy::platform_services()` singleton accessor.
|
||||||
|
- Linux, WebGL, and Android were already on owned
|
||||||
|
`create_platform_services(...)` instances, so removing that singleton does
|
||||||
|
not change the live entrypoint ownership path.
|
||||||
|
- `src/platform_windows/windows_runtime_state.*` now also owns the bound
|
||||||
|
Win32 `App*` / tablet binding surface alongside the retained owned `App`,
|
||||||
|
runtime, and tablet objects.
|
||||||
|
- `src/platform_windows/windows_runtime_shell.h` is thinner again and now
|
||||||
|
imports that binding surface from `windows_runtime_state.h` instead of
|
||||||
|
declaring shell-owned bind/release accessors itself.
|
||||||
- `src/platform_windows/windows_runtime_session.*` now owns the bound-session
|
- `src/platform_windows/windows_runtime_session.*` now owns the bound-session
|
||||||
Win32 runtime loop/startup/shutdown body.
|
Win32 runtime loop/startup/shutdown body.
|
||||||
- `src/platform_windows/windows_runtime_flow.cpp` is now only a thin handoff
|
- `src/platform_windows/windows_runtime_flow.cpp` is now only a thin handoff
|
||||||
@@ -198,8 +209,8 @@ Current slice:
|
|||||||
`PlatformServices` instance in `android_main()`, replacing the direct bind to
|
`PlatformServices` instance in `android_main()`, replacing the direct bind to
|
||||||
the process-global fallback accessor.
|
the process-global fallback accessor.
|
||||||
- `src/platform_legacy/legacy_platform_services.*` now exposes an ownable
|
- `src/platform_legacy/legacy_platform_services.*` now exposes an ownable
|
||||||
`create_platform_services()` entrypoint while keeping the fallback singleton
|
`create_platform_services()` entrypoint for explicit per-entrypoint
|
||||||
for non-migrated platforms.
|
ownership.
|
||||||
- `linux/src/main.cpp` now binds an owned legacy `PlatformServices` instance
|
- `linux/src/main.cpp` now binds an owned legacy `PlatformServices` instance
|
||||||
into `App`, making Linux the first explicit per-entrypoint owner of that
|
into `App`, making Linux the first explicit per-entrypoint owner of that
|
||||||
legacy service implementation.
|
legacy service implementation.
|
||||||
@@ -207,8 +218,8 @@ Current slice:
|
|||||||
`pp::platform::legacy::platform_services()`; touched app platform dispatch
|
`pp::platform::legacy::platform_services()`; touched app platform dispatch
|
||||||
now expects an explicitly bound platform-services pointer.
|
now expects an explicitly bound platform-services pointer.
|
||||||
- `linux/src/main.cpp`, `webgl/src/main.cpp`, and `android/src/cpp/main.cpp`
|
- `linux/src/main.cpp`, `webgl/src/main.cpp`, and `android/src/cpp/main.cpp`
|
||||||
now bind `pp::platform::legacy::platform_services()` explicitly at app
|
now bind owned `create_platform_services(...)` instances at app creation,
|
||||||
creation, removing the hidden fallback path from live non-Windows entrypoints.
|
removing the hidden fallback path from live non-Windows entrypoints.
|
||||||
- `src/platform_windows/windows_runtime_shell.cpp` now owns the Windows tablet
|
- `src/platform_windows/windows_runtime_shell.cpp` now owns the Windows tablet
|
||||||
object directly, removing the composition-edge `WacomTablet::I` binding from
|
object directly, removing the composition-edge `WacomTablet::I` binding from
|
||||||
the touched Windows runtime path.
|
the touched Windows runtime path.
|
||||||
|
|||||||
@@ -45,7 +45,8 @@ void webgl_sync();
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
// DEBT-0017: fallback for platforms that do not inject PlatformServices yet.
|
// DEBT-0017: retained non-Windows fallback adapter until each platform owns a
|
||||||
|
// concrete PlatformServices implementation without this bridge.
|
||||||
class LegacyPlatformServices final : public pp::platform::PlatformServices {
|
class LegacyPlatformServices final : public pp::platform::PlatformServices {
|
||||||
public:
|
public:
|
||||||
explicit LegacyPlatformServices(pp::platform::legacy::LegacyPlatformServicesConfig config = {})
|
explicit LegacyPlatformServices(pp::platform::legacy::LegacyPlatformServicesConfig config = {})
|
||||||
@@ -571,12 +572,6 @@ private:
|
|||||||
|
|
||||||
namespace pp::platform::legacy {
|
namespace pp::platform::legacy {
|
||||||
|
|
||||||
PlatformServices& platform_services()
|
|
||||||
{
|
|
||||||
static LegacyPlatformServices services;
|
|
||||||
return services;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::unique_ptr<PlatformServices> create_platform_services(
|
std::unique_ptr<PlatformServices> create_platform_services(
|
||||||
LegacyPlatformServicesConfig config)
|
LegacyPlatformServicesConfig config)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ struct LegacyPlatformServicesConfig {
|
|||||||
std::shared_ptr<pp::platform::PlatformStoragePaths> android_storage_paths;
|
std::shared_ptr<pp::platform::PlatformStoragePaths> android_storage_paths;
|
||||||
};
|
};
|
||||||
|
|
||||||
[[nodiscard]] PlatformServices& platform_services();
|
|
||||||
[[nodiscard]] std::unique_ptr<PlatformServices> create_platform_services(
|
[[nodiscard]] std::unique_ptr<PlatformServices> create_platform_services(
|
||||||
LegacyPlatformServicesConfig config = {});
|
LegacyPlatformServicesConfig config = {});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user