summaryrefslogtreecommitdiff
path: root/chromium/device/bluetooth/discovery_session.cc
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2017-04-05 14:08:31 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2017-04-11 07:46:53 +0000
commit6a4cabb866f66d4128a97cdc6d9d08ce074f1247 (patch)
treeab00f70a5e89278d6a0d16ff0c42578dc4d84a2d /chromium/device/bluetooth/discovery_session.cc
parente733310db58160074f574c429d48f8308c0afe17 (diff)
downloadqtwebengine-chromium-6a4cabb866f66d4128a97cdc6d9d08ce074f1247.tar.gz
BASELINE: Update Chromium to 57.0.2987.144
Change-Id: I29db402ff696c71a04c4dbaec822c2e53efe0267 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
Diffstat (limited to 'chromium/device/bluetooth/discovery_session.cc')
-rw-r--r--chromium/device/bluetooth/discovery_session.cc35
1 files changed, 35 insertions, 0 deletions
diff --git a/chromium/device/bluetooth/discovery_session.cc b/chromium/device/bluetooth/discovery_session.cc
new file mode 100644
index 00000000000..0ecc1cf056e
--- /dev/null
+++ b/chromium/device/bluetooth/discovery_session.cc
@@ -0,0 +1,35 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/bind_helpers.h"
+#include "device/bluetooth/discovery_session.h"
+
+namespace bluetooth {
+DiscoverySession::DiscoverySession(
+ std::unique_ptr<device::BluetoothDiscoverySession> session)
+ : discovery_session_(std::move(session)), weak_ptr_factory_(this) {}
+
+DiscoverySession::~DiscoverySession() {}
+
+void DiscoverySession::IsActive(const IsActiveCallback& callback) {
+ callback.Run(discovery_session_->IsActive());
+}
+
+void DiscoverySession::Stop(const StopCallback& callback) {
+ discovery_session_->Stop(
+ base::Bind(&DiscoverySession::OnStop, weak_ptr_factory_.GetWeakPtr(),
+ callback),
+ base::Bind(&DiscoverySession::OnStopError, weak_ptr_factory_.GetWeakPtr(),
+ callback));
+}
+
+void DiscoverySession::OnStop(const StopCallback& callback) {
+ callback.Run(true /* success */);
+}
+
+void DiscoverySession::OnStopError(const StopCallback& callback) {
+ callback.Run(false /* success */);
+}
+
+} // namespace bluetooth