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