Move IceFieldTrials into own .h-file
Several patches for webrtc:10647 has split the
P2PTransportChannel class/file. This has had the
side effect of it being hard to share the IceFieldTrials-struct.
This patch moves that struct into own file so that can be included
from other components. This patch is a behavioral NOP.
BUG=webrtc:10647
Change-Id: If49cd4d919684a48dde3188a26baf20e4ff2cd8e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/160301
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29876}
diff --git a/p2p/BUILD.gn b/p2p/BUILD.gn
index a984e8a..312ade5 100644
--- a/p2p/BUILD.gn
+++ b/p2p/BUILD.gn
@@ -52,6 +52,7 @@
"base/p2p_constants.h",
"base/p2p_transport_channel.cc",
"base/p2p_transport_channel.h",
+ "base/p2p_transport_channel_ice_field_trials.h",
"base/packet_transport_interface.h",
"base/packet_transport_internal.cc",
"base/packet_transport_internal.h",
diff --git a/p2p/base/p2p_transport_channel.h b/p2p/base/p2p_transport_channel.h
index ee0cca2..fdc5dd2 100644
--- a/p2p/base/p2p_transport_channel.h
+++ b/p2p/base/p2p_transport_channel.h
@@ -36,6 +36,7 @@
#include "p2p/base/ice_controller_interface.h"
#include "p2p/base/ice_transport_internal.h"
#include "p2p/base/p2p_constants.h"
+#include "p2p/base/p2p_transport_channel_ice_field_trials.h"
#include "p2p/base/port_allocator.h"
#include "p2p/base/port_interface.h"
#include "p2p/base/regathering_controller.h"
@@ -76,21 +77,6 @@
PortInterface* origin_port_;
};
-struct IceFieldTrials {
- bool skip_relay_to_non_relay_connections = false;
- absl::optional<int> max_outstanding_pings;
-
- // Wait X ms before selecting a connection when having none.
- // This will make media slower, but will give us chance to find
- // a better connection before starting.
- absl::optional<int> initial_select_dampening;
-
- // If the connection has recevied a ping-request, delay by
- // maximum this delay. This will make media slower, but will
- // give us chance to find a better connection before starting.
- absl::optional<int> initial_select_dampening_ping_received;
-};
-
// P2PTransportChannel manages the candidates and connection process to keep
// two P2P clients connected to each other.
class RTC_EXPORT P2PTransportChannel : public IceTransportInternal {
diff --git a/p2p/base/p2p_transport_channel_ice_field_trials.h b/p2p/base/p2p_transport_channel_ice_field_trials.h
new file mode 100644
index 0000000..60a3777
--- /dev/null
+++ b/p2p/base/p2p_transport_channel_ice_field_trials.h
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2019 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.
+ */
+
+#ifndef P2P_BASE_P2P_TRANSPORT_CHANNEL_ICE_FIELD_TRIALS_H_
+#define P2P_BASE_P2P_TRANSPORT_CHANNEL_ICE_FIELD_TRIALS_H_
+
+#include "absl/types/optional.h"
+
+namespace cricket {
+
+// Field trials for P2PTransportChannel and friends,
+// put in separate file so that they can be shared e.g
+// with Connection.
+struct IceFieldTrials {
+ bool skip_relay_to_non_relay_connections = false;
+ absl::optional<int> max_outstanding_pings;
+
+ // Wait X ms before selecting a connection when having none.
+ // This will make media slower, but will give us chance to find
+ // a better connection before starting.
+ absl::optional<int> initial_select_dampening;
+
+ // If the connection has recevied a ping-request, delay by
+ // maximum this delay. This will make media slower, but will
+ // give us chance to find a better connection before starting.
+ absl::optional<int> initial_select_dampening_ping_received;
+};
+
+} // namespace cricket
+
+#endif // P2P_BASE_P2P_TRANSPORT_CHANNEL_ICE_FIELD_TRIALS_H_