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,10 +372,10 @@ void CoordinatorImpl::PerformNextQueuedGlobalMemoryDump() { ...@@ -372,10 +372,10 @@ void CoordinatorImpl::PerformNextQueuedGlobalMemoryDump() {
} }
auto chrome_callback = auto chrome_callback =
base::Bind(&CoordinatorImpl::OnChromeMemoryDumpResponse, base::BindRepeating(&CoordinatorImpl::OnChromeMemoryDumpResponse,
weak_ptr_factory_.GetWeakPtr()); weak_ptr_factory_.GetWeakPtr());
auto os_callback = auto os_callback =
base::Bind(&CoordinatorImpl::OnOSMemoryDumpResponse, base::BindRepeating(&CoordinatorImpl::OnOSMemoryDumpResponse,
weak_ptr_factory_.GetWeakPtr(), request->dump_guid); weak_ptr_factory_.GetWeakPtr(), request->dump_guid);
QueuedRequestDispatcher::SetUpAndDispatch(request, clients, chrome_callback, QueuedRequestDispatcher::SetUpAndDispatch(request, clients, chrome_callback,
os_callback); os_callback);
......
...@@ -238,7 +238,7 @@ void QueuedRequestDispatcher::SetUpAndDispatch( ...@@ -238,7 +238,7 @@ void QueuedRequestDispatcher::SetUpAndDispatch(
{client_info.pid, ResponseType::kChromeDump}); {client_info.pid, ResponseType::kChromeDump});
client->RequestChromeMemoryDump( client->RequestChromeMemoryDump(
request->GetRequestArgs(), 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 // On most platforms each process can dump data about their own process
......
...@@ -76,7 +76,7 @@ void ClientProcessImpl::RequestChromeMemoryDump( ...@@ -76,7 +76,7 @@ void ClientProcessImpl::RequestChromeMemoryDump(
pending_chrome_callbacks_.emplace(args.dump_guid, std::move(callback)); pending_chrome_callbacks_.emplace(args.dump_guid, std::move(callback));
DCHECK(it_and_inserted.second) << "Duplicated request id " << args.dump_guid; DCHECK(it_and_inserted.second) << "Duplicated request id " << args.dump_guid;
base::trace_event::MemoryDumpManager::GetInstance()->CreateProcessDump( base::trace_event::MemoryDumpManager::GetInstance()->CreateProcessDump(
args, base::Bind(&ClientProcessImpl::OnChromeMemoryDumpDone, args, base::BindOnce(&ClientProcessImpl::OnChromeMemoryDumpDone,
base::Unretained(this))); base::Unretained(this)));
} }
......
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