Use CompletionOnceCallback in //net/proxy_resolution.
Change most of arguments of type CompletionCallback by constant reference to
CompletionOnceCallback by value, and change most const or non-const
CompletionCallback type members to non-const CompletionOnceCallback in
//net/proxy_resolution, and in some other places as necessary. This is part of
//the larger transition effort described on the bug.
In addition to changing type, also:
* avoid move to local variable when unnecessary;
* remove unused MockAsyncProxyResolver::callback() method;
* inline ProxyResolutionService::InitProxyResolver::DoCallback() and
PacFileDecider::DoCallback(), both only called once;
* include completion_callback.h in //chromeos where
CompletionCallback is used but was only transitively included.
Bug: 807724
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_mojo
Change-Id: Ib9e08f54988abb6655f2efd68fc6169ff12e9b20
Reviewed-on: https://chromium-review.googlesource.com/1066291
Reviewed-by: Steven Bennetts <[email protected]>
Reviewed-by: Eric Roman <[email protected]>
Reviewed-by: Scott Graham <[email protected]>
Commit-Queue: Bence Béky <[email protected]>
Cr-Commit-Position: refs/heads/master@{#561992}
diff --git a/net/proxy_resolution/multi_threaded_proxy_resolver.h b/net/proxy_resolution/multi_threaded_proxy_resolver.h
index 8daa17ef..afaa419 100644
--- a/net/proxy_resolution/multi_threaded_proxy_resolver.h
+++ b/net/proxy_resolution/multi_threaded_proxy_resolver.h
@@ -11,6 +11,7 @@
#include <set>
#include "base/memory/ref_counted.h"
+#include "net/base/completion_once_callback.h"
#include "net/base/net_export.h"
#include "net/proxy_resolution/proxy_resolver_factory.h"
@@ -57,7 +58,7 @@
int CreateProxyResolver(const scoped_refptr<PacFileData>& pac_script,
std::unique_ptr<ProxyResolver>* resolver,
- const CompletionCallback& callback,
+ CompletionOnceCallback callback,
std::unique_ptr<Request>* request) override;
private: