Route app network TLS policy through platform services

This commit is contained in:
2026-06-04 17:35:24 +02:00
parent 401ce33498
commit 883be98557
10 changed files with 73 additions and 22 deletions

View File

@@ -222,6 +222,12 @@ public:
return work_directory_document_export_collections;
}
[[nodiscard]] bool disables_network_tls_verification() override
{
++network_tls_policy_checks;
return network_tls_verification_disabled;
}
[[nodiscard]] pp::platform::PreparedFileTarget prepare_writable_file(
std::string_view type,
std::string_view default_name,
@@ -283,6 +289,7 @@ public:
int pick_directory_requests = 0;
int prepared_file_write_policy_checks = 0;
int document_export_collection_policy_checks = 0;
int network_tls_policy_checks = 0;
int prepare_writable_file_requests = 0;
int save_prepared_file_requests = 0;
bool cursor_visible = false;
@@ -290,6 +297,7 @@ public:
bool prepared_file_saved = true;
bool prepared_file_writes = true;
bool work_directory_document_export_collections = false;
bool network_tls_verification_disabled = false;
bool deletes_recorded_files = true;
bool live_asset_reloading = true;
float last_platform_delta = 0.0f;
@@ -616,6 +624,17 @@ void platform_services_dispatch_document_export_collection_policy(pp::tests::Har
PP_EXPECT(harness, fake.document_export_collection_policy_checks == 2);
}
void platform_services_dispatch_network_tls_policy(pp::tests::Harness& harness)
{
FakePlatformServices fake("unused");
pp::platform::PlatformServices& services = fake;
PP_EXPECT(harness, !services.disables_network_tls_verification());
fake.network_tls_verification_disabled = true;
PP_EXPECT(harness, services.disables_network_tls_verification());
PP_EXPECT(harness, fake.network_tls_policy_checks == 2);
}
}
int main()
@@ -642,5 +661,6 @@ int main()
harness.run(
"platform services dispatch document export collection policy",
platform_services_dispatch_document_export_collection_policy);
harness.run("platform services dispatch network tls policy", platform_services_dispatch_network_tls_policy);
return harness.finish();
}