Move TachyonExpressSignallingMessenger into mediums/webrtc.

PiperOrigin-RevId: 919882997
This commit is contained in:
Francis Tsui
2026-05-22 15:19:17 -07:00
committed by Copybara-Service
parent c9c7e6ee57
commit b536c8da3a
9 changed files with 50 additions and 60 deletions
+2 -2
View File
@@ -525,8 +525,8 @@ let package = Package(
"connections/implementation/webrtc_endpoint_channel.cc",
"connections/implementation/mediums/webrtc.cc",
"connections/implementation/mediums/webrtc",
"internal/platform/tachyon_express_signaling_messenger.cc",
"internal/platform/tachyon_express_signaling_messenger.h",
"connections/implementation/mediums/webrtc/tachyon_express_signaling_messenger.cc",
"connections/implementation/mediums/webrtc/tachyon_express_signaling_messenger.h",
"internal/platform/implementation/apple/webrtc.h",
"internal/platform/implementation/apple/webrtc.mm",
// This breaks the build, but seems to work fine without it?
@@ -144,6 +144,37 @@ cc_library(
],
)
cc_library(
name = "tachyon_express_signaling_messenger",
srcs = ["tachyon_express_signaling_messenger.cc"],
hdrs = ["tachyon_express_signaling_messenger.h"],
visibility = [
"//connections:__subpackages__",
"//internal/platform/implementation:__subpackages__",
"//internal/test:__subpackages__",
],
deps = [
"//internal/account",
"//internal/platform:base",
"//internal/platform:logging",
"//internal/platform:types",
"//internal/platform/implementation:webrtc_platform",
"//internal/proto:messaging_cc_grpc_proto",
"//internal/proto:tachyon_cc_proto",
"//internal/rpc:utils",
"//location/nearby/sharing/lib/account:account_manager",
"//third_party/gloop/util/random:mt_random",
"//third_party/grpc:gpr",
"//third_party/grpc:grpc++",
"//util/random:util",
"@com_google_absl//absl/base:core_headers",
"@com_google_absl//absl/functional:any_invocable",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/synchronization",
"@com_google_absl//absl/time",
],
)
cc_library(
name = "fake_webrtc",
testonly = True,
@@ -12,9 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef NO_WEBRTC
#include "internal/platform/tachyon_express_signaling_messenger.h"
#include "connections/implementation/mediums/webrtc/tachyon_express_signaling_messenger.h"
#include <ctime>
#include <memory>
@@ -36,7 +34,6 @@
#include "internal/account/account_manager_impl.h"
#include "internal/platform/byte_array.h"
#include "internal/platform/count_down_latch.h"
#include "internal/platform/implementation/webrtc.h"
#include "internal/platform/logging.h"
#include "internal/proto/messaging.grpc.pb.h"
#include "internal/proto/tachyon.proto.h"
@@ -45,7 +42,7 @@
#include "internal/rpc/utils.h"
#include "util/random/util.h"
namespace nearby {
namespace nearby::connections::mediums {
namespace {
using ::google::internal::communications::instantmessaging::v1::ClientInfo;
@@ -340,6 +337,4 @@ bool TachyonExpressSignalingMessenger::SendMessage(absl::string_view peer_id,
return success;
}
} // namespace nearby
#endif // #ifndef NO_WEBRTC
} // namespace nearby::connections::mediums
@@ -12,12 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef THIRD_PARTY_NEARBY_INTERNAL_PLATFORM_TACHYON_MESSAGING_CLIENT_H_
#define THIRD_PARTY_NEARBY_INTERNAL_PLATFORM_TACHYON_MESSAGING_CLIENT_H_
#ifndef NO_WEBRTC
#include <grpcpp/security/credentials.h>
#ifndef CORE_INTERNAL_MEDIUMS_WEBRTC_TACHYON_MESSAGING_CLIENT_H_
#define CORE_INTERNAL_MEDIUMS_WEBRTC_TACHYON_MESSAGING_CLIENT_H_
#include <memory>
#include <string>
@@ -34,7 +30,7 @@
#include "internal/platform/implementation/webrtc.h"
#include "internal/proto/messaging.grpc.pb.h"
namespace nearby {
namespace nearby::connections::mediums {
// Interface for the messaging Tachyon service. See
// third_party/nearby/internal/proto/messaging.proto
@@ -98,8 +94,6 @@ class TachyonExpressSignalingMessenger : public api::WebRtcSignalingMessenger {
std::shared_ptr<ReceiveMessagesReader> reader_ = nullptr;
};
} // namespace nearby
} // namespace nearby::connections::mediums
#endif // #ifndef NO_WEBRTC
#endif // THIRD_PARTY_NEARBY_INTERNAL_PLATFORM_TACHYON_MESSAGING_CLIENT_H_
#endif // CORE_INTERNAL_MEDIUMS_WEBRTC_TACHYON_MESSAGING_CLIENT_H_
-32
View File
@@ -284,38 +284,6 @@ cc_library(
],
)
cc_library(
name = "tachyon_express_signaling_messenger",
srcs = ["tachyon_express_signaling_messenger.cc"],
hdrs = ["tachyon_express_signaling_messenger.h"],
visibility = [
"//connections:__subpackages__",
"//internal/platform/implementation:__subpackages__",
"//internal/test:__subpackages__",
"//third_party/nearby/presence:__subpackages__",
],
deps = [
":base",
":logging",
":types",
"//internal/account",
"//internal/platform/implementation:webrtc_platform",
"//internal/proto:messaging_cc_grpc_proto",
"//internal/proto:tachyon_cc_proto",
"//internal/rpc:utils",
"//location/nearby/sharing/lib/account:account_manager",
"//third_party/gloop/util/random:mt_random",
"//third_party/grpc:gpr",
"//third_party/grpc:grpc++",
"//util/random:util",
"@com_google_absl//absl/base:core_headers",
"@com_google_absl//absl/functional:any_invocable",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/synchronization",
"@com_google_absl//absl/time",
],
)
cc_library(
name = "comm",
srcs = [
+1 -2
View File
@@ -61,8 +61,8 @@ objc_library(
"webrtc.h",
],
deps = [
"//connections/implementation/mediums/webrtc:tachyon_express_signaling_messenger",
"//internal/platform:logging",
"//internal/platform:tachyon_express_signaling_messenger",
"//internal/platform:types",
"//internal/platform/implementation:webrtc_platform",
"//internal/proto:tachyon_cc_proto",
@@ -130,7 +130,6 @@ objc_library(
"//internal/crypto_cros",
"//internal/platform:comm",
"//internal/platform:logging",
"//internal/platform:tachyon_express_signaling_messenger",
"//internal/platform:types",
"//internal/proto:tachyon_cc_proto",
"//internal/platform:base",
@@ -25,10 +25,10 @@
#include "absl/status/status.h"
#include "absl/strings/string_view.h"
#include "connections/implementation/mediums/webrtc/tachyon_express_signaling_messenger.h"
#include "internal/platform/count_down_latch.h"
#include "internal/platform/crypto.h"
#include "internal/platform/logging.h"
#include "internal/platform/tachyon_express_signaling_messenger.h"
#include "internal/proto/tachyon.pb.h"
#include "internal/proto/tachyon_enums.proto.h"
#include "webrtc/api/create_modular_peer_connection_factory.h"
@@ -91,7 +91,8 @@ void WebRtcMedium::CreatePeerConnection(
std::unique_ptr<api::WebRtcSignalingMessenger> WebRtcMedium::GetSignalingMessenger(
absl::string_view self_id, const location::nearby::connections::LocationHint& location_hint) {
return std::make_unique<TachyonExpressSignalingMessenger>(self_id, location_hint);
return std::make_unique<
nearby::connections::mediums::TachyonExpressSignalingMessenger>(self_id, location_hint);
}
} // namespace nearby::apple
@@ -238,9 +238,9 @@ cc_library(
hdrs = ["webrtc.h"],
tags = ["windows"],
deps = [
"//connections/implementation/mediums/webrtc:tachyon_express_signaling_messenger",
"//internal/platform:logging",
"//internal/platform:tachyon_express_signaling_messenger",
"//internal/platform/implementation:comm",
"//internal/platform/implementation:webrtc_platform",
"//third_party/webrtc/files/stable/webrtc/api:create_modular_peer_connection_factory",
"//third_party/webrtc/files/stable/webrtc/api:peer_connection_interface",
"//third_party/webrtc/files/stable/webrtc/api:rtc_error",
@@ -22,9 +22,9 @@
#include <utility>
#include "absl/strings/string_view.h"
#include "connections/implementation/mediums/webrtc/tachyon_express_signaling_messenger.h"
#include "internal/platform/implementation/webrtc.h"
#include "internal/platform/logging.h"
#include "internal/platform/tachyon_express_signaling_messenger.h"
#include "webrtc/api/create_modular_peer_connection_factory.h"
#include "webrtc/api/peer_connection_interface.h"
#include "webrtc/api/rtc_error.h"
@@ -33,6 +33,8 @@
namespace nearby::windows {
using ::nearby::connections::mediums::TachyonExpressSignalingMessenger;
std::string WebRtcMedium::GetDefaultCountryCode() {
wchar_t systemGeoName[LOCALE_NAME_MAX_LENGTH];