Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(251)

Unified Diff: webrtc/test/channel_transport/udp_socket_manager_wrapper.cc

Issue 2336123002: Revert of Moved webrtc/test/channel_transport/ into webrtc/voice_engine/test/ (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/test/channel_transport/udp_socket_manager_wrapper.cc
diff --git a/webrtc/test/channel_transport/udp_socket_manager_wrapper.cc b/webrtc/test/channel_transport/udp_socket_manager_wrapper.cc
new file mode 100644
index 0000000000000000000000000000000000000000..3127767cbc7bf746a968382182afc7e1a47e0906
--- /dev/null
+++ b/webrtc/test/channel_transport/udp_socket_manager_wrapper.cc
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#include "webrtc/test/channel_transport/udp_socket_manager_wrapper.h"
+
+#include <assert.h>
+
+#ifdef _WIN32
+#include "webrtc/system_wrappers/include/fix_interlocked_exchange_pointer_win.h"
+#include "webrtc/test/channel_transport/udp_socket2_manager_win.h"
+#else
+#include "webrtc/test/channel_transport/udp_socket_manager_posix.h"
+#endif
+
+namespace webrtc {
+namespace test {
+
+UdpSocketManager* UdpSocketManager::CreateInstance()
+{
+#if defined(_WIN32)
+ return static_cast<UdpSocketManager*>(new UdpSocket2ManagerWindows());
+#else
+ return new UdpSocketManagerPosix();
+#endif
+}
+
+UdpSocketManager* UdpSocketManager::StaticInstance(
+ CountOperation count_operation,
+ const int32_t id,
+ uint8_t& numOfWorkThreads)
+{
+ UdpSocketManager* impl =
+ GetStaticInstance<UdpSocketManager>(count_operation);
+ if (count_operation == kAddRef && impl != NULL) {
+ if (impl->Init(id, numOfWorkThreads)) {
+ impl->Start();
+ }
+ }
+ return impl;
+}
+
+UdpSocketManager* UdpSocketManager::Create(const int32_t id,
+ uint8_t& numOfWorkThreads)
+{
+ return UdpSocketManager::StaticInstance(kAddRef, id, numOfWorkThreads);
+}
+
+void UdpSocketManager::Return()
+{
+ uint8_t numOfWorkThreads = 0;
+ UdpSocketManager::StaticInstance(kRelease, -1,
+ numOfWorkThreads);
+}
+
+UdpSocketManager::UdpSocketManager() : _numOfWorkThreads(0)
+{
+}
+
+uint8_t UdpSocketManager::WorkThreads() const
+{
+ return _numOfWorkThreads;
+}
+
+} // namespace test
+} // namespace webrtc
« no previous file with comments | « webrtc/test/channel_transport/udp_socket_manager_wrapper.h ('k') | webrtc/test/channel_transport/udp_socket_posix.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698