Commit 277c3408 authored by Antonio Gomes's avatar Antonio Gomes Committed by Commit Bot

Migrate MdnsResponderAdapter and SocketDispatcher away from base::Bind

... to use the corresponding WTF constructions.

BUG=787254
R=haraken@chromium.org

Change-Id: I964c991d53e1b28e93bce5f5fc9c26a0f7d29afc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1973993
Commit-Queue: Kentaro Hara <haraken@chromium.org>
Auto-Submit: Antonio Gomes <tonikitoo@igalia.com>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#726148}
parent 70642413
......@@ -6,7 +6,6 @@
#include <string>
#include "base/bind.h"
#include "jingle/glue/utils.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "net/base/ip_address.h"
......@@ -14,6 +13,7 @@
#include "services/network/public/mojom/mdns_responder.mojom-blink.h"
#include "third_party/blink/public/common/thread_safe_browser_interface_broker_proxy.h"
#include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/renderer/platform/wtf/functional.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
#include "third_party/webrtc/rtc_base/ip_address.h"
......@@ -56,14 +56,14 @@ void MdnsResponderAdapter::CreateNameForAddress(const rtc::IPAddress& addr,
NameCreatedCallback callback) {
shared_remote_client_->CreateNameForAddress(
jingle_glue::RtcIPAddressToNetIPAddress(addr),
base::BindOnce(&OnNameCreatedForAddress, callback, addr));
WTF::Bind(&OnNameCreatedForAddress, callback, addr));
}
void MdnsResponderAdapter::RemoveNameForAddress(const rtc::IPAddress& addr,
NameRemovedCallback callback) {
shared_remote_client_->RemoveNameForAddress(
jingle_glue::RtcIPAddressToNetIPAddress(addr),
base::BindOnce(&OnNameRemovedForAddress, callback));
WTF::Bind(&OnNameRemovedForAddress, callback));
}
} // namespace blink
......@@ -4,13 +4,14 @@
#include "third_party/blink/renderer/platform/p2p/socket_dispatcher.h"
#include "base/bind.h"
#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/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/scheduler/public/post_cross_thread_task.h"
#include "third_party/blink/renderer/platform/wtf/cross_thread_functional.h"
namespace blink {
......@@ -24,10 +25,10 @@ P2PSocketDispatcher::~P2PSocketDispatcher() {}
void P2PSocketDispatcher::AddNetworkListObserver(
blink::NetworkListObserver* network_list_observer) {
network_list_observers_->AddObserver(network_list_observer);
main_task_runner_->PostTask(
FROM_HERE,
base::BindOnce(&P2PSocketDispatcher::RequestNetworkEventsIfNecessary,
this));
PostCrossThreadTask(
*main_task_runner_.get(), FROM_HERE,
CrossThreadBindOnce(&P2PSocketDispatcher::RequestNetworkEventsIfNecessary,
scoped_refptr<P2PSocketDispatcher>(this)));
}
void P2PSocketDispatcher::RemoveNetworkListObserver(
......@@ -47,13 +48,14 @@ P2PSocketDispatcher::GetP2PSocketManager() {
mojo::SharedRemote<network::mojom::blink::P2PSocketManager>(
std::move(p2p_socket_manager));
p2p_socket_manager_.set_disconnect_handler(
base::BindOnce(&P2PSocketDispatcher::OnConnectionError,
base::Unretained(this)),
WTF::Bind(&P2PSocketDispatcher::OnConnectionError,
WTF::Unretained(this)),
main_task_runner_);
}
main_task_runner_->PostTask(
FROM_HERE,
base::BindOnce(&P2PSocketDispatcher::RequestInterfaceIfNecessary, this));
PostCrossThreadTask(
*main_task_runner_.get(), FROM_HERE,
CrossThreadBindOnce(&P2PSocketDispatcher::RequestInterfaceIfNecessary,
scoped_refptr<P2PSocketDispatcher>(this)));
return p2p_socket_manager_.get();
}
......
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