Commit d49c7428 authored by Mark Pilgrim's avatar Mark Pilgrim Committed by Commit Bot

Bluetooth: BindOnce refactoring

BUG=714018

TBR=nick@chromium.org

Change-Id: Ic30f482175460a71c0a5cd78796bf9296ebc13c7
Reviewed-on: https://chromium-review.googlesource.com/963084
Commit-Queue: Mark Pilgrim <pilgrim@chromium.org>
Reviewed-by: default avatarConley Owens <cco3@chromium.org>
Reviewed-by: default avatarGiovanni Ortuño Urquidi <ortuno@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543760}
parent a50107b0
......@@ -178,8 +178,8 @@ WebBluetoothServiceImpl::~WebBluetoothServiceImpl() {
}
void WebBluetoothServiceImpl::SetClientConnectionErrorHandler(
base::Closure closure) {
binding_.set_connection_error_handler(closure);
base::OnceClosure closure) {
binding_.set_connection_error_handler(std::move(closure));
}
bool WebBluetoothServiceImpl::IsDevicePaired(
......
......@@ -60,7 +60,7 @@ class CONTENT_EXPORT WebBluetoothServiceImpl
void CrashRendererAndClosePipe(bad_message::BadMessageReason reason);
// Sets the connection error handler for WebBluetoothServiceImpl's Binding.
void SetClientConnectionErrorHandler(base::Closure closure);
void SetClientConnectionErrorHandler(base::OnceClosure closure);
// Returns whether the device is paired with the |render_frame_host_|'s
// GetLastCommittedOrigin().
......
......@@ -4285,8 +4285,8 @@ WebBluetoothServiceImpl* RenderFrameHostImpl::CreateWebBluetoothService(
auto web_bluetooth_service =
std::make_unique<WebBluetoothServiceImpl>(this, std::move(request));
web_bluetooth_service->SetClientConnectionErrorHandler(
base::Bind(&RenderFrameHostImpl::DeleteWebBluetoothService,
base::Unretained(this), web_bluetooth_service.get()));
base::BindOnce(&RenderFrameHostImpl::DeleteWebBluetoothService,
base::Unretained(this), web_bluetooth_service.get()));
web_bluetooth_services_.push_back(std::move(web_bluetooth_service));
return web_bluetooth_services_.back().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