Commit e8cd34ee authored by Antonio Gomes's avatar Antonio Gomes Committed by Commit Bot

Move stun_field_trial.h out of the Blink API

BUG=787254, 919392
R=guidou@chromium.org, haraken@chromium.org

Change-Id: Id4b213f3a43515b3e501d5af9d9ce11fee5c09fb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1806976
Commit-Queue: Antonio Gomes <tonikitoo@igalia.com>
Reviewed-by: default avatarGuido Urdaneta <guidou@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#697633}
parent 6d315388
......@@ -159,7 +159,6 @@ source_set("blink_headers") {
"platform/modules/peerconnection/rtc_event_log_output_sink_proxy_util.h",
"platform/modules/peerconnection/rtc_video_decoder_factory_util.h",
"platform/modules/peerconnection/rtc_video_encoder_factory_util.h",
"platform/modules/peerconnection/stun_field_trial.h",
"platform/modules/peerconnection/two_keys_adapter_map.h",
"platform/modules/peerconnection/video_codec_factory.h",
"platform/modules/peerconnection/webrtc_audio_sink.h",
......
......@@ -12,7 +12,6 @@
#include "base/sequence_checker.h"
#include "base/single_thread_task_runner.h"
#include "base/threading/thread.h"
#include "third_party/blink/public/platform/modules/peerconnection/stun_field_trial.h"
#include "third_party/blink/public/platform/web_common.h"
#include "third_party/webrtc/api/peer_connection_interface.h"
#include "third_party/webrtc/p2p/stunprober/stun_prober.h"
......@@ -39,6 +38,7 @@ class IpcNetworkManager;
class IpcPacketSocketFactory;
class MdnsResponderAdapter;
class P2PSocketDispatcher;
class StunProberTrial;
class WebLocalFrame;
class WebRTCPeerConnectionHandler;
class WebRTCPeerConnectionHandlerClient;
......
......@@ -46,6 +46,7 @@
#include "third_party/blink/renderer/platform/p2p/mdns_responder_adapter.h"
#include "third_party/blink/renderer/platform/p2p/port_allocator.h"
#include "third_party/blink/renderer/platform/p2p/socket_dispatcher.h"
#include "third_party/blink/renderer/platform/peerconnection/stun_field_trial.h"
#include "third_party/webrtc/api/call/call_factory_interface.h"
#include "third_party/webrtc/api/peer_connection_interface.h"
#include "third_party/webrtc/api/rtc_event_log/rtc_event_log_factory.h"
......
......@@ -1272,6 +1272,7 @@ jumbo_component("platform") {
"peerconnection/rtc_video_encoder_factory.h",
"peerconnection/rtc_void_request.h",
"peerconnection/stun_field_trial.cc",
"peerconnection/stun_field_trial.h",
"peerconnection/transmission_encoding_info_handler.cc",
"peerconnection/transmission_encoding_info_handler.h",
"peerconnection/video_codec_factory.cc",
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "third_party/blink/public/platform/modules/peerconnection/stun_field_trial.h"
#include "third_party/blink/renderer/platform/peerconnection/stun_field_trial.h"
#include <math.h>
......
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_PEERCONNECTION_STUN_FIELD_TRIAL_H_
#define THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_PEERCONNECTION_STUN_FIELD_TRIAL_H_
#ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_PEERCONNECTION_STUN_FIELD_TRIAL_H_
#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_PEERCONNECTION_STUN_FIELD_TRIAL_H_
#include <memory>
#include <string>
......@@ -14,7 +14,7 @@
#include "base/timer/timer.h"
#include "third_party/blink/public/platform/modules/p2p/network_list_manager.h"
#include "third_party/blink/public/platform/modules/p2p/network_list_observer.h"
#include "third_party/blink/public/platform/web_common.h"
#include "third_party/blink/renderer/platform/platform_export.h"
#include "third_party/webrtc/p2p/stunprober/stun_prober.h"
#include "third_party/webrtc/rtc_base/network.h"
#include "third_party/webrtc/rtc_base/third_party/sigslot/sigslot.h"
......@@ -32,13 +32,11 @@ namespace blink {
// stun probe.
static const int kExperimentStartDelayMs = 30000;
// TODO(crbug.com/787254): Move this class out of the Blink exposed API when
// all users of it have been Onion souped. Also migrate away from std::vector
// and std::string.
// TODO(crbug.com/787254): Migrate away from std::vector and std::string.
class StunProberTrial : public stunprober::StunProber::Observer,
public sigslot::has_slots<> {
public:
struct BLINK_PLATFORM_EXPORT Param {
struct PLATFORM_EXPORT Param {
Param();
~Param();
int requests_per_ip = 0;
......@@ -49,9 +47,9 @@ class StunProberTrial : public stunprober::StunProber::Observer,
std::vector<rtc::SocketAddress> servers;
};
BLINK_PLATFORM_EXPORT StunProberTrial(rtc::NetworkManager* network_manager,
const std::string& params,
rtc::PacketSocketFactory* factory);
PLATFORM_EXPORT StunProberTrial(rtc::NetworkManager* network_manager,
const std::string& params,
rtc::PacketSocketFactory* factory);
~StunProberTrial() override;
private:
......@@ -61,9 +59,8 @@ class StunProberTrial : public stunprober::StunProber::Observer,
void OnNetworksChanged();
// Parsing function to decode the '/' separated parameter string |params|.
static BLINK_PLATFORM_EXPORT bool ParseParameters(
const std::string& param_line,
Param* params);
static PLATFORM_EXPORT bool ParseParameters(const std::string& param_line,
Param* params);
// stunprober::StunProber::Observer:
void OnPrepared(stunprober::StunProber* prober,
......@@ -103,4 +100,4 @@ class StunProberTrial : public stunprober::StunProber::Observer,
} // namespace blink
#endif // THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_PEERCONNECTION_STUN_FIELD_TRIAL_H_
#endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_PEERCONNECTION_STUN_FIELD_TRIAL_H_
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "third_party/blink/public/platform/modules/peerconnection/stun_field_trial.h"
#include "third_party/blink/renderer/platform/peerconnection/stun_field_trial.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/webrtc/rtc_base/socket_address.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment