Commit 883389e7 authored by Sylvain Defresne's avatar Sylvain Defresne Committed by Commit Bot

Convert services/resource_coordinator away from base::Bind/base::Callback

base::Bind/base::Callback are deprecated in favor of either
base::BindOnce/base::OnceCallback or base::BindRepeating/
base::RepeatingCallback (depending on whether the callback
is invoked once or multiple time).

Convert all uses of base::Bind/base::Callback in
services/resource_coordinator to the recommended methods/types.

Bug: 1007831
Change-Id: I85e6a627d8b65feffb9a0d95a0c9620e343f9062
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1840635
Auto-Submit: Sylvain Defresne <sdefresne@chromium.org>
Reviewed-by: default avatarPrimiano Tucci <primiano@chromium.org>
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#703267}
parent 55fda024
......@@ -372,11 +372,11 @@ void CoordinatorImpl::PerformNextQueuedGlobalMemoryDump() {
}
auto chrome_callback =
base::Bind(&CoordinatorImpl::OnChromeMemoryDumpResponse,
weak_ptr_factory_.GetWeakPtr());
base::BindRepeating(&CoordinatorImpl::OnChromeMemoryDumpResponse,
weak_ptr_factory_.GetWeakPtr());
auto os_callback =
base::Bind(&CoordinatorImpl::OnOSMemoryDumpResponse,
weak_ptr_factory_.GetWeakPtr(), request->dump_guid);
base::BindRepeating(&CoordinatorImpl::OnOSMemoryDumpResponse,
weak_ptr_factory_.GetWeakPtr(), request->dump_guid);
QueuedRequestDispatcher::SetUpAndDispatch(request, clients, chrome_callback,
os_callback);
......
......@@ -238,7 +238,7 @@ void QueuedRequestDispatcher::SetUpAndDispatch(
{client_info.pid, ResponseType::kChromeDump});
client->RequestChromeMemoryDump(
request->GetRequestArgs(),
base::BindOnce(std::move(chrome_callback), client_info.pid));
base::BindOnce(chrome_callback, client_info.pid));
}
// On most platforms each process can dump data about their own process
......
......@@ -76,8 +76,8 @@ void ClientProcessImpl::RequestChromeMemoryDump(
pending_chrome_callbacks_.emplace(args.dump_guid, std::move(callback));
DCHECK(it_and_inserted.second) << "Duplicated request id " << args.dump_guid;
base::trace_event::MemoryDumpManager::GetInstance()->CreateProcessDump(
args, base::Bind(&ClientProcessImpl::OnChromeMemoryDumpDone,
base::Unretained(this)));
args, base::BindOnce(&ClientProcessImpl::OnChromeMemoryDumpDone,
base::Unretained(this)));
}
void ClientProcessImpl::OnChromeMemoryDumpDone(
......
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