mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-14 14:46:12 -04:00
Create separate WebRtc Platform.
PiperOrigin-RevId: 919274513
This commit is contained in:
committed by
Copybara-Service
parent
6fa56d81af
commit
765bd555e4
@@ -476,6 +476,7 @@ let package = Package(
|
||||
"internal/platform/implementation/apple/mutex_test.cc",
|
||||
"internal/platform/implementation/apple/atomic_boolean_test.cc",
|
||||
"internal/platform/implementation/apple/atomic_uint32_test.cc",
|
||||
"internal/platform/implementation/apple/webrtc_platform.mm",
|
||||
"internal/platform/implementation/shared/file_test.cc",
|
||||
"internal/platform/implementation/wifi_utils_test.cc",
|
||||
"internal/platform/atomic_boolean_test.cc",
|
||||
|
||||
@@ -51,6 +51,17 @@ objc_library(
|
||||
],
|
||||
)
|
||||
|
||||
objc_library(
|
||||
name = "apple_webrtc",
|
||||
srcs = [
|
||||
"webrtc_platform.mm",
|
||||
],
|
||||
deps = [
|
||||
":apple",
|
||||
"//internal/platform/implementation:webrtc_platform",
|
||||
],
|
||||
)
|
||||
|
||||
objc_library(
|
||||
name = "apple",
|
||||
srcs = [
|
||||
@@ -102,6 +113,7 @@ objc_library(
|
||||
"//internal/base:file_path",
|
||||
"//internal/base:files",
|
||||
"//internal/base:masker",
|
||||
"//internal/platform/implementation/apple/Flags",
|
||||
"//internal/platform/implementation/apple/Mediums/Hotspot",
|
||||
"//internal/account",
|
||||
"//internal/crypto_cros",
|
||||
|
||||
@@ -56,8 +56,10 @@ objc_library(
|
||||
"//internal/platform/implementation:comm",
|
||||
"//internal/platform/implementation:platform",
|
||||
"//internal/platform/implementation:types",
|
||||
"//internal/platform/implementation:webrtc_platform",
|
||||
"//internal/platform/implementation/apple", # buildcleaner: keep
|
||||
"//internal/platform/implementation/apple:Shared",
|
||||
"//internal/platform/implementation/apple:apple_webrtc", # buildcleaner: keep
|
||||
"//internal/platform/implementation/apple:ble_v2",
|
||||
"//internal/platform/implementation/apple:network_utils",
|
||||
"//internal/platform/implementation/apple/Flags",
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
// limitations under the License.
|
||||
|
||||
#include "internal/platform/implementation/platform.h"
|
||||
#include "internal/platform/implementation/webrtc_platform.h"
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <XCTest/XCTest.h>
|
||||
@@ -320,7 +321,7 @@ void GNCEnsureFileAtPath(std::string path) {
|
||||
}
|
||||
|
||||
- (void)testCreateWebRtcMedium {
|
||||
auto webrtc_medium = nearby::api::ImplementationPlatform::CreateWebRtcMedium();
|
||||
auto webrtc_medium = nearby::api::WebRtcImplementationPlatform::CreateWebRtcMedium();
|
||||
XCTAssertNotEqual(webrtc_medium.get(), nullptr);
|
||||
}
|
||||
|
||||
|
||||
@@ -45,10 +45,6 @@
|
||||
#include "internal/platform/implementation/shared/file.h"
|
||||
#include "internal/platform/payload_id.h"
|
||||
|
||||
#ifndef NO_WEBRTC
|
||||
#import "internal/platform/implementation/apple/webrtc.h"
|
||||
#endif
|
||||
|
||||
namespace nearby {
|
||||
namespace api {
|
||||
|
||||
@@ -205,12 +201,6 @@ std::unique_ptr<WifiDirectMedium> ImplementationPlatform::CreateWifiDirectMedium
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
#ifndef NO_WEBRTC
|
||||
std::unique_ptr<WebRtcMedium> ImplementationPlatform::CreateWebRtcMedium() {
|
||||
return std::make_unique<apple::WebRtcMedium>();
|
||||
}
|
||||
#endif
|
||||
|
||||
std::unique_ptr<AppLifecycleMonitor> ImplementationPlatform::CreateAppLifecycleMonitor(
|
||||
std::function<void(AppLifecycleMonitor::AppLifecycleState)> state_updated_callback) {
|
||||
#if TARGET_OS_IPHONE
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
// Copyright 2026 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.
|
||||
|
||||
#include "internal/platform/implementation/webrtc_platform.h"
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
#import "internal/platform/implementation/apple/webrtc.h"
|
||||
|
||||
namespace nearby {
|
||||
namespace api {
|
||||
|
||||
std::unique_ptr<WebRtcMedium> WebRtcImplementationPlatform::CreateWebRtcMedium() {
|
||||
return std::make_unique<apple::WebRtcMedium>();
|
||||
}
|
||||
|
||||
} // namespace api
|
||||
} // namespace nearby
|
||||
Reference in New Issue
Block a user