Commit 2dc64b39 authored by Antonio Gomes's avatar Antonio Gomes Committed by Commit Bot

Move {ipc,empty}_network_manager.h and out of Blink API

... down into blink/renderer.

CL also moves the following pure virtual classes: network_list_manager.h
and network_list_observer.h to the same location, and adds a TODO to
verify their existence altogether.

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

Change-Id: Iabba2936c745d028f5388153d5fe0d10ec19a8b0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1806977
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@{#697641}
parent 65274319
......@@ -149,10 +149,6 @@ source_set("blink_headers") {
"platform/modules/mediastream/web_platform_media_stream_source.h",
"platform/modules/mediastream/web_platform_media_stream_track.h",
"platform/modules/mediastream/webrtc_uma_histograms.h",
"platform/modules/p2p/empty_network_manager.h",
"platform/modules/p2p/ipc_network_manager.h",
"platform/modules/p2p/network_list_manager.h",
"platform/modules/p2p/network_list_observer.h",
"platform/modules/p2p/socket_client.h",
"platform/modules/peerconnection/audio_codec_factory.h",
"platform/modules/peerconnection/rtc_event_log_output_sink.h",
......
......@@ -24,8 +24,6 @@
#include "media/video/gpu_video_accelerator_factories.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/common/peerconnection/webrtc_ip_handling_policy.h"
#include "third_party/blink/public/platform/modules/p2p/empty_network_manager.h"
#include "third_party/blink/public/platform/modules/p2p/ipc_network_manager.h"
#include "third_party/blink/public/platform/modules/peerconnection/audio_codec_factory.h"
#include "third_party/blink/public/platform/modules/peerconnection/video_codec_factory.h"
#include "third_party/blink/public/platform/modules/webrtc/webrtc_logging.h"
......@@ -41,7 +39,9 @@
#include "third_party/blink/public/web/modules/webrtc/webrtc_audio_device_impl.h"
#include "third_party/blink/public/web/web_document.h"
#include "third_party/blink/public/web/web_local_frame.h"
#include "third_party/blink/renderer/platform/p2p/empty_network_manager.h"
#include "third_party/blink/renderer/platform/p2p/filtering_network_manager.h"
#include "third_party/blink/renderer/platform/p2p/ipc_network_manager.h"
#include "third_party/blink/renderer/platform/p2p/ipc_socket_factory.h"
#include "third_party/blink/renderer/platform/p2p/mdns_responder_adapter.h"
#include "third_party/blink/renderer/platform/p2p/port_allocator.h"
......
......@@ -1230,15 +1230,19 @@ jumbo_component("platform") {
"mojo/string16_mojom_traits.cc",
"mojo/string16_mojom_traits.h",
"p2p/empty_network_manager.cc",
"p2p/empty_network_manager.h",
"p2p/filtering_network_manager.cc",
"p2p/filtering_network_manager.h",
"p2p/host_address_request.cc",
"p2p/host_address_request.h",
"p2p/ipc_network_manager.cc",
"p2p/ipc_network_manager.h",
"p2p/ipc_socket_factory.cc",
"p2p/ipc_socket_factory.h",
"p2p/mdns_responder_adapter.cc",
"p2p/mdns_responder_adapter.h",
"p2p/network_list_manager.h",
"p2p/network_list_observer.h",
"p2p/network_manager_uma.cc",
"p2p/network_manager_uma.h",
"p2p/port_allocator.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/p2p/empty_network_manager.h"
#include "third_party/blink/renderer/platform/p2p/empty_network_manager.h"
#include "base/bind.h"
#include "base/location.h"
......
......@@ -2,13 +2,13 @@
// 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_P2P_EMPTY_NETWORK_MANAGER_H_
#define THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_P2P_EMPTY_NETWORK_MANAGER_H_
#ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_P2P_EMPTY_NETWORK_MANAGER_H_
#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_P2P_EMPTY_NETWORK_MANAGER_H_
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "base/threading/thread_checker.h"
#include "third_party/blink/public/platform/web_common.h"
#include "third_party/blink/renderer/platform/platform_export.h"
#include "third_party/webrtc/rtc_base/network.h"
#include "third_party/webrtc/rtc_base/third_party/sigslot/sigslot.h"
......@@ -21,17 +21,14 @@ namespace blink {
// A NetworkManager implementation which handles the case where local address
// enumeration is not requested and just returns empty network lists. This class
// is not thread safe and should only be used by WebRTC's network thread.
//
// TODO(crbug.com/787254): Move this class out of the Blink exposed API when
// all users of it have been Onion souped. Also, move it away from std::vector.
class EmptyNetworkManager : public rtc::NetworkManagerBase,
public sigslot::has_slots<> {
public:
// This class is created by WebRTC's signaling thread but used by WebRTC's
// worker thread |task_runner|.
BLINK_PLATFORM_EXPORT explicit EmptyNetworkManager(
PLATFORM_EXPORT explicit EmptyNetworkManager(
rtc::NetworkManager* network_manager);
BLINK_PLATFORM_EXPORT ~EmptyNetworkManager() override;
PLATFORM_EXPORT ~EmptyNetworkManager() override;
// rtc::NetworkManager:
void StartUpdating() override;
......@@ -69,4 +66,4 @@ class EmptyNetworkManager : public rtc::NetworkManagerBase,
} // namespace blink
#endif // THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_P2P_EMPTY_NETWORK_MANAGER_H_
#endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_P2P_EMPTY_NETWORK_MANAGER_H_
......@@ -18,7 +18,7 @@
#include "media/base/media_permission.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/platform/modules/p2p/empty_network_manager.h"
#include "third_party/blink/renderer/platform/p2p/empty_network_manager.h"
#include "third_party/webrtc/rtc_base/ip_address.h"
using NetworkList = rtc::NetworkManager::NetworkList;
......
......@@ -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/p2p/ipc_network_manager.h"
#include "third_party/blink/renderer/platform/p2p/ipc_network_manager.h"
#include <string>
#include <utility>
......
......@@ -2,15 +2,15 @@
// 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_P2P_IPC_NETWORK_MANAGER_H_
#define THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_P2P_IPC_NETWORK_MANAGER_H_
#ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_P2P_IPC_NETWORK_MANAGER_H_
#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_P2P_IPC_NETWORK_MANAGER_H_
#include <memory>
#include "base/memory/weak_ptr.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/p2p/network_list_manager.h"
#include "third_party/blink/renderer/platform/p2p/network_list_observer.h"
#include "third_party/blink/renderer/platform/platform_export.h"
#include "third_party/webrtc/rtc_base/mdns_responder_interface.h"
#include "third_party/webrtc/rtc_base/network.h"
......@@ -26,7 +26,7 @@ class IpcNetworkManager : public rtc::NetworkManagerBase,
public blink::NetworkListObserver {
public:
// Constructor doesn't take ownership of the |network_list_manager|.
BLINK_PLATFORM_EXPORT IpcNetworkManager(
PLATFORM_EXPORT IpcNetworkManager(
blink::NetworkListManager* network_list_manager,
std::unique_ptr<webrtc::MdnsResponderInterface> mdns_responder);
~IpcNetworkManager() override;
......@@ -45,6 +45,8 @@ class IpcNetworkManager : public rtc::NetworkManagerBase,
private:
void SendNetworksChangedSignal();
// TODO(crbug.com/787254): Consider moving NetworkListManager to Oilpan and
// avoid using a raw pointer.
blink::NetworkListManager* network_list_manager_;
std::unique_ptr<webrtc::MdnsResponderInterface> mdns_responder_;
int start_count_ = 0;
......@@ -55,4 +57,4 @@ class IpcNetworkManager : public rtc::NetworkManagerBase,
} // namespace blink
#endif // THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_P2P_IPC_NETWORK_MANAGER_H_
#endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_P2P_IPC_NETWORK_MANAGER_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/p2p/ipc_network_manager.h"
#include "third_party/blink/renderer/platform/p2p/ipc_network_manager.h"
#include <algorithm>
#include <memory>
......@@ -11,7 +11,7 @@
#include "net/base/network_change_notifier.h"
#include "net/base/network_interfaces.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/platform/modules/p2p/network_list_manager.h"
#include "third_party/blink/renderer/platform/p2p/network_list_manager.h"
#include "third_party/webrtc/rtc_base/mdns_responder_interface.h"
namespace blink {
......
......@@ -6,18 +6,18 @@
// IpcNetworkManager such that it doesn't depend on implementation of
// P2PSocketDispatcher.
#ifndef THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_P2P_NETWORK_LIST_MANAGER_H_
#define THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_P2P_NETWORK_LIST_MANAGER_H_
#ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_P2P_NETWORK_LIST_MANAGER_H_
#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_P2P_NETWORK_LIST_MANAGER_H_
#include "third_party/blink/public/platform/web_common.h"
#include "third_party/blink/renderer/platform/platform_export.h"
namespace blink {
class NetworkListObserver;
// TODO(crbug.com/787254): Move this class out of the Blink exposed API when
// all users of it have been Onion souped.
class BLINK_PLATFORM_EXPORT NetworkListManager {
// TODO(crbug.com/787254): Verify whether this abstract class is still
// needed now that its Clients have all switched to Blink.
class PLATFORM_EXPORT NetworkListManager {
public:
// Add a new network list observer. Each observer is called
// immidiately after it is registered and then later whenever
......@@ -39,4 +39,4 @@ class BLINK_PLATFORM_EXPORT NetworkListManager {
} // namespace blink
#endif // THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_P2P_NETWORK_LIST_MANAGER_H_
#endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_P2P_NETWORK_LIST_MANAGER_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_P2P_NETWORK_LIST_OBSERVER_H_
#define THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_P2P_NETWORK_LIST_OBSERVER_H_
#ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_P2P_NETWORK_LIST_OBSERVER_H_
#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_P2P_NETWORK_LIST_OBSERVER_H_
#include <vector>
......@@ -15,8 +15,10 @@ typedef std::vector<NetworkInterface> NetworkInterfaceList;
namespace blink {
// TODO(crbug.com/787254): Move this class out of the Blink exposed API when
// all users of it have been Onion souped. Also, move it away from std::vector.
// TODO(crbug.com/787254): Verify whether this abstract class is still
// needed now that its Clients have all switched to Blink.
//
// TODO(crbug.com/787254): Move this class away from std::vector.
class NetworkListObserver {
public:
virtual ~NetworkListObserver() {}
......@@ -32,4 +34,4 @@ class NetworkListObserver {
} // namespace blink
#endif // THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_P2P_NETWORK_LIST_OBSERVER_H_
#endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_P2P_NETWORK_LIST_OBSERVER_H_
......@@ -8,8 +8,8 @@
#include "base/memory/scoped_refptr.h"
#include "services/network/public/cpp/p2p_param_traits.h"
#include "third_party/blink/public/common/thread_safe_browser_interface_broker_proxy.h"
#include "third_party/blink/public/platform/modules/p2p/network_list_observer.h"
#include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/renderer/platform/p2p/network_list_observer.h"
#include "third_party/blink/renderer/platform/p2p/socket_client_impl.h"
namespace blink {
......
......@@ -35,7 +35,7 @@
#include "net/base/network_interfaces.h"
#include "services/network/public/cpp/p2p_socket_type.h"
#include "services/network/public/mojom/p2p.mojom-blink.h"
#include "third_party/blink/public/platform/modules/p2p/network_list_manager.h"
#include "third_party/blink/renderer/platform/p2p/network_list_manager.h"
#include "third_party/blink/renderer/platform/platform_export.h"
#include "third_party/blink/renderer/platform/wtf/vector.h"
......@@ -85,6 +85,8 @@ class PLATFORM_EXPORT P2PSocketDispatcher
scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_;
// TODO(crbug.com/787254): When moving NetworkListObserver to Oilpan,
// thread-safety needs to be taken into account.
scoped_refptr<base::ObserverListThreadSafe<blink::NetworkListObserver>>
network_list_observers_;
......
......@@ -3,6 +3,7 @@ include_rules = [
"-third_party/blink/renderer/platform",
# Module.
"+third_party/blink/renderer/platform/p2p",
"+third_party/blink/renderer/platform/peerconnection",
"+third_party/blink/renderer/platform/media_capabilities",
"+third_party/blink/renderer/platform/webrtc",
......
......@@ -12,8 +12,8 @@
#include "base/macros.h"
#include "base/threading/thread_checker.h"
#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/renderer/platform/p2p/network_list_manager.h"
#include "third_party/blink/renderer/platform/p2p/network_list_observer.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"
......
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