From 8a88a78f25478c353606c8d46525d30fd1a5e9b6 Mon Sep 17 00:00:00 2001 From: Francis Tsui Date: Tue, 14 Oct 2025 08:33:34 -0700 Subject: [PATCH] Remove unused platform interface method. PiperOrigin-RevId: 819236789 --- internal/platform/implementation/BUILD | 1 - .../apple/Tests/GNCPlatformTest.mm | 5 -- .../platform/implementation/apple/platform.mm | 4 - .../platform/implementation/g3/platform.cc | 6 -- internal/platform/implementation/platform.h | 4 - .../platform/implementation/server_sync.h | 74 ------------------- 6 files changed, 94 deletions(-) delete mode 100644 internal/platform/implementation/server_sync.h diff --git a/internal/platform/implementation/BUILD b/internal/platform/implementation/BUILD index cc0f2e69..a3e1cadf 100644 --- a/internal/platform/implementation/BUILD +++ b/internal/platform/implementation/BUILD @@ -157,7 +157,6 @@ cc_library( "credential_storage.h", "http_loader.h", "psk_info.h", - "server_sync.h", "webrtc.h", "wifi.h", "wifi_direct.h", diff --git a/internal/platform/implementation/apple/Tests/GNCPlatformTest.mm b/internal/platform/implementation/apple/Tests/GNCPlatformTest.mm index 9a307730..6130ecb9 100644 --- a/internal/platform/implementation/apple/Tests/GNCPlatformTest.mm +++ b/internal/platform/implementation/apple/Tests/GNCPlatformTest.mm @@ -314,11 +314,6 @@ void GNCEnsureFileAtPath(std::string path) { XCTAssertNotEqual(ble_medium.get(), nullptr); } -- (void)testCreateServerSyncMedium { - auto server_sync_medium = nearby::api::ImplementationPlatform::CreateServerSyncMedium(); - XCTAssertEqual(server_sync_medium.get(), nullptr); -} - - (void)testCreateWifiDirectMedium { auto wifi_direct_medium = nearby::api::ImplementationPlatform::CreateWifiDirectMedium(); XCTAssertEqual(wifi_direct_medium.get(), nullptr); diff --git a/internal/platform/implementation/apple/platform.mm b/internal/platform/implementation/apple/platform.mm index 8be11d6f..dd301d36 100644 --- a/internal/platform/implementation/apple/platform.mm +++ b/internal/platform/implementation/apple/platform.mm @@ -177,10 +177,6 @@ std::unique_ptr ImplementationPlatform::CreateBleMedium( return std::make_unique(); } -std::unique_ptr ImplementationPlatform::CreateServerSyncMedium() { - return nullptr; -} - std::unique_ptr ImplementationPlatform::CreateWifiMedium() { return std::make_unique(); } diff --git a/internal/platform/implementation/g3/platform.cc b/internal/platform/implementation/g3/platform.cc index 66443d04..74292122 100644 --- a/internal/platform/implementation/g3/platform.cc +++ b/internal/platform/implementation/g3/platform.cc @@ -44,7 +44,6 @@ #include "internal/platform/implementation/output_file.h" #include "internal/platform/implementation/preferences_manager.h" #include "internal/platform/implementation/scheduled_executor.h" -#include "internal/platform/implementation/server_sync.h" #include "internal/platform/implementation/shared/count_down_latch.h" #include "internal/platform/implementation/submittable_executor.h" #include "internal/platform/implementation/timer.h" @@ -196,11 +195,6 @@ ImplementationPlatform::CreateCredentialStorage() { return std::make_unique(); } -std::unique_ptr -ImplementationPlatform::CreateServerSyncMedium() { - return std::unique_ptr(/*new ServerSyncMediumImpl()*/); -} - std::unique_ptr ImplementationPlatform::CreateWifiMedium() { return std::make_unique(); } diff --git a/internal/platform/implementation/platform.h b/internal/platform/implementation/platform.h index 6f310750..b38aaeb8 100644 --- a/internal/platform/implementation/platform.h +++ b/internal/platform/implementation/platform.h @@ -30,7 +30,6 @@ #include "internal/platform/implementation/condition_variable.h" #include "internal/platform/implementation/count_down_latch.h" #include "internal/platform/implementation/credential_storage.h" -#include "internal/platform/implementation/crypto.h" #include "internal/platform/implementation/device_info.h" #include "internal/platform/implementation/http_loader.h" #include "internal/platform/implementation/input_file.h" @@ -38,9 +37,7 @@ #include "internal/platform/implementation/mutex.h" #include "internal/platform/implementation/output_file.h" #include "internal/platform/implementation/scheduled_executor.h" -#include "internal/platform/implementation/server_sync.h" #include "internal/platform/implementation/submittable_executor.h" -#include "internal/platform/implementation/system_clock.h" #include "internal/platform/implementation/timer.h" #ifndef NO_WEBRTC #include "internal/platform/implementation/webrtc.h" @@ -131,7 +128,6 @@ class ImplementationPlatform { static std::unique_ptr CreateBleMedium( api::BluetoothAdapter&); static std::unique_ptr CreateCredentialStorage(); - static std::unique_ptr CreateServerSyncMedium(); static std::unique_ptr CreateWifiMedium(); static std::unique_ptr CreateWifiLanMedium(); static std::unique_ptr CreateWifiHotspotMedium(); diff --git a/internal/platform/implementation/server_sync.h b/internal/platform/implementation/server_sync.h deleted file mode 100644 index 400af7d7..00000000 --- a/internal/platform/implementation/server_sync.h +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef PLATFORM_API_SERVER_SYNC_H_ -#define PLATFORM_API_SERVER_SYNC_H_ - -#include - -#include "absl/strings/string_view.h" -#include "internal/platform/byte_array.h" - -namespace nearby { -namespace api { - -// Abstraction that represents a Nearby endpoint exchanging data through -// ServerSync Medium. -class ServerSyncDevice { - public: - virtual ~ServerSyncDevice() = default; - - virtual std::string GetName() const = 0; - virtual std::string GetGuid() const = 0; - virtual std::string GetOwnGuid() const = 0; -}; - -// Container of operations that can be performed over the Chrome Sync medium. -class ServerSyncMedium { - public: - virtual ~ServerSyncMedium() = default; - - virtual bool StartAdvertising(absl::string_view service_id, - absl::string_view endpoint_id, - const ByteArray& endpoint_info) = 0; - virtual void StopAdvertising(absl::string_view service_id) = 0; - - class DiscoveredDeviceCallback { - public: - virtual ~DiscoveredDeviceCallback() = default; - - // Called on a new ServerSyncDevice discovery. - virtual void OnDeviceDiscovered(ServerSyncDevice* device, - absl::string_view service_id, - absl::string_view endpoint_id, - const ByteArray& endpoint_info) = 0; - // Called when ServerSyncDevice is no longer reachable. - virtual void OnDeviceLost(ServerSyncDevice* device, - absl::string_view service_id) = 0; - }; - - // Returns true once the Chrome Sync scan has been initiated. - virtual bool StartDiscovery( - absl::string_view service_id, - const DiscoveredDeviceCallback& discovered_device_callback) = 0; - // Returns true once Chrome Sync scan for service_id is well and truly - // stopped; after this returns, there must be no more invocations of the - // DiscoveredDeviceCallback passed in to startScanning() for service_id. - virtual void StopDiscovery(absl::string_view service_id) = 0; -}; - -} // namespace api -} // namespace nearby - -#endif // PLATFORM_API_SERVER_SYNC_H_