Commit c988f0be authored by danakj's avatar danakj Committed by Commit Bot

Make AuthCallback explicitly RepeatingCallback, use BindRepeating.

The use of Bind() is deprecated, replace with BindRepeating because
this callback is called more than once, and make the type explicit
as well in the receiver.

This was discussed in "Should AuthCallback be a OnceCallback?" on
blink-network-dev@chromium.org.

R=mmenke@chromium.org

Bug: 953861
Change-Id: Iaa4a155e767da077688a4a107d2f0d7bf37d6a15
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1615835Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Reviewed-by: default avatarMatt Menke <mmenke@chromium.org>
Commit-Queue: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#661007}
parent f9eabccd
...@@ -64,8 +64,9 @@ class UnixDomainServerSocketFactory : public content::DevToolsSocketFactory { ...@@ -64,8 +64,9 @@ class UnixDomainServerSocketFactory : public content::DevToolsSocketFactory {
// content::DevToolsSocketFactory. // content::DevToolsSocketFactory.
std::unique_ptr<net::ServerSocket> CreateForHttpServer() override { std::unique_ptr<net::ServerSocket> CreateForHttpServer() override {
std::unique_ptr<net::UnixDomainServerSocket> socket( std::unique_ptr<net::UnixDomainServerSocket> socket(
new net::UnixDomainServerSocket(base::Bind(&CanUserConnectToDevTools), new net::UnixDomainServerSocket(
true /* use_abstract_namespace */)); base::BindRepeating(&CanUserConnectToDevTools),
true /* use_abstract_namespace */));
if (socket->BindAndListen(socket_name_, kBackLog) != net::OK) if (socket->BindAndListen(socket_name_, kBackLog) != net::OK)
return std::unique_ptr<net::ServerSocket>(); return std::unique_ptr<net::ServerSocket>();
......
...@@ -42,7 +42,7 @@ class NET_EXPORT UnixDomainServerSocket : public ServerSocket { ...@@ -42,7 +42,7 @@ class NET_EXPORT UnixDomainServerSocket : public ServerSocket {
// Callback that returns whether the already connected client, identified by // Callback that returns whether the already connected client, identified by
// its credentials, is allowed to keep the connection open. Note that // its credentials, is allowed to keep the connection open. Note that
// the socket is closed immediately in case the callback returns false. // the socket is closed immediately in case the callback returns false.
typedef base::Callback<bool (const Credentials&)> AuthCallback; using AuthCallback = base::RepeatingCallback<bool(const Credentials&)>;
UnixDomainServerSocket(const AuthCallback& auth_callack, UnixDomainServerSocket(const AuthCallback& auth_callack,
bool use_abstract_namespace); bool use_abstract_namespace);
......
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