Convert ErrorCallback to a OnceCallback in BluetoothGattCharacteristic

This will allow us to convert more Callbacks in the bluetooth component
over to OnceCallbacks, which will let us convert Callbacks in content
eventually.

R=avi@chromium.org, hansberry@chromium.org, kpaulhamus@chromium.org, reillyg@chromium.org
TBR=avi

Bug: 953861
Change-Id: I2216e4003d7fe569f69e97c5b471baf49228950d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1584700
Commit-Queue: danakj <danakj@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Ryan Hansberry <hansberry@chromium.org>
Reviewed-by: Kim Paulhamus <kpaulhamus@chromium.org>
Cr-Commit-Position: refs/heads/master@{#654232}
diff --git a/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_apitest.cc b/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_apitest.cc
index 9bb6e9f..c5b7c830 100644
--- a/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_apitest.cc
+++ b/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_apitest.cc
@@ -658,16 +658,14 @@
       new testing::NiceMock<MockBluetoothGattNotifySession>(
           chrc2_->GetWeakPtr());
 
-  EXPECT_CALL(*chrc0_, StartNotifySession(_, _))
+  EXPECT_CALL(*chrc0_, StartNotifySession_(_, _))
       .Times(1)
-      .WillOnce(
-          InvokeCallbackWithScopedPtrArg<0, BluetoothGattNotifySession>(
-              session0));
-  EXPECT_CALL(*chrc2_, StartNotifySession(_, _))
+      .WillOnce(InvokeCallbackWithScopedPtrArg<0, BluetoothGattNotifySession>(
+          session0));
+  EXPECT_CALL(*chrc2_, StartNotifySession_(_, _))
       .Times(1)
-      .WillOnce(
-          InvokeCallbackWithScopedPtrArg<0, BluetoothGattNotifySession>(
-              session1));
+      .WillOnce(InvokeCallbackWithScopedPtrArg<0, BluetoothGattNotifySession>(
+          session1));
 
   ExtensionTestMessageListener listener("ready", true);
   ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII(
@@ -1279,17 +1277,16 @@
       .Times(1)
       .WillOnce(InvokeCallbackArgument<0>());
 
-  EXPECT_CALL(*chrc0_, StartNotifySession(_, _))
+  EXPECT_CALL(*chrc0_, StartNotifySession_(_, _))
       .Times(2)
       .WillOnce(InvokeCallbackArgument<1>(
           BluetoothRemoteGattService::GATT_ERROR_FAILED))
       .WillOnce(InvokeCallbackWithScopedPtrArg<0, BluetoothGattNotifySession>(
           session0));
-  EXPECT_CALL(*chrc1_, StartNotifySession(_, _))
+  EXPECT_CALL(*chrc1_, StartNotifySession_(_, _))
       .Times(1)
-      .WillOnce(
-          InvokeCallbackWithScopedPtrArg<0, BluetoothGattNotifySession>(
-              session1));
+      .WillOnce(InvokeCallbackWithScopedPtrArg<0, BluetoothGattNotifySession>(
+          session1));
 
   ExtensionTestMessageListener listener("ready", true);
   listener.set_failure_message("fail");
diff --git a/chromeos/services/secure_channel/ble_weave_client_connection_unittest.cc b/chromeos/services/secure_channel/ble_weave_client_connection_unittest.cc
index ca2aed8..018a88e 100644
--- a/chromeos/services/secure_channel/ble_weave_client_connection_unittest.cc
+++ b/chromeos/services/secure_channel/ble_weave_client_connection_unittest.cc
@@ -469,9 +469,9 @@
   // WAITING_NOTIFY_SESSION state.
   void CharacteristicsFound(
       TestBluetoothLowEnergyWeaveClientConnection* connection) {
-    EXPECT_CALL(*rx_characteristic_, StartNotifySession(_, _))
+    EXPECT_CALL(*rx_characteristic_, StartNotifySession_(_, _))
         .WillOnce(DoAll(SaveArg<0>(&notify_session_success_callback_),
-                        SaveArg<1>(&notify_session_error_callback_)));
+                        MoveArg<1>(&notify_session_error_callback_)));
     EXPECT_FALSE(characteristics_finder_error_callback_.is_null());
     ASSERT_FALSE(characteristics_finder_success_callback_.is_null());
 
@@ -492,7 +492,7 @@
         .WillOnce(
             DoAll(SaveArg<0>(&last_value_written_on_tx_characteristic_),
                   MoveArg<1>(&write_remote_characteristic_success_callback_),
-                  SaveArg<2>(&write_remote_characteristic_error_callback_)));
+                  MoveArg<2>(&write_remote_characteristic_error_callback_)));
     EXPECT_FALSE(notify_session_error_callback_.is_null());
     ASSERT_FALSE(notify_session_success_callback_.is_null());
 
@@ -552,7 +552,7 @@
           .WillOnce(
               DoAll(SaveArg<0>(&last_value_written_on_tx_characteristic_),
                     MoveArg<1>(&write_remote_characteristic_success_callback_),
-                    SaveArg<2>(&write_remote_characteristic_error_callback_)));
+                    MoveArg<2>(&write_remote_characteristic_error_callback_)));
     }
 
     connection->Disconnect();
@@ -576,7 +576,7 @@
           .WillOnce(
               DoAll(SaveArg<0>(&last_value_written_on_tx_characteristic_),
                     MoveArg<1>(&write_remote_characteristic_success_callback_),
-                    SaveArg<2>(&write_remote_characteristic_error_callback_)));
+                    MoveArg<2>(&write_remote_characteristic_error_callback_)));
     }
 
     connection->reset();
@@ -792,7 +792,7 @@
       .WillOnce(
           DoAll(SaveArg<0>(&last_value_written_on_tx_characteristic_),
                 MoveArg<1>(&write_remote_characteristic_success_callback_),
-                SaveArg<2>(&write_remote_characteristic_error_callback_)));
+                MoveArg<2>(&write_remote_characteristic_error_callback_)));
 
   // Call Disconnect() twice; this should only result in one "close connection"
   // message (verified via WillOnce() above).
@@ -868,7 +868,7 @@
       CreateConnection(true /* should_set_low_connection_latency */));
   ConnectGatt(connection.get());
 
-  EXPECT_CALL(*rx_characteristic_, StartNotifySession(_, _)).Times(0);
+  EXPECT_CALL(*rx_characteristic_, StartNotifySession_(_, _)).Times(0);
   EXPECT_FALSE(characteristics_finder_success_callback_.is_null());
   ASSERT_FALSE(characteristics_finder_error_callback_.is_null());
 
@@ -922,8 +922,8 @@
   EXPECT_FALSE(notify_session_success_callback_.is_null());
   ASSERT_FALSE(notify_session_error_callback_.is_null());
 
-  notify_session_error_callback_.Run(
-      device::BluetoothRemoteGattService::GATT_ERROR_UNKNOWN);
+  std::move(notify_session_error_callback_)
+      .Run(device::BluetoothRemoteGattService::GATT_ERROR_UNKNOWN);
 
   VerifyGattNotifySessionResult(false);
 
@@ -953,7 +953,7 @@
       .WillRepeatedly(
           DoAll(SaveArg<0>(&last_value_written_on_tx_characteristic_),
                 MoveArg<1>(&write_remote_characteristic_success_callback_),
-                SaveArg<2>(&write_remote_characteristic_error_callback_)));
+                MoveArg<2>(&write_remote_characteristic_error_callback_)));
 
   for (int i = 0; i < kMaxNumberOfTries; i++) {
     EXPECT_EQ(last_value_written_on_tx_characteristic_, kConnectionRequest);
@@ -1032,7 +1032,7 @@
       .WillOnce(
           DoAll(SaveArg<0>(&last_value_written_on_tx_characteristic_),
                 MoveArg<1>(&write_remote_characteristic_success_callback_),
-                SaveArg<2>(&write_remote_characteristic_error_callback_)));
+                MoveArg<2>(&write_remote_characteristic_error_callback_)));
 
   connection->SendMessage(
       std::make_unique<FakeWireMessage>(kSmallMessage, kTestFeature));
@@ -1065,7 +1065,7 @@
       .WillOnce(
           DoAll(SaveArg<0>(&last_value_written_on_tx_characteristic_),
                 MoveArg<1>(&write_remote_characteristic_success_callback_),
-                SaveArg<2>(&write_remote_characteristic_error_callback_)));
+                MoveArg<2>(&write_remote_characteristic_error_callback_)));
 
   connection->SendMessage(
       std::make_unique<FakeWireMessage>(kLargeMessage, kTestFeature));
@@ -1079,7 +1079,7 @@
       .WillOnce(
           DoAll(SaveArg<0>(&last_value_written_on_tx_characteristic_),
                 MoveArg<1>(&write_remote_characteristic_success_callback_),
-                SaveArg<2>(&write_remote_characteristic_error_callback_)));
+                MoveArg<2>(&write_remote_characteristic_error_callback_)));
 
   RunWriteCharacteristicSuccessCallback();
   VerifyGattWriteCharacteristicResult(true /* success */, 2 /* num_writes */);
@@ -1116,7 +1116,7 @@
       .WillRepeatedly(
           DoAll(SaveArg<0>(&last_value_written_on_tx_characteristic_),
                 MoveArg<1>(&write_remote_characteristic_success_callback_),
-                SaveArg<2>(&write_remote_characteristic_error_callback_)));
+                MoveArg<2>(&write_remote_characteristic_error_callback_)));
 
   connection->SendMessage(
       std::make_unique<FakeWireMessage>(kSmallMessage, kTestFeature));
@@ -1177,7 +1177,7 @@
       .WillOnce(
           DoAll(SaveArg<0>(&last_value_written_on_tx_characteristic_),
                 MoveArg<1>(&write_remote_characteristic_success_callback_),
-                SaveArg<2>(&write_remote_characteristic_error_callback_)));
+                MoveArg<2>(&write_remote_characteristic_error_callback_)));
 
   connection->GattCharacteristicValueChanged(
       adapter_.get(), rx_characteristic_.get(), kErroneousPacket);
@@ -1207,7 +1207,7 @@
       .WillOnce(
           DoAll(SaveArg<0>(&last_value_written_on_tx_characteristic_),
                 MoveArg<1>(&write_remote_characteristic_success_callback_),
-                SaveArg<2>(&write_remote_characteristic_error_callback_)));
+                MoveArg<2>(&write_remote_characteristic_error_callback_)));
 
   connection->SendMessage(
       std::make_unique<FakeWireMessage>(kLargeMessage, kTestFeature));
@@ -1221,7 +1221,7 @@
       .WillOnce(
           DoAll(SaveArg<0>(&last_value_written_on_tx_characteristic_),
                 MoveArg<1>(&write_remote_characteristic_success_callback_),
-                SaveArg<2>(&write_remote_characteristic_error_callback_)));
+                MoveArg<2>(&write_remote_characteristic_error_callback_)));
 
   RunWriteCharacteristicSuccessCallback();
   VerifyGattWriteCharacteristicResult(true /* success */, 2 /* num_writes */);
@@ -1253,7 +1253,7 @@
       .WillOnce(
           DoAll(SaveArg<0>(&last_value_written_on_tx_characteristic_),
                 MoveArg<1>(&write_remote_characteristic_success_callback_),
-                SaveArg<2>(&write_remote_characteristic_error_callback_)));
+                MoveArg<2>(&write_remote_characteristic_error_callback_)));
 
   connection->GattCharacteristicValueChanged(
       adapter_.get(), rx_characteristic_.get(), kErroneousPacket);
@@ -1287,7 +1287,7 @@
       .WillRepeatedly(
           DoAll(SaveArg<0>(&last_value_written_on_tx_characteristic_),
                 MoveArg<1>(&write_remote_characteristic_success_callback_),
-                SaveArg<2>(&write_remote_characteristic_error_callback_)));
+                MoveArg<2>(&write_remote_characteristic_error_callback_)));
 
   connection->SendMessage(
       std::make_unique<FakeWireMessage>(kSmallMessage, kTestFeature));
@@ -1323,7 +1323,7 @@
       .WillOnce(
           DoAll(SaveArg<0>(&last_value_written_on_tx_characteristic_),
                 MoveArg<1>(&write_remote_characteristic_success_callback_),
-                SaveArg<2>(&write_remote_characteristic_error_callback_)));
+                MoveArg<2>(&write_remote_characteristic_error_callback_)));
   connection->Disconnect();
   EXPECT_EQ(connection->sub_status(), SubStatus::CONNECTED_AND_SENDING_MESSAGE);
 
@@ -1338,7 +1338,7 @@
           .WillOnce(
               DoAll(SaveArg<0>(&last_value_written_on_tx_characteristic_),
                     MoveArg<1>(&write_remote_characteristic_success_callback_),
-                    SaveArg<2>(&write_remote_characteristic_error_callback_)));
+                    MoveArg<2>(&write_remote_characteristic_error_callback_)));
     }
 
     std::move(write_remote_characteristic_error_callback_)
diff --git a/content/shell/browser/web_test/web_test_bluetooth_adapter_provider.cc b/content/shell/browser/web_test/web_test_bluetooth_adapter_provider.cc
index 742b69c..47cb964 100644
--- a/content/shell/browser/web_test/web_test_bluetooth_adapter_provider.cc
+++ b/content/shell/browser/web_test/web_test_bluetooth_adapter_provider.cc
@@ -659,7 +659,7 @@
   ON_CALL(*measurement_interval, WriteRemoteCharacteristic_(_, _, _))
       .WillByDefault(RunCallback<1 /* success_callback */>());
 
-  ON_CALL(*measurement_interval, StartNotifySession(_, _))
+  ON_CALL(*measurement_interval, StartNotifySession_(_, _))
       .WillByDefault(
           RunCallbackWithResult<0 /* success_callback */>([measurement_ptr]() {
             return GetBaseGATTNotifySession(measurement_ptr->GetWeakPtr());
@@ -961,7 +961,7 @@
       .WillByDefault(
           Invoke([adapter_ptr, device_ptr, disconnect, succeeds](
                      BluetoothRemoteGattCharacteristic::ValueCallback& callback,
-                     const BluetoothRemoteGattCharacteristic::ErrorCallback&
+                     BluetoothRemoteGattCharacteristic::ErrorCallback&
                          error_callback) {
             base::OnceClosure pending;
             if (succeeds) {
@@ -969,8 +969,8 @@
                                        std::vector<uint8_t>({1}));
             } else {
               pending =
-                  base::Bind(error_callback,
-                             BluetoothRemoteGattService::GATT_ERROR_FAILED);
+                  base::BindOnce(std::move(error_callback),
+                                 BluetoothRemoteGattService::GATT_ERROR_FAILED);
             }
             device_ptr->PushPendingCallback(std::move(pending));
             if (disconnect) {
@@ -986,15 +986,15 @@
       .WillByDefault(Invoke(
           [adapter_ptr, device_ptr, disconnect, succeeds](
               const std::vector<uint8_t>& value, base::OnceClosure& callback,
-              const BluetoothRemoteGattCharacteristic::ErrorCallback&
+              BluetoothRemoteGattCharacteristic::ErrorCallback&
                   error_callback) {
             base::OnceClosure pending;
             if (succeeds) {
               pending = std::move(callback);
             } else {
               pending =
-                  base::Bind(error_callback,
-                             BluetoothRemoteGattService::GATT_ERROR_FAILED);
+                  base::BindOnce(std::move(error_callback),
+                                 BluetoothRemoteGattService::GATT_ERROR_FAILED);
             }
             device_ptr->PushPendingCallback(std::move(pending));
             if (disconnect) {
@@ -1006,22 +1006,22 @@
             }
           }));
 
-  ON_CALL(*measurement_interval, StartNotifySession(_, _))
+  ON_CALL(*measurement_interval, StartNotifySession_(_, _))
       .WillByDefault(Invoke(
           [adapter_ptr, device_ptr, measurement_ptr, disconnect, succeeds](
               const BluetoothRemoteGattCharacteristic::NotifySessionCallback&
                   callback,
-              const BluetoothRemoteGattCharacteristic::ErrorCallback&
+              BluetoothRemoteGattCharacteristic::ErrorCallback&
                   error_callback) {
-            base::Closure pending;
+            base::OnceClosure pending;
             if (succeeds) {
               pending =
                   base::Bind(callback, base::Passed(GetBaseGATTNotifySession(
                                            measurement_ptr->GetWeakPtr())));
             } else {
               pending =
-                  base::Bind(error_callback,
-                             BluetoothRemoteGattService::GATT_ERROR_FAILED);
+                  base::BindOnce(std::move(error_callback),
+                                 BluetoothRemoteGattService::GATT_ERROR_FAILED);
             }
             device_ptr->PushPendingCallback(std::move(pending));
             if (disconnect) {
@@ -1129,7 +1129,7 @@
   NiceMockBluetoothGattCharacteristic* measurement_ptr =
       measurement_interval.get();
 
-  ON_CALL(*measurement_interval, StartNotifySession(_, _))
+  ON_CALL(*measurement_interval, StartNotifySession_(_, _))
       .WillByDefault(RunCallbackWithResult<0 /* success_callback */>(
           [adapter_ptr, device_ptr, measurement_ptr, disconnect]() {
             std::unique_ptr<NiceMockBluetoothGattNotifySession> notify_session =
@@ -1396,7 +1396,7 @@
           ReadRemoteCharacteristic_(_, _))
       .WillByDefault(
           Invoke([](BluetoothRemoteGattCharacteristic::ValueCallback&,
-                    const BluetoothRemoteGattCharacteristic::ErrorCallback&) {
+                    BluetoothRemoteGattCharacteristic::ErrorCallback&) {
             NOTREACHED();
           }));
 
@@ -1428,7 +1428,7 @@
   ON_CALL(*serial_number_string, ReadRemoteCharacteristic_(_, _))
       .WillByDefault(
           Invoke([](BluetoothRemoteGattCharacteristic::ValueCallback&,
-                    const BluetoothRemoteGattCharacteristic::ErrorCallback&) {
+                    BluetoothRemoteGattCharacteristic::ErrorCallback&) {
             NOTREACHED();
           }));
 
@@ -1485,7 +1485,7 @@
     ON_CALL(*peripheral_privacy_flag, WriteRemoteCharacteristic_(_, _, _))
         .WillByDefault(
             Invoke([](const std::vector<uint8_t>&, base::OnceClosure&,
-                      const BluetoothRemoteGattCharacteristic::ErrorCallback&) {
+                      BluetoothRemoteGattCharacteristic::ErrorCallback&) {
               NOTREACHED();
             }));
 
@@ -1510,7 +1510,7 @@
   NiceMockBluetoothGattCharacteristic* measurement_ptr =
       heart_rate_measurement.get();
 
-  ON_CALL(*heart_rate_measurement, StartNotifySession(_, _))
+  ON_CALL(*heart_rate_measurement, StartNotifySession_(_, _))
       .WillByDefault(RunCallbackWithResult<0 /* success_callback */>(
           [adapter, measurement_ptr]() {
             auto notify_session(
@@ -1571,7 +1571,7 @@
       .WillByDefault(Invoke(
           [adapter, device](
               const std::vector<uint8_t>& value, base::OnceClosure& success,
-              const BluetoothRemoteGattCharacteristic::ErrorCallback& error) {
+              BluetoothRemoteGattCharacteristic::ErrorCallback& error) {
             device->SetConnected(false);
             for (auto& observer : adapter->GetObservers())
               observer.DeviceChanged(adapter, device);
@@ -1604,7 +1604,7 @@
       .WillByDefault(
           RunCallback<2>(BluetoothRemoteGattService::GATT_ERROR_NOT_SUPPORTED));
 
-  ON_CALL(*characteristic, StartNotifySession(_, _))
+  ON_CALL(*characteristic, StartNotifySession_(_, _))
       .WillByDefault(
           RunCallback<1>(BluetoothRemoteGattService::GATT_ERROR_NOT_SUPPORTED));
 
@@ -1634,7 +1634,7 @@
       .WillByDefault(RunCallback<2 /* error_callback */>(error_code));
 
   // StartNotifySession response
-  ON_CALL(*characteristic, StartNotifySession(_, _))
+  ON_CALL(*characteristic, StartNotifySession_(_, _))
       .WillByDefault(RunCallback<1 /* error_callback */>(error_code));
 
   // Add error descriptor to |characteristic|
diff --git a/device/bluetooth/bluetooth_gatt_characteristic.h b/device/bluetooth/bluetooth_gatt_characteristic.h
index 2c37124..89030bf 100644
--- a/device/bluetooth/bluetooth_gatt_characteristic.h
+++ b/device/bluetooth/bluetooth_gatt_characteristic.h
@@ -83,8 +83,8 @@
   enum class NotificationType { kNotification = 1, kIndication };
 
   // The ErrorCallback is used by methods to asynchronously report errors.
-  typedef base::Callback<void(BluetoothGattService::GattErrorCode)>
-      ErrorCallback;
+  using ErrorCallback =
+      base::OnceCallback<void(BluetoothGattService::GattErrorCode)>;
 
   // Identifier used to uniquely identify a GATT characteristic object. This is
   // different from the characteristic UUID: while multiple characteristics with
diff --git a/device/bluetooth/bluetooth_remote_gatt_characteristic.cc b/device/bluetooth/bluetooth_remote_gatt_characteristic.cc
index c81a498..87a115a 100644
--- a/device/bluetooth/bluetooth_remote_gatt_characteristic.cc
+++ b/device/bluetooth/bluetooth_remote_gatt_characteristic.cc
@@ -87,16 +87,18 @@
 
 void BluetoothRemoteGattCharacteristic::StartNotifySession(
     const NotifySessionCallback& callback,
-    const ErrorCallback& error_callback) {
-  StartNotifySessionInternal(base::nullopt, callback, error_callback);
+    ErrorCallback error_callback) {
+  StartNotifySessionInternal(base::nullopt, callback,
+                             std::move(error_callback));
 }
 
 #if defined(OS_CHROMEOS)
 void BluetoothRemoteGattCharacteristic::StartNotifySession(
     NotificationType notification_type,
     const NotifySessionCallback& callback,
-    const ErrorCallback& error_callback) {
-  StartNotifySessionInternal(notification_type, callback, error_callback);
+    ErrorCallback error_callback) {
+  StartNotifySessionInternal(notification_type, callback,
+                             std::move(error_callback));
 }
 #endif
 
@@ -120,13 +122,16 @@
 void BluetoothRemoteGattCharacteristic::StartNotifySessionInternal(
     const base::Optional<NotificationType>& notification_type,
     const NotifySessionCallback& callback,
-    const ErrorCallback& error_callback) {
+    ErrorCallback error_callback) {
+  auto repeating_error_callback =
+      base::AdaptCallbackForRepeating(std::move(error_callback));
   NotifySessionCommand* command = new NotifySessionCommand(
       base::Bind(&BluetoothRemoteGattCharacteristic::ExecuteStartNotifySession,
-                 GetWeakPtr(), notification_type, callback, error_callback),
+                 GetWeakPtr(), notification_type, callback,
+                 repeating_error_callback),
       base::Bind(&BluetoothRemoteGattCharacteristic::CancelStartNotifySession,
                  GetWeakPtr(),
-                 base::Bind(error_callback,
+                 base::Bind(repeating_error_callback,
                             BluetoothRemoteGattService::GATT_ERROR_FAILED)));
 
   pending_notify_commands_.push(std::unique_ptr<NotifySessionCommand>(command));
@@ -157,7 +162,8 @@
           FROM_HERE,
           base::BindOnce(
               &BluetoothRemoteGattCharacteristic::OnStartNotifySessionError,
-              GetWeakPtr(), error_callback, previous_command_error_code));
+              GetWeakPtr(), std::move(error_callback),
+              previous_command_error_code));
       return;
     }
   }
@@ -172,7 +178,7 @@
         FROM_HERE,
         base::BindOnce(
             &BluetoothRemoteGattCharacteristic::OnStartNotifySessionError,
-            GetWeakPtr(), error_callback,
+            GetWeakPtr(), std::move(error_callback),
             BluetoothRemoteGattService::GATT_ERROR_NOT_SUPPORTED));
     return;
   }
@@ -201,7 +207,7 @@
         FROM_HERE,
         base::BindOnce(
             &BluetoothRemoteGattCharacteristic::OnStartNotifySessionError,
-            GetWeakPtr(), error_callback,
+            GetWeakPtr(), std::move(error_callback),
             (ccc_descriptor.size() == 0)
                 ? BluetoothRemoteGattService::GATT_ERROR_NOT_SUPPORTED
                 : BluetoothRemoteGattService::GATT_ERROR_FAILED));
@@ -221,8 +227,9 @@
       base::Bind(
           &BluetoothRemoteGattCharacteristic::OnStartNotifySessionSuccess,
           GetWeakPtr(), callback),
-      base::Bind(&BluetoothRemoteGattCharacteristic::OnStartNotifySessionError,
-                 GetWeakPtr(), error_callback));
+      base::BindOnce(
+          &BluetoothRemoteGattCharacteristic::OnStartNotifySessionError,
+          GetWeakPtr(), std::move(error_callback)));
 }
 
 void BluetoothRemoteGattCharacteristic::CancelStartNotifySession(
@@ -258,7 +265,7 @@
   std::unique_ptr<NotifySessionCommand> command =
       std::move(pending_notify_commands_.front());
 
-  error_callback.Run(error);
+  std::move(error_callback).Run(error);
 
   pending_notify_commands_.pop();
   if (!pending_notify_commands_.empty()) {
diff --git a/device/bluetooth/bluetooth_remote_gatt_characteristic.h b/device/bluetooth/bluetooth_remote_gatt_characteristic.h
index 8d966aa..b907c1a 100644
--- a/device/bluetooth/bluetooth_remote_gatt_characteristic.h
+++ b/device/bluetooth/bluetooth_remote_gatt_characteristic.h
@@ -117,7 +117,7 @@
   // To stop the flow of notifications, simply call the Stop method on the
   // BluetoothGattNotifySession object that you received in |callback|.
   virtual void StartNotifySession(const NotifySessionCallback& callback,
-                                  const ErrorCallback& error_callback);
+                                  ErrorCallback error_callback);
 #if defined(OS_CHROMEOS)
   // TODO(https://crbug.com/849359): This method should also be implemented on
   // Android and Windows.
@@ -127,24 +127,22 @@
   // https://developer.apple.com/documentation/corebluetooth/cbperipheral/1518949-setnotifyvalue?language=objc#discussion
   virtual void StartNotifySession(NotificationType notification_type,
                                   const NotifySessionCallback& callback,
-                                  const ErrorCallback& error_callback);
+                                  ErrorCallback error_callback);
 #endif
 
   // Sends a read request to a remote characteristic to read its value.
   // |callback| is called to return the read value on success and
   // |error_callback| is called for failures.
-  virtual void ReadRemoteCharacteristic(
-      ValueCallback callback,
-      const ErrorCallback& error_callback) = 0;
+  virtual void ReadRemoteCharacteristic(ValueCallback callback,
+                                        ErrorCallback error_callback) = 0;
 
   // Sends a write request to a remote characteristic with the value |value|.
   // |callback| is called to signal success and |error_callback| for failures.
   // This method only applies to remote characteristics and will fail for those
   // that are locally hosted.
-  virtual void WriteRemoteCharacteristic(
-      const std::vector<uint8_t>& value,
-      base::OnceClosure callback,
-      const ErrorCallback& error_callback) = 0;
+  virtual void WriteRemoteCharacteristic(const std::vector<uint8_t>& value,
+                                         base::OnceClosure callback,
+                                         ErrorCallback error_callback) = 0;
 
 #if defined(OS_CHROMEOS)
   // Sends a prepare write request to a remote characteristic with the value
@@ -156,7 +154,7 @@
   virtual void PrepareWriteRemoteCharacteristic(
       const std::vector<uint8_t>& value,
       base::OnceClosure callback,
-      const ErrorCallback& error_callback) = 0;
+      ErrorCallback error_callback) = 0;
 #endif
 
   // Sends a write request to a remote characteristic with the value |value|
@@ -188,12 +186,12 @@
       BluetoothRemoteGattDescriptor* ccc_descriptor,
       NotificationType notification_type,
       const base::Closure& callback,
-      const ErrorCallback& error_callback) = 0;
+      ErrorCallback error_callback) = 0;
 #else
   virtual void SubscribeToNotifications(
       BluetoothRemoteGattDescriptor* ccc_descriptor,
       const base::Closure& callback,
-      const ErrorCallback& error_callback) = 0;
+      ErrorCallback error_callback) = 0;
 #endif
 
   // Writes to the Client Characteristic Configuration descriptor to disable
@@ -203,7 +201,7 @@
   virtual void UnsubscribeFromNotifications(
       BluetoothRemoteGattDescriptor* ccc_descriptor,
       const base::Closure& callback,
-      const ErrorCallback& error_callback) = 0;
+      ErrorCallback error_callback) = 0;
 
   // Utility function to add a |descriptor| to the map of |descriptors_|.
   bool AddDescriptor(std::unique_ptr<BluetoothRemoteGattDescriptor> descriptor);
@@ -258,7 +256,7 @@
   void StartNotifySessionInternal(
       const base::Optional<NotificationType>& notification_type,
       const NotifySessionCallback& callback,
-      const ErrorCallback& error_callback);
+      ErrorCallback error_callback);
   void ExecuteStartNotifySession(
       const base::Optional<NotificationType>& notification_type,
       NotifySessionCallback callback,
diff --git a/device/bluetooth/bluetooth_remote_gatt_characteristic_android.cc b/device/bluetooth/bluetooth_remote_gatt_characteristic_android.cc
index 0c4ae0f..c488469b 100644
--- a/device/bluetooth/bluetooth_remote_gatt_characteristic_android.cc
+++ b/device/bluetooth/bluetooth_remote_gatt_characteristic_android.cc
@@ -57,12 +57,14 @@
       AttachCurrentThread(), j_characteristic_);
   if (!read_callback_.is_null()) {
     DCHECK(!read_error_callback_.is_null());
-    read_error_callback_.Run(BluetoothGattService::GATT_ERROR_FAILED);
+    std::move(read_error_callback_)
+        .Run(BluetoothGattService::GATT_ERROR_FAILED);
   }
 
   if (!write_callback_.is_null()) {
     DCHECK(!write_error_callback_.is_null());
-    write_error_callback_.Run(BluetoothGattService::GATT_ERROR_FAILED);
+    std::move(write_error_callback_)
+        .Run(BluetoothGattService::GATT_ERROR_FAILED);
   }
 }
 
@@ -125,11 +127,11 @@
 
 void BluetoothRemoteGattCharacteristicAndroid::ReadRemoteCharacteristic(
     ValueCallback callback,
-    const ErrorCallback& error_callback) {
+    ErrorCallback error_callback) {
   if (read_pending_ || write_pending_) {
     base::ThreadTaskRunnerHandle::Get()->PostTask(
         FROM_HERE,
-        base::BindOnce(error_callback,
+        base::BindOnce(std::move(error_callback),
                        BluetoothRemoteGattService::GATT_ERROR_IN_PROGRESS));
     return;
   }
@@ -138,24 +140,24 @@
           AttachCurrentThread(), j_characteristic_)) {
     base::ThreadTaskRunnerHandle::Get()->PostTask(
         FROM_HERE,
-        base::BindOnce(error_callback,
+        base::BindOnce(std::move(error_callback),
                        BluetoothRemoteGattService::GATT_ERROR_FAILED));
     return;
   }
 
   read_pending_ = true;
   read_callback_ = std::move(callback);
-  read_error_callback_ = error_callback;
+  read_error_callback_ = std::move(error_callback);
 }
 
 void BluetoothRemoteGattCharacteristicAndroid::WriteRemoteCharacteristic(
     const std::vector<uint8_t>& value,
     base::OnceClosure callback,
-    const ErrorCallback& error_callback) {
+    ErrorCallback error_callback) {
   if (read_pending_ || write_pending_) {
     base::ThreadTaskRunnerHandle::Get()->PostTask(
         FROM_HERE,
-        base::BindOnce(error_callback,
+        base::BindOnce(std::move(error_callback),
                        BluetoothRemoteGattService::GATT_ERROR_IN_PROGRESS));
     return;
   }
@@ -165,14 +167,14 @@
           env, j_characteristic_, base::android::ToJavaByteArray(env, value))) {
     base::ThreadTaskRunnerHandle::Get()->PostTask(
         FROM_HERE,
-        base::BindOnce(error_callback,
+        base::BindOnce(std::move(error_callback),
                        BluetoothRemoteGattService::GATT_ERROR_FAILED));
     return;
   }
 
   write_pending_ = true;
   write_callback_ = std::move(callback);
-  write_error_callback_ = error_callback;
+  write_error_callback_ = std::move(error_callback);
 }
 
 void BluetoothRemoteGattCharacteristicAndroid::OnChanged(
@@ -192,16 +194,15 @@
 
   // Clear callbacks before calling to avoid reentrancy issues.
   ValueCallback read_callback = std::move(read_callback_);
-  ErrorCallback read_error_callback = read_error_callback_;
-  read_error_callback_.Reset();
+  ErrorCallback read_error_callback = std::move(read_error_callback_);
 
   if (status == 0  // android.bluetooth.BluetoothGatt.GATT_SUCCESS
       && !read_callback.is_null()) {
     base::android::JavaByteArrayToByteVector(env, value, &value_);
     std::move(read_callback).Run(value_);
   } else if (!read_error_callback.is_null()) {
-    read_error_callback.Run(
-        BluetoothRemoteGattServiceAndroid::GetGattErrorCode(status));
+    std::move(read_error_callback)
+        .Run(BluetoothRemoteGattServiceAndroid::GetGattErrorCode(status));
   }
 }
 
@@ -213,15 +214,14 @@
 
   // Clear callbacks before calling to avoid reentrancy issues.
   base::OnceClosure write_callback = std::move(write_callback_);
-  ErrorCallback write_error_callback = write_error_callback_;
-  write_error_callback_.Reset();
+  ErrorCallback write_error_callback = std::move(write_error_callback_);
 
   if (status == 0  // android.bluetooth.BluetoothGatt.GATT_SUCCESS
       && !write_callback.is_null()) {
     std::move(write_callback).Run();
   } else if (!write_error_callback.is_null()) {
-    write_error_callback.Run(
-        BluetoothRemoteGattServiceAndroid::GetGattErrorCode(status));
+    std::move(write_error_callback)
+        .Run(BluetoothRemoteGattServiceAndroid::GetGattErrorCode(status));
   }
 }
 
@@ -245,13 +245,13 @@
 void BluetoothRemoteGattCharacteristicAndroid::SubscribeToNotifications(
     BluetoothRemoteGattDescriptor* ccc_descriptor,
     const base::Closure& callback,
-    const ErrorCallback& error_callback) {
+    ErrorCallback error_callback) {
   if (!Java_ChromeBluetoothRemoteGattCharacteristic_setCharacteristicNotification(
           AttachCurrentThread(), j_characteristic_, true)) {
     LOG(ERROR) << "Error enabling characteristic notification";
     base::ThreadTaskRunnerHandle::Get()->PostTask(
         FROM_HERE,
-        base::BindOnce(error_callback,
+        base::BindOnce(std::move(error_callback),
                        BluetoothRemoteGattService::GATT_ERROR_FAILED));
     return;
   }
@@ -260,19 +260,20 @@
   std::vector<uint8_t> value(2);
   value[0] = hasNotify ? 1 : 2;
 
-  ccc_descriptor->WriteRemoteDescriptor(value, callback, error_callback);
+  ccc_descriptor->WriteRemoteDescriptor(value, callback,
+                                        std::move(error_callback));
 }
 
 void BluetoothRemoteGattCharacteristicAndroid::UnsubscribeFromNotifications(
     BluetoothRemoteGattDescriptor* ccc_descriptor,
     const base::Closure& callback,
-    const ErrorCallback& error_callback) {
+    ErrorCallback error_callback) {
   if (!Java_ChromeBluetoothRemoteGattCharacteristic_setCharacteristicNotification(
           AttachCurrentThread(), j_characteristic_, false)) {
     LOG(ERROR) << "Error disabling characteristic notification";
     base::ThreadTaskRunnerHandle::Get()->PostTask(
         FROM_HERE,
-        base::BindOnce(error_callback,
+        base::BindOnce(std::move(error_callback),
                        device::BluetoothRemoteGattService::GATT_ERROR_FAILED));
     return;
   }
@@ -280,7 +281,8 @@
   std::vector<uint8_t> value(2);
   value[0] = 0;
 
-  ccc_descriptor->WriteRemoteDescriptor(value, callback, error_callback);
+  ccc_descriptor->WriteRemoteDescriptor(value, callback,
+                                        std::move(error_callback));
 }
 
 BluetoothRemoteGattCharacteristicAndroid::
diff --git a/device/bluetooth/bluetooth_remote_gatt_characteristic_android.h b/device/bluetooth/bluetooth_remote_gatt_characteristic_android.h
index 8c54455..0b13590 100644
--- a/device/bluetooth/bluetooth_remote_gatt_characteristic_android.h
+++ b/device/bluetooth/bluetooth_remote_gatt_characteristic_android.h
@@ -64,10 +64,10 @@
   std::vector<BluetoothRemoteGattDescriptor*> GetDescriptorsByUUID(
       const BluetoothUUID& uuid) const override;
   void ReadRemoteCharacteristic(ValueCallback callback,
-                                const ErrorCallback& error_callback) override;
+                                ErrorCallback error_callback) override;
   void WriteRemoteCharacteristic(const std::vector<uint8_t>& value,
                                  base::OnceClosure callback,
-                                 const ErrorCallback& error_callback) override;
+                                 ErrorCallback error_callback) override;
 
   // Called when value changed event occurs.
   void OnChanged(JNIEnv* env,
@@ -101,11 +101,11 @@
  protected:
   void SubscribeToNotifications(BluetoothRemoteGattDescriptor* ccc_descriptor,
                                 const base::Closure& callback,
-                                const ErrorCallback& error_callback) override;
+                                ErrorCallback error_callback) override;
   void UnsubscribeFromNotifications(
       BluetoothRemoteGattDescriptor* ccc_descriptor,
       const base::Closure& callback,
-      const ErrorCallback& error_callback) override;
+      ErrorCallback error_callback) override;
 
  private:
   BluetoothRemoteGattCharacteristicAndroid(
diff --git a/device/bluetooth/bluetooth_remote_gatt_characteristic_mac.h b/device/bluetooth/bluetooth_remote_gatt_characteristic_mac.h
index 68bb546..975b62e 100644
--- a/device/bluetooth/bluetooth_remote_gatt_characteristic_mac.h
+++ b/device/bluetooth/bluetooth_remote_gatt_characteristic_mac.h
@@ -42,20 +42,20 @@
   BluetoothRemoteGattService* GetService() const override;
   bool IsNotifying() const override;
   void ReadRemoteCharacteristic(ValueCallback callback,
-                                const ErrorCallback& error_callback) override;
+                                ErrorCallback error_callback) override;
   void WriteRemoteCharacteristic(const std::vector<uint8_t>& value,
                                  base::OnceClosure callback,
-                                 const ErrorCallback& error_callback) override;
+                                 ErrorCallback error_callback) override;
   bool WriteWithoutResponse(base::span<const uint8_t> value) override;
 
  protected:
   void SubscribeToNotifications(BluetoothRemoteGattDescriptor* ccc_descriptor,
                                 const base::Closure& callback,
-                                const ErrorCallback& error_callback) override;
+                                ErrorCallback error_callback) override;
   void UnsubscribeFromNotifications(
       BluetoothRemoteGattDescriptor* ccc_descriptor,
       const base::Closure& callback,
-      const ErrorCallback& error_callback) override;
+      ErrorCallback error_callback) override;
 
  private:
   friend class BluetoothLowEnergyDeviceMac;
diff --git a/device/bluetooth/bluetooth_remote_gatt_characteristic_mac.mm b/device/bluetooth/bluetooth_remote_gatt_characteristic_mac.mm
index eef734c..dd4c77c 100644
--- a/device/bluetooth/bluetooth_remote_gatt_characteristic_mac.mm
+++ b/device/bluetooth/bluetooth_remote_gatt_characteristic_mac.mm
@@ -84,12 +84,12 @@
 
 BluetoothRemoteGattCharacteristicMac::~BluetoothRemoteGattCharacteristicMac() {
   if (HasPendingRead()) {
-    read_characteristic_value_callbacks_.second.Run(
-        BluetoothGattService::GATT_ERROR_FAILED);
+    std::move(read_characteristic_value_callbacks_.second)
+        .Run(BluetoothGattService::GATT_ERROR_FAILED);
   }
   if (HasPendingWrite()) {
-    write_characteristic_value_callbacks_.second.Run(
-        BluetoothGattService::GATT_ERROR_FAILED);
+    std::move(write_characteristic_value_callbacks_.second)
+        .Run(BluetoothGattService::GATT_ERROR_FAILED);
   }
 }
 
@@ -129,12 +129,12 @@
 
 void BluetoothRemoteGattCharacteristicMac::ReadRemoteCharacteristic(
     ValueCallback callback,
-    const ErrorCallback& error_callback) {
+    ErrorCallback error_callback) {
   if (!IsReadable()) {
     VLOG(1) << *this << ": Characteristic not readable.";
     base::ThreadTaskRunnerHandle::Get()->PostTask(
         FROM_HERE,
-        base::BindOnce(error_callback,
+        base::BindOnce(std::move(error_callback),
                        BluetoothRemoteGattService::GATT_ERROR_NOT_SUPPORTED));
     return;
   }
@@ -142,25 +142,25 @@
     VLOG(1) << *this << ": Characteristic read already in progress.";
     base::ThreadTaskRunnerHandle::Get()->PostTask(
         FROM_HERE,
-        base::BindOnce(error_callback,
+        base::BindOnce(std::move(error_callback),
                        BluetoothRemoteGattService::GATT_ERROR_IN_PROGRESS));
     return;
   }
   VLOG(1) << *this << ": Read characteristic.";
   read_characteristic_value_callbacks_ =
-      std::make_pair(std::move(callback), error_callback);
+      std::make_pair(std::move(callback), std::move(error_callback));
   [GetCBPeripheral() readValueForCharacteristic:cb_characteristic_];
 }
 
 void BluetoothRemoteGattCharacteristicMac::WriteRemoteCharacteristic(
     const std::vector<uint8_t>& value,
     base::OnceClosure callback,
-    const ErrorCallback& error_callback) {
+    ErrorCallback error_callback) {
   if (!IsWritable()) {
     VLOG(1) << *this << ": Characteristic not writable.";
     base::ThreadTaskRunnerHandle::Get()->PostTask(
         FROM_HERE,
-        base::BindOnce(error_callback,
+        base::BindOnce(std::move(error_callback),
                        BluetoothRemoteGattService::GATT_ERROR_NOT_PERMITTED));
     return;
   }
@@ -168,13 +168,13 @@
     VLOG(1) << *this << ": Characteristic write already in progress.";
     base::ThreadTaskRunnerHandle::Get()->PostTask(
         FROM_HERE,
-        base::BindOnce(error_callback,
+        base::BindOnce(std::move(error_callback),
                        BluetoothRemoteGattService::GATT_ERROR_IN_PROGRESS));
     return;
   }
   VLOG(1) << *this << ": Write characteristic.";
   write_characteristic_value_callbacks_ =
-      std::make_pair(std::move(callback), error_callback);
+      std::make_pair(std::move(callback), std::move(error_callback));
   base::scoped_nsobject<NSData> nsdata_value(
       [[NSData alloc] initWithBytes:value.data() length:value.size()]);
   CBCharacteristicWriteType write_type = GetCBWriteType();
@@ -212,28 +212,28 @@
 void BluetoothRemoteGattCharacteristicMac::SubscribeToNotifications(
     BluetoothRemoteGattDescriptor* ccc_descriptor,
     const base::Closure& callback,
-    const ErrorCallback& error_callback) {
+    ErrorCallback error_callback) {
   VLOG(1) << *this << ": Subscribe to characteristic.";
   DCHECK(subscribe_to_notification_callbacks_.first.is_null());
   DCHECK(subscribe_to_notification_callbacks_.second.is_null());
   DCHECK(unsubscribe_from_notification_callbacks_.first.is_null());
   DCHECK(unsubscribe_from_notification_callbacks_.second.is_null());
   subscribe_to_notification_callbacks_ =
-      std::make_pair(callback, error_callback);
+      std::make_pair(callback, std::move(error_callback));
   [GetCBPeripheral() setNotifyValue:YES forCharacteristic:cb_characteristic_];
 }
 
 void BluetoothRemoteGattCharacteristicMac::UnsubscribeFromNotifications(
     BluetoothRemoteGattDescriptor* ccc_descriptor,
     const base::Closure& callback,
-    const ErrorCallback& error_callback) {
+    ErrorCallback error_callback) {
   VLOG(1) << *this << ": Unsubscribe from characteristic.";
   DCHECK(subscribe_to_notification_callbacks_.first.is_null());
   DCHECK(subscribe_to_notification_callbacks_.second.is_null());
   DCHECK(unsubscribe_from_notification_callbacks_.first.is_null());
   DCHECK(unsubscribe_from_notification_callbacks_.second.is_null());
   unsubscribe_from_notification_callbacks_ =
-      std::make_pair(callback, error_callback);
+      std::make_pair(callback, std::move(error_callback));
   [GetCBPeripheral() setNotifyValue:NO forCharacteristic:cb_characteristic_];
 }
 
@@ -259,7 +259,7 @@
               << ": Bluetooth error while reading for characteristic, domain: "
               << BluetoothAdapterMac::String(error)
               << ", error code: " << error_code;
-      callbacks.second.Run(error_code);
+      std::move(callbacks.second).Run(error_code);
       return;
     }
     VLOG(1) << *this << ": Read request arrived.";
@@ -297,7 +297,7 @@
       GetCBPeripheral().state != CBPeripheralStateConnected) {
     std::pair<base::OnceClosure, ErrorCallback> callbacks;
     callbacks.swap(write_characteristic_value_callbacks_);
-    callbacks.second.Run(BluetoothGattService::GATT_ERROR_FAILED);
+    std::move(callbacks.second).Run(BluetoothGattService::GATT_ERROR_FAILED);
     return;
   }
 
@@ -319,7 +319,7 @@
             << ": Bluetooth error while writing for characteristic, error: "
             << BluetoothAdapterMac::String(error)
             << ", error code: " << error_code;
-    callbacks.second.Run(error_code);
+    std::move(callbacks.second).Run(error_code);
     return;
   }
   VLOG(1) << *this << ": Write value succeeded.";
@@ -348,7 +348,7 @@
                "characteristic, error: "
             << BluetoothAdapterMac::String(error)
             << ", error code: " << error_code;
-    reentrant_safe_callbacks.second.Run(error_code);
+    std::move(reentrant_safe_callbacks.second).Run(error_code);
     return;
   }
   reentrant_safe_callbacks.first.Run();
diff --git a/device/bluetooth/bluetooth_remote_gatt_characteristic_unittest.cc b/device/bluetooth/bluetooth_remote_gatt_characteristic_unittest.cc
index 4d49ae4..24e8641b 100644
--- a/device/bluetooth/bluetooth_remote_gatt_characteristic_unittest.cc
+++ b/device/bluetooth/bluetooth_remote_gatt_characteristic_unittest.cc
@@ -2908,9 +2908,10 @@
   notify_sessions_[0]->Stop(base::Bind(
       [](BluetoothRemoteGattCharacteristic* characteristic,
          BluetoothRemoteGattCharacteristic::NotifySessionCallback
-             notifyCallback,
-         BluetoothRemoteGattCharacteristic::ErrorCallback errorCallback) {
-        characteristic->StartNotifySession(notifyCallback, errorCallback);
+             notify_callback,
+         BluetoothRemoteGattCharacteristic::ErrorCallback error_callback) {
+        characteristic->StartNotifySession(notify_callback,
+                                           std::move(error_callback));
       },
       characteristic1_, GetNotifyCallback(Call::EXPECTED),
       GetGattErrorCallback(Call::NOT_EXPECTED)));
@@ -2963,9 +2964,10 @@
   notify_sessions_[0]->Stop(base::Bind(
       [](BluetoothRemoteGattCharacteristic* characteristic,
          BluetoothRemoteGattCharacteristic::NotifySessionCallback
-             notifyCallback,
-         BluetoothRemoteGattCharacteristic::ErrorCallback errorCallback) {
-        characteristic->StartNotifySession(notifyCallback, errorCallback);
+             notify_callback,
+         BluetoothRemoteGattCharacteristic::ErrorCallback error_callback) {
+        characteristic->StartNotifySession(notify_callback,
+                                           std::move(error_callback));
       },
       characteristic1_, GetNotifyCallback(Call::NOT_EXPECTED),
       GetGattErrorCallback(Call::EXPECTED)));
diff --git a/device/bluetooth/bluetooth_remote_gatt_characteristic_win.cc b/device/bluetooth/bluetooth_remote_gatt_characteristic_win.cc
index bd7d262..4b2e41c 100644
--- a/device/bluetooth/bluetooth_remote_gatt_characteristic_win.cc
+++ b/device/bluetooth/bluetooth_remote_gatt_characteristic_win.cc
@@ -59,19 +59,15 @@
 
   if (!read_characteristic_value_callbacks_.first.is_null()) {
     DCHECK(!read_characteristic_value_callbacks_.second.is_null());
-    read_characteristic_value_callbacks_.second.Run(
-        BluetoothRemoteGattService::GATT_ERROR_FAILED);
+    std::move(read_characteristic_value_callbacks_.second)
+        .Run(BluetoothRemoteGattService::GATT_ERROR_FAILED);
   }
 
   if (!write_characteristic_value_callbacks_.first.is_null()) {
     DCHECK(!write_characteristic_value_callbacks_.second.is_null());
-    write_characteristic_value_callbacks_.second.Run(
-        BluetoothRemoteGattService::GATT_ERROR_FAILED);
+    std::move(write_characteristic_value_callbacks_.second)
+        .Run(BluetoothRemoteGattService::GATT_ERROR_FAILED);
   }
-
-  // Clear pending StartNotifySession callbacks.
-  for (const auto& callback : start_notify_session_callbacks_)
-    callback.second.Run(BluetoothRemoteGattService::GATT_ERROR_FAILED);
 }
 
 std::string BluetoothRemoteGattCharacteristicWin::GetIdentifier() const {
@@ -137,22 +133,24 @@
 
 void BluetoothRemoteGattCharacteristicWin::ReadRemoteCharacteristic(
     ValueCallback callback,
-    const ErrorCallback& error_callback) {
+    ErrorCallback error_callback) {
   DCHECK(ui_task_runner_->RunsTasksInCurrentSequence());
 
   if (!characteristic_info_.get()->IsReadable) {
-    error_callback.Run(BluetoothRemoteGattService::GATT_ERROR_NOT_PERMITTED);
+    std::move(error_callback)
+        .Run(BluetoothRemoteGattService::GATT_ERROR_NOT_PERMITTED);
     return;
   }
 
   if (characteristic_value_read_or_write_in_progress_) {
-    error_callback.Run(BluetoothRemoteGattService::GATT_ERROR_IN_PROGRESS);
+    std::move(error_callback)
+        .Run(BluetoothRemoteGattService::GATT_ERROR_IN_PROGRESS);
     return;
   }
 
   characteristic_value_read_or_write_in_progress_ = true;
   read_characteristic_value_callbacks_ =
-      std::make_pair(std::move(callback), error_callback);
+      std::make_pair(std::move(callback), std::move(error_callback));
   task_manager_->PostReadGattCharacteristicValue(
       parent_service_->GetServicePath(), characteristic_info_.get(),
       base::Bind(&BluetoothRemoteGattCharacteristicWin::
@@ -163,23 +161,25 @@
 void BluetoothRemoteGattCharacteristicWin::WriteRemoteCharacteristic(
     const std::vector<uint8_t>& value,
     base::OnceClosure callback,
-    const ErrorCallback& error_callback) {
+    ErrorCallback error_callback) {
   DCHECK(ui_task_runner_->RunsTasksInCurrentSequence());
 
   if (!characteristic_info_->IsWritable &&
       !characteristic_info_->IsWritableWithoutResponse) {
-    error_callback.Run(BluetoothRemoteGattService::GATT_ERROR_NOT_PERMITTED);
+    std::move(error_callback)
+        .Run(BluetoothRemoteGattService::GATT_ERROR_NOT_PERMITTED);
     return;
   }
 
   if (characteristic_value_read_or_write_in_progress_) {
-    error_callback.Run(BluetoothRemoteGattService::GATT_ERROR_IN_PROGRESS);
+    std::move(error_callback)
+        .Run(BluetoothRemoteGattService::GATT_ERROR_IN_PROGRESS);
     return;
   }
 
   characteristic_value_read_or_write_in_progress_ = true;
   write_characteristic_value_callbacks_ =
-      std::make_pair(std::move(callback), error_callback);
+      std::make_pair(std::move(callback), std::move(error_callback));
   task_manager_->PostWriteGattCharacteristicValue(
       parent_service_->GetServicePath(), characteristic_info_.get(), value,
       base::Bind(&BluetoothRemoteGattCharacteristicWin::
@@ -205,14 +205,14 @@
 void BluetoothRemoteGattCharacteristicWin::SubscribeToNotifications(
     BluetoothRemoteGattDescriptor* ccc_descriptor,
     const base::Closure& callback,
-    const ErrorCallback& error_callback) {
+    ErrorCallback error_callback) {
   task_manager_->PostRegisterGattCharacteristicValueChangedEvent(
       parent_service_->GetServicePath(), characteristic_info_.get(),
       static_cast<BluetoothRemoteGattDescriptorWin*>(ccc_descriptor)
           ->GetWinDescriptorInfo(),
-      base::Bind(
+      base::BindOnce(
           &BluetoothRemoteGattCharacteristicWin::GattEventRegistrationCallback,
-          weak_ptr_factory_.GetWeakPtr(), callback, error_callback),
+          weak_ptr_factory_.GetWeakPtr(), callback, std::move(error_callback)),
       base::Bind(&BluetoothRemoteGattCharacteristicWin::
                      OnGattCharacteristicValueChanged,
                  weak_ptr_factory_.GetWeakPtr()));
@@ -221,7 +221,7 @@
 void BluetoothRemoteGattCharacteristicWin::UnsubscribeFromNotifications(
     BluetoothRemoteGattDescriptor* ccc_descriptor,
     const base::Closure& callback,
-    const ErrorCallback& error_callback) {
+    ErrorCallback error_callback) {
   // TODO(crbug.com/735828): Implement this method.
   base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, callback);
 }
@@ -326,7 +326,7 @@
   std::pair<ValueCallback, ErrorCallback> callbacks;
   callbacks.swap(read_characteristic_value_callbacks_);
   if (FAILED(hr)) {
-    callbacks.second.Run(HRESULTToGattErrorCode(hr));
+    std::move(callbacks.second).Run(HRESULTToGattErrorCode(hr));
   } else {
     characteristic_value_.clear();
     for (ULONG i = 0; i < value->DataSize; i++)
@@ -344,7 +344,7 @@
   std::pair<base::OnceClosure, ErrorCallback> callbacks;
   callbacks.swap(write_characteristic_value_callbacks_);
   if (FAILED(hr)) {
-    callbacks.second.Run(HRESULTToGattErrorCode(hr));
+    std::move(callbacks.second).Run(HRESULTToGattErrorCode(hr));
   } else {
     std::move(callbacks.first).Run();
   }
@@ -381,7 +381,7 @@
 
 void BluetoothRemoteGattCharacteristicWin::GattEventRegistrationCallback(
     const base::Closure& callback,
-    const ErrorCallback& error_callback,
+    ErrorCallback error_callback,
     BLUETOOTH_GATT_EVENT_HANDLE event_handle,
     HRESULT hr) {
   DCHECK(ui_task_runner_->RunsTasksInCurrentSequence());
@@ -389,7 +389,7 @@
     gatt_event_handle_ = event_handle;
     callback.Run();
   } else {
-    error_callback.Run(HRESULTToGattErrorCode(hr));
+    std::move(error_callback).Run(HRESULTToGattErrorCode(hr));
   }
 }
 
diff --git a/device/bluetooth/bluetooth_remote_gatt_characteristic_win.h b/device/bluetooth/bluetooth_remote_gatt_characteristic_win.h
index f236424..07d50cef 100644
--- a/device/bluetooth/bluetooth_remote_gatt_characteristic_win.h
+++ b/device/bluetooth/bluetooth_remote_gatt_characteristic_win.h
@@ -43,10 +43,10 @@
   Permissions GetPermissions() const override;
   bool IsNotifying() const override;
   void ReadRemoteCharacteristic(ValueCallback callback,
-                                const ErrorCallback& error_callback) override;
+                                ErrorCallback error_callback) override;
   void WriteRemoteCharacteristic(const std::vector<uint8_t>& value,
                                  base::OnceClosure callback,
-                                 const ErrorCallback& error_callback) override;
+                                 ErrorCallback error_callback) override;
 
   // Update included descriptors.
   void Update();
@@ -56,11 +56,11 @@
  protected:
   void SubscribeToNotifications(BluetoothRemoteGattDescriptor* ccc_descriptor,
                                 const base::Closure& callback,
-                                const ErrorCallback& error_callback) override;
+                                ErrorCallback error_callback) override;
   void UnsubscribeFromNotifications(
       BluetoothRemoteGattDescriptor* ccc_descriptor,
       const base::Closure& callback,
-      const ErrorCallback& error_callback) override;
+      ErrorCallback error_callback) override;
 
  private:
   void OnGetIncludedDescriptorsCallback(
@@ -89,7 +89,7 @@
   void OnGattCharacteristicValueChanged(
       std::unique_ptr<std::vector<uint8_t>> new_value);
   void GattEventRegistrationCallback(const base::Closure& callback,
-                                     const ErrorCallback& error_callback,
+                                     ErrorCallback error_callback,
                                      PVOID event_handle,
                                      HRESULT hr);
   void ClearIncludedDescriptors();
@@ -117,10 +117,6 @@
 
   bool characteristic_value_read_or_write_in_progress_;
 
-  // Vector stores StartNotifySession request callbacks.
-  std::vector<std::pair<NotifySessionCallback, ErrorCallback>>
-      start_notify_session_callbacks_;
-
   // GATT event handle returned by GattEventRegistrationCallback.
   PVOID gatt_event_handle_;
 
diff --git a/device/bluetooth/bluetooth_remote_gatt_characteristic_winrt.cc b/device/bluetooth/bluetooth_remote_gatt_characteristic_winrt.cc
index 84f991c..210a222 100644
--- a/device/bluetooth/bluetooth_remote_gatt_characteristic_winrt.cc
+++ b/device/bluetooth/bluetooth_remote_gatt_characteristic_winrt.cc
@@ -8,6 +8,7 @@
 
 #include "base/bind.h"
 #include "base/bind_helpers.h"
+#include "base/callback_helpers.h"
 #include "base/logging.h"
 #include "base/memory/ptr_util.h"
 #include "base/strings/stringprintf.h"
@@ -104,13 +105,13 @@
 BluetoothRemoteGattCharacteristicWinrt::
     ~BluetoothRemoteGattCharacteristicWinrt() {
   if (pending_read_callbacks_) {
-    pending_read_callbacks_->error_callback.Run(
-        BluetoothGattService::GATT_ERROR_FAILED);
+    std::move(pending_read_callbacks_->error_callback)
+        .Run(BluetoothGattService::GATT_ERROR_FAILED);
   }
 
   if (pending_write_callbacks_) {
-    pending_write_callbacks_->error_callback.Run(
-        BluetoothGattService::GATT_ERROR_FAILED);
+    std::move(pending_write_callbacks_->error_callback)
+        .Run(BluetoothGattService::GATT_ERROR_FAILED);
   }
 
   if (value_changed_token_)
@@ -148,11 +149,11 @@
 
 void BluetoothRemoteGattCharacteristicWinrt::ReadRemoteCharacteristic(
     ValueCallback callback,
-    const ErrorCallback& error_callback) {
+    ErrorCallback error_callback) {
   if (!(GetProperties() & PROPERTY_READ)) {
     base::ThreadTaskRunnerHandle::Get()->PostTask(
         FROM_HERE,
-        base::BindOnce(error_callback,
+        base::BindOnce(std::move(error_callback),
                        BluetoothRemoteGattService::GATT_ERROR_NOT_PERMITTED));
     return;
   }
@@ -160,7 +161,7 @@
   if (pending_read_callbacks_ || pending_write_callbacks_) {
     base::ThreadTaskRunnerHandle::Get()->PostTask(
         FROM_HERE,
-        base::BindOnce(error_callback,
+        base::BindOnce(std::move(error_callback),
                        BluetoothRemoteGattService::GATT_ERROR_IN_PROGRESS));
     return;
   }
@@ -173,7 +174,7 @@
             << logging::SystemErrorCodeToString(hr);
     base::ThreadTaskRunnerHandle::Get()->PostTask(
         FROM_HERE,
-        base::BindOnce(error_callback,
+        base::BindOnce(std::move(error_callback),
                        BluetoothRemoteGattService::GATT_ERROR_FAILED));
     return;
   }
@@ -188,24 +189,24 @@
             << logging::SystemErrorCodeToString(hr);
     base::ThreadTaskRunnerHandle::Get()->PostTask(
         FROM_HERE,
-        base::BindOnce(error_callback,
+        base::BindOnce(std::move(error_callback),
                        BluetoothRemoteGattService::GATT_ERROR_FAILED));
     return;
   }
 
   pending_read_callbacks_ = std::make_unique<PendingReadCallbacks>(
-      std::move(callback), error_callback);
+      std::move(callback), std::move(error_callback));
 }
 
 void BluetoothRemoteGattCharacteristicWinrt::WriteRemoteCharacteristic(
     const std::vector<uint8_t>& value,
     base::OnceClosure callback,
-    const ErrorCallback& error_callback) {
+    ErrorCallback error_callback) {
   if (!(GetProperties() & PROPERTY_WRITE) &&
       !(GetProperties() & PROPERTY_WRITE_WITHOUT_RESPONSE)) {
     base::ThreadTaskRunnerHandle::Get()->PostTask(
         FROM_HERE,
-        base::BindOnce(error_callback,
+        base::BindOnce(std::move(error_callback),
                        BluetoothRemoteGattService::GATT_ERROR_NOT_PERMITTED));
     return;
   }
@@ -213,7 +214,7 @@
   if (pending_read_callbacks_ || pending_write_callbacks_) {
     base::ThreadTaskRunnerHandle::Get()->PostTask(
         FROM_HERE,
-        base::BindOnce(error_callback,
+        base::BindOnce(std::move(error_callback),
                        BluetoothRemoteGattService::GATT_ERROR_IN_PROGRESS));
     return;
   }
@@ -225,7 +226,7 @@
             << logging::SystemErrorCodeToString(hr);
     base::ThreadTaskRunnerHandle::Get()->PostTask(
         FROM_HERE,
-        base::BindOnce(error_callback,
+        base::BindOnce(std::move(error_callback),
                        BluetoothRemoteGattService::GATT_ERROR_FAILED));
     return;
   }
@@ -237,7 +238,7 @@
             << logging::SystemErrorCodeToString(hr);
     base::ThreadTaskRunnerHandle::Get()->PostTask(
         FROM_HERE,
-        base::BindOnce(error_callback,
+        base::BindOnce(std::move(error_callback),
                        BluetoothRemoteGattService::GATT_ERROR_FAILED));
     return;
   }
@@ -254,7 +255,7 @@
             << logging::SystemErrorCodeToString(hr);
     base::ThreadTaskRunnerHandle::Get()->PostTask(
         FROM_HERE,
-        base::BindOnce(error_callback,
+        base::BindOnce(std::move(error_callback),
                        BluetoothRemoteGattService::GATT_ERROR_FAILED));
     return;
   }
@@ -270,13 +271,13 @@
             << logging::SystemErrorCodeToString(hr);
     base::ThreadTaskRunnerHandle::Get()->PostTask(
         FROM_HERE,
-        base::BindOnce(error_callback,
+        base::BindOnce(std::move(error_callback),
                        BluetoothRemoteGattService::GATT_ERROR_FAILED));
     return;
   }
 
   pending_write_callbacks_ = std::make_unique<PendingWriteCallbacks>(
-      std::move(callback), error_callback);
+      std::move(callback), std::move(error_callback));
 }
 
 void BluetoothRemoteGattCharacteristicWinrt::UpdateDescriptors(
@@ -363,7 +364,7 @@
 void BluetoothRemoteGattCharacteristicWinrt::SubscribeToNotifications(
     BluetoothRemoteGattDescriptor* ccc_descriptor,
     const base::Closure& callback,
-    const ErrorCallback& error_callback) {
+    ErrorCallback error_callback) {
   value_changed_token_ = AddTypedEventHandler(
       characteristic_.Get(), &IGattCharacteristic::add_ValueChanged,
       base::BindRepeating(
@@ -374,7 +375,7 @@
     VLOG(2) << "Adding Value Changed Handler failed.";
     base::ThreadTaskRunnerHandle::Get()->PostTask(
         FROM_HERE,
-        base::BindOnce(error_callback,
+        base::BindOnce(std::move(error_callback),
                        BluetoothRemoteGattService::GATT_ERROR_FAILED));
     return;
   }
@@ -383,32 +384,33 @@
       (GetProperties() & PROPERTY_NOTIFY)
           ? GattClientCharacteristicConfigurationDescriptorValue_Notify
           : GattClientCharacteristicConfigurationDescriptorValue_Indicate,
-      callback, error_callback);
+      callback, std::move(error_callback));
 }
 
 void BluetoothRemoteGattCharacteristicWinrt::UnsubscribeFromNotifications(
     BluetoothRemoteGattDescriptor* ccc_descriptor,
     const base::Closure& callback,
-    const ErrorCallback& error_callback) {
+    ErrorCallback error_callback) {
+  auto repeating_error_callback =
+      base::AdaptCallbackForRepeating(std::move(error_callback));
+  base::OnceClosure success_callback = base::BindOnce(
+      [](base::WeakPtr<BluetoothRemoteGattCharacteristicWinrt> characteristic,
+         base::OnceClosure callback, ErrorCallback error_callback) {
+        if (characteristic && !characteristic->RemoveValueChangedHandler()) {
+          std::move(error_callback)
+              .Run(BluetoothGattService::GATT_ERROR_FAILED);
+          return;
+        }
+
+        std::move(callback).Run();
+      },
+      weak_ptr_factory_.GetWeakPtr(), callback, repeating_error_callback);
   WriteCccDescriptor(
       GattClientCharacteristicConfigurationDescriptorValue_None,
-      // Wrap the success and error callbacks in a lambda, so that we can notify
-      // callers whether removing the event handler succeeded after the
-      // descriptor has been written to.
-      base::BindOnce(
-          [](base::WeakPtr<BluetoothRemoteGattCharacteristicWinrt>
-                 characteristic,
-             base::OnceClosure callback, ErrorCallback error_callback) {
-            if (characteristic &&
-                !characteristic->RemoveValueChangedHandler()) {
-              error_callback.Run(BluetoothGattService::GATT_ERROR_FAILED);
-              return;
-            }
-
-            std::move(callback).Run();
-          },
-          weak_ptr_factory_.GetWeakPtr(), callback, error_callback),
-      error_callback);
+      // Wrap the success and error callbacks in a lambda, so that we can
+      // notify callers whether removing the event handler succeeded after
+      // the descriptor has been written to.
+      std::move(success_callback), repeating_error_callback);
 }
 
 BluetoothRemoteGattCharacteristicWinrt::PendingReadCallbacks::
@@ -446,7 +448,7 @@
 void BluetoothRemoteGattCharacteristicWinrt::WriteCccDescriptor(
     GattClientCharacteristicConfigurationDescriptorValue value,
     base::OnceClosure callback,
-    const ErrorCallback& error_callback) {
+    ErrorCallback error_callback) {
   DCHECK(!pending_notification_callbacks_);
   ComPtr<IGattCharacteristic3> characteristic_3;
   HRESULT hr = characteristic_.As(&characteristic_3);
@@ -455,7 +457,7 @@
             << logging::SystemErrorCodeToString(hr);
     base::ThreadTaskRunnerHandle::Get()->PostTask(
         FROM_HERE,
-        base::BindOnce(error_callback,
+        base::BindOnce(std::move(error_callback),
                        BluetoothRemoteGattService::GATT_ERROR_FAILED));
     return;
   }
@@ -471,7 +473,7 @@
             << logging::SystemErrorCodeToString(hr);
     base::ThreadTaskRunnerHandle::Get()->PostTask(
         FROM_HERE,
-        base::BindOnce(error_callback,
+        base::BindOnce(std::move(error_callback),
                        BluetoothRemoteGattService::GATT_ERROR_FAILED));
     return;
   }
@@ -487,14 +489,14 @@
             << logging::SystemErrorCodeToString(hr);
     base::ThreadTaskRunnerHandle::Get()->PostTask(
         FROM_HERE,
-        base::BindOnce(error_callback,
+        base::BindOnce(std::move(error_callback),
                        BluetoothRemoteGattService::GATT_ERROR_FAILED));
     return;
   }
 
   pending_notification_callbacks_ =
       std::make_unique<PendingNotificationCallbacks>(std::move(callback),
-                                                     error_callback);
+                                                     std::move(error_callback));
 }
 
 void BluetoothRemoteGattCharacteristicWinrt::OnReadValue(
@@ -503,8 +505,8 @@
   auto pending_read_callbacks = std::move(pending_read_callbacks_);
 
   if (!read_result) {
-    pending_read_callbacks->error_callback.Run(
-        BluetoothGattService::GATT_ERROR_FAILED);
+    std::move(pending_read_callbacks->error_callback)
+        .Run(BluetoothGattService::GATT_ERROR_FAILED);
     return;
   }
 
@@ -513,8 +515,8 @@
   if (FAILED(hr)) {
     VLOG(2) << "Getting GATT Communication Status failed: "
             << logging::SystemErrorCodeToString(hr);
-    pending_read_callbacks->error_callback.Run(
-        BluetoothGattService::GATT_ERROR_FAILED);
+    std::move(pending_read_callbacks->error_callback)
+        .Run(BluetoothGattService::GATT_ERROR_FAILED);
     return;
   }
 
@@ -525,13 +527,14 @@
     if (FAILED(hr)) {
       VLOG(2) << "As IGattReadResult2 failed: "
               << logging::SystemErrorCodeToString(hr);
-      pending_read_callbacks->error_callback.Run(
-          BluetoothGattService::GATT_ERROR_FAILED);
+      std::move(pending_read_callbacks->error_callback)
+          .Run(BluetoothGattService::GATT_ERROR_FAILED);
       return;
     }
 
-    pending_read_callbacks->error_callback.Run(
-        BluetoothRemoteGattServiceWinrt::GetGattErrorCode(read_result_2.Get()));
+    std::move(pending_read_callbacks->error_callback)
+        .Run(BluetoothRemoteGattServiceWinrt::GetGattErrorCode(
+            read_result_2.Get()));
     return;
   }
 
@@ -540,8 +543,8 @@
   if (FAILED(hr)) {
     VLOG(2) << "Getting Characteristic Value failed: "
             << logging::SystemErrorCodeToString(hr);
-    pending_read_callbacks->error_callback.Run(
-        BluetoothGattService::GATT_ERROR_FAILED);
+    std::move(pending_read_callbacks->error_callback)
+        .Run(BluetoothGattService::GATT_ERROR_FAILED);
     return;
   }
 
@@ -551,8 +554,8 @@
   if (FAILED(hr)) {
     VLOG(2) << "Getting Pointer To Buffer Data failed: "
             << logging::SystemErrorCodeToString(hr);
-    pending_read_callbacks->error_callback.Run(
-        BluetoothGattService::GATT_ERROR_FAILED);
+    std::move(pending_read_callbacks->error_callback)
+        .Run(BluetoothGattService::GATT_ERROR_FAILED);
     return;
   }
 
@@ -576,7 +579,8 @@
     ComPtr<IGattWriteResult> write_result,
     std::unique_ptr<PendingWriteCallbacks> callbacks) {
   if (!write_result) {
-    callbacks->error_callback.Run(BluetoothGattService::GATT_ERROR_FAILED);
+    std::move(callbacks->error_callback)
+        .Run(BluetoothGattService::GATT_ERROR_FAILED);
     return;
   }
 
@@ -585,14 +589,16 @@
   if (FAILED(hr)) {
     VLOG(2) << "Getting GATT Communication Status failed: "
             << logging::SystemErrorCodeToString(hr);
-    callbacks->error_callback.Run(BluetoothGattService::GATT_ERROR_FAILED);
+    std::move(callbacks->error_callback)
+        .Run(BluetoothGattService::GATT_ERROR_FAILED);
     return;
   }
 
   if (status != GattCommunicationStatus_Success) {
     VLOG(2) << "Unexpected GattCommunicationStatus: " << status;
-    callbacks->error_callback.Run(
-        BluetoothRemoteGattServiceWinrt::GetGattErrorCode(write_result.Get()));
+    std::move(callbacks->error_callback)
+        .Run(BluetoothRemoteGattServiceWinrt::GetGattErrorCode(
+            write_result.Get()));
     return;
   }
 
diff --git a/device/bluetooth/bluetooth_remote_gatt_characteristic_winrt.h b/device/bluetooth/bluetooth_remote_gatt_characteristic_winrt.h
index b94014a1..294fe05 100644
--- a/device/bluetooth/bluetooth_remote_gatt_characteristic_winrt.h
+++ b/device/bluetooth/bluetooth_remote_gatt_characteristic_winrt.h
@@ -46,10 +46,10 @@
   const std::vector<uint8_t>& GetValue() const override;
   BluetoothRemoteGattService* GetService() const override;
   void ReadRemoteCharacteristic(ValueCallback callback,
-                                const ErrorCallback& error_callback) override;
+                                ErrorCallback error_callback) override;
   void WriteRemoteCharacteristic(const std::vector<uint8_t>& value,
                                  base::OnceClosure callback,
-                                 const ErrorCallback& error_callback) override;
+                                 ErrorCallback error_callback) override;
   bool WriteWithoutResponse(base::span<const uint8_t> value) override;
 
   void UpdateDescriptors(BluetoothGattDiscovererWinrt* gatt_discoverer);
@@ -62,11 +62,11 @@
   // BluetoothRemoteGattCharacteristic:
   void SubscribeToNotifications(BluetoothRemoteGattDescriptor* ccc_descriptor,
                                 const base::Closure& callback,
-                                const ErrorCallback& error_callback) override;
+                                ErrorCallback error_callback) override;
   void UnsubscribeFromNotifications(
       BluetoothRemoteGattDescriptor* ccc_descriptor,
       const base::Closure& callback,
-      const ErrorCallback& error_callback) override;
+      ErrorCallback error_callback) override;
 
  private:
   struct PendingReadCallbacks {
@@ -101,7 +101,7 @@
       ABI::Windows::Devices::Bluetooth::GenericAttributeProfile::
           GattClientCharacteristicConfigurationDescriptorValue value,
       base::OnceClosure callback,
-      const ErrorCallback& error_callback);
+      ErrorCallback error_callback);
 
   void OnReadValue(Microsoft::WRL::ComPtr<
                    ABI::Windows::Devices::Bluetooth::GenericAttributeProfile::
diff --git a/device/bluetooth/bluetooth_task_manager_win.cc b/device/bluetooth/bluetooth_task_manager_win.cc
index 88fb060..82804b8 100644
--- a/device/bluetooth/bluetooth_task_manager_win.cc
+++ b/device/bluetooth/bluetooth_task_manager_win.cc
@@ -883,7 +883,7 @@
     base::FilePath service_path,
     BTH_LE_GATT_CHARACTERISTIC characteristic,
     BTH_LE_GATT_DESCRIPTOR ccc_descriptor,
-    const GattEventRegistrationCallback& callback,
+    GattEventRegistrationCallback callback,
     const GattCharacteristicValueChangedCallback& registered_callback) {
   DCHECK(bluetooth_task_runner_->RunsTasksInCurrentSequence());
   BLUETOOTH_GATT_EVENT_HANDLE win_event_handle = NULL;
@@ -926,8 +926,8 @@
         std::move(registration);
   }
 
-  ui_task_runner_->PostTask(FROM_HERE,
-                            base::BindOnce(callback, user_event_handle, hr));
+  ui_task_runner_->PostTask(
+      FROM_HERE, base::BindOnce(std::move(callback), user_event_handle, hr));
 }
 
 void BluetoothTaskManagerWin::UnregisterGattCharacteristicValueChangedEvent(
@@ -993,15 +993,15 @@
     const base::FilePath& service_path,
     const PBTH_LE_GATT_CHARACTERISTIC characteristic,
     const PBTH_LE_GATT_DESCRIPTOR ccc_descriptor,
-    const GattEventRegistrationCallback& callback,
+    GattEventRegistrationCallback callback,
     const GattCharacteristicValueChangedCallback& registered_callback) {
   DCHECK(ui_task_runner_->RunsTasksInCurrentSequence());
   bluetooth_task_runner_->PostTask(
       FROM_HERE,
       base::BindOnce(
           &BluetoothTaskManagerWin::RegisterGattCharacteristicValueChangedEvent,
-          this, service_path, *characteristic, *ccc_descriptor, callback,
-          registered_callback));
+          this, service_path, *characteristic, *ccc_descriptor,
+          std::move(callback), registered_callback));
 }
 
 void BluetoothTaskManagerWin::PostUnregisterGattCharacteristicValueChangedEvent(
diff --git a/device/bluetooth/bluetooth_task_manager_win.h b/device/bluetooth/bluetooth_task_manager_win.h
index 7dbbac1..de693e2 100644
--- a/device/bluetooth/bluetooth_task_manager_win.h
+++ b/device/bluetooth/bluetooth_task_manager_win.h
@@ -151,7 +151,8 @@
       ReadGattCharacteristicValueCallback;
   typedef base::Callback<void(std::unique_ptr<std::vector<uint8_t>>)>
       GattCharacteristicValueChangedCallback;
-  typedef base::Callback<void(PVOID, HRESULT)> GattEventRegistrationCallback;
+  using GattEventRegistrationCallback =
+      base::OnceCallback<void(PVOID, HRESULT)>;
 
   // Get all included characteristics of a given service. The service is
   // uniquely identified by its |uuid| and |attribute_handle| with service
@@ -196,7 +197,7 @@
       const base::FilePath& service_path,
       const PBTH_LE_GATT_CHARACTERISTIC characteristic,
       const PBTH_LE_GATT_DESCRIPTOR ccc_descriptor,
-      const GattEventRegistrationCallback& callback,
+      GattEventRegistrationCallback callback,
       const GattCharacteristicValueChangedCallback& registered_callback);
 
   // Post a task to unregister from value change notifications. |event_handle|
@@ -323,7 +324,7 @@
       base::FilePath service_path,
       BTH_LE_GATT_CHARACTERISTIC characteristic,
       BTH_LE_GATT_DESCRIPTOR ccc_descriptor,
-      const GattEventRegistrationCallback& callback,
+      GattEventRegistrationCallback callback,
       const GattCharacteristicValueChangedCallback& registered_callback);
   void UnregisterGattCharacteristicValueChangedEvent(PVOID event_handle);
 
diff --git a/device/bluetooth/bluez/bluetooth_remote_gatt_characteristic_bluez.cc b/device/bluetooth/bluez/bluetooth_remote_gatt_characteristic_bluez.cc
index c186feb..dc30512 100644
--- a/device/bluetooth/bluez/bluetooth_remote_gatt_characteristic_bluez.cc
+++ b/device/bluetooth/bluez/bluetooth_remote_gatt_characteristic_bluez.cc
@@ -154,7 +154,7 @@
 
 void BluetoothRemoteGattCharacteristicBlueZ::ReadRemoteCharacteristic(
     ValueCallback callback,
-    const ErrorCallback& error_callback) {
+    ErrorCallback error_callback) {
   VLOG(1) << "Sending GATT characteristic read request to characteristic: "
           << GetIdentifier() << ", UUID: " << GetUUID().canonical_value()
           << ".";
@@ -166,14 +166,15 @@
       ->GetBluetoothGattCharacteristicClient()
       ->ReadValue(
           object_path(), std::move(callback),
-          base::Bind(&BluetoothRemoteGattCharacteristicBlueZ::OnReadError,
-                     weak_ptr_factory_.GetWeakPtr(), error_callback));
+          base::BindOnce(&BluetoothRemoteGattCharacteristicBlueZ::OnReadError,
+                         weak_ptr_factory_.GetWeakPtr(),
+                         std::move(error_callback)));
 }
 
 void BluetoothRemoteGattCharacteristicBlueZ::WriteRemoteCharacteristic(
     const std::vector<uint8_t>& value,
     base::OnceClosure callback,
-    const ErrorCallback& error_callback) {
+    ErrorCallback error_callback) {
   VLOG(1) << "Sending GATT characteristic write request to characteristic: "
           << GetIdentifier() << ", UUID: " << GetUUID().canonical_value()
           << ", with value: " << value << ".";
@@ -182,15 +183,16 @@
       ->GetBluetoothGattCharacteristicClient()
       ->WriteValue(
           object_path(), value, std::move(callback),
-          base::Bind(&BluetoothRemoteGattCharacteristicBlueZ::OnWriteError,
-                     weak_ptr_factory_.GetWeakPtr(), error_callback));
+          base::BindOnce(&BluetoothRemoteGattCharacteristicBlueZ::OnWriteError,
+                         weak_ptr_factory_.GetWeakPtr(),
+                         std::move(error_callback)));
 }
 
 #if defined(OS_CHROMEOS)
 void BluetoothRemoteGattCharacteristicBlueZ::PrepareWriteRemoteCharacteristic(
     const std::vector<uint8_t>& value,
     base::OnceClosure callback,
-    const ErrorCallback& error_callback) {
+    ErrorCallback error_callback) {
   VLOG(1) << "Sending GATT characteristic prepare write request to "
           << "characteristic: " << GetIdentifier()
           << ", UUID: " << GetUUID().canonical_value()
@@ -200,8 +202,9 @@
       ->GetBluetoothGattCharacteristicClient()
       ->PrepareWriteValue(
           object_path(), value, std::move(callback),
-          base::Bind(&BluetoothRemoteGattCharacteristicBlueZ::OnWriteError,
-                     weak_ptr_factory_.GetWeakPtr(), error_callback));
+          base::BindOnce(&BluetoothRemoteGattCharacteristicBlueZ::OnWriteError,
+                         weak_ptr_factory_.GetWeakPtr(),
+                         std::move(error_callback)));
 }
 #endif
 
@@ -211,7 +214,7 @@
     NotificationType notification_type,
 #endif
     const base::Closure& callback,
-    const ErrorCallback& error_callback) {
+    ErrorCallback error_callback) {
   bluez::BluezDBusManager::Get()
       ->GetBluetoothGattCharacteristicClient()
       ->StartNotify(
@@ -222,15 +225,15 @@
           base::Bind(
               &BluetoothRemoteGattCharacteristicBlueZ::OnStartNotifySuccess,
               weak_ptr_factory_.GetWeakPtr(), callback),
-          base::Bind(
+          base::BindOnce(
               &BluetoothRemoteGattCharacteristicBlueZ::OnStartNotifyError,
-              weak_ptr_factory_.GetWeakPtr(), error_callback));
+              weak_ptr_factory_.GetWeakPtr(), std::move(error_callback)));
 }
 
 void BluetoothRemoteGattCharacteristicBlueZ::UnsubscribeFromNotifications(
     device::BluetoothRemoteGattDescriptor* ccc_descriptor,
     const base::Closure& callback,
-    const ErrorCallback& error_callback) {
+    ErrorCallback error_callback) {
   bluez::BluezDBusManager::Get()
       ->GetBluetoothGattCharacteristicClient()
       ->StopNotify(
@@ -334,14 +337,15 @@
 }
 
 void BluetoothRemoteGattCharacteristicBlueZ::OnStartNotifyError(
-    const ErrorCallback& error_callback,
+    ErrorCallback error_callback,
     const std::string& error_name,
     const std::string& error_message) {
   VLOG(1) << "Failed to start notifications from characteristic: "
           << object_path().value() << ": " << error_name << ", "
           << error_message;
-  error_callback.Run(
-      BluetoothRemoteGattServiceBlueZ::DBusErrorToServiceError(error_name));
+  std::move(error_callback)
+      .Run(
+          BluetoothRemoteGattServiceBlueZ::DBusErrorToServiceError(error_name));
 }
 
 void BluetoothRemoteGattCharacteristicBlueZ::OnStopNotifySuccess(
@@ -363,25 +367,25 @@
 }
 
 void BluetoothRemoteGattCharacteristicBlueZ::OnReadError(
-    const ErrorCallback& error_callback,
+    ErrorCallback error_callback,
     const std::string& error_name,
     const std::string& error_message) {
   VLOG(1) << "Operation failed: " << error_name
           << ", message: " << error_message;
   --num_of_characteristic_value_read_in_progress_;
   DCHECK_GE(num_of_characteristic_value_read_in_progress_, 0);
-  error_callback.Run(
-      BluetoothGattServiceBlueZ::DBusErrorToServiceError(error_name));
+  std::move(error_callback)
+      .Run(BluetoothGattServiceBlueZ::DBusErrorToServiceError(error_name));
 }
 
 void BluetoothRemoteGattCharacteristicBlueZ::OnWriteError(
-    const ErrorCallback& error_callback,
+    ErrorCallback error_callback,
     const std::string& error_name,
     const std::string& error_message) {
   VLOG(1) << "Operation failed: " << error_name
           << ", message: " << error_message;
-  error_callback.Run(
-      BluetoothGattServiceBlueZ::DBusErrorToServiceError(error_name));
+  std::move(error_callback)
+      .Run(BluetoothGattServiceBlueZ::DBusErrorToServiceError(error_name));
 }
 
 }  // namespace bluez
diff --git a/device/bluetooth/bluez/bluetooth_remote_gatt_characteristic_bluez.h b/device/bluetooth/bluez/bluetooth_remote_gatt_characteristic_bluez.h
index 5f25c36..96ce7bd2 100644
--- a/device/bluetooth/bluez/bluetooth_remote_gatt_characteristic_bluez.h
+++ b/device/bluetooth/bluez/bluetooth_remote_gatt_characteristic_bluez.h
@@ -55,15 +55,14 @@
   device::BluetoothRemoteGattService* GetService() const override;
   bool IsNotifying() const override;
   void ReadRemoteCharacteristic(ValueCallback callback,
-                                const ErrorCallback& error_callback) override;
+                                ErrorCallback error_callback) override;
   void WriteRemoteCharacteristic(const std::vector<uint8_t>& value,
                                  base::OnceClosure callback,
-                                 const ErrorCallback& error_callback) override;
+                                 ErrorCallback error_callback) override;
 #if defined(OS_CHROMEOS)
-  void PrepareWriteRemoteCharacteristic(
-      const std::vector<uint8_t>& value,
-      base::OnceClosure callback,
-      const ErrorCallback& error_callback) override;
+  void PrepareWriteRemoteCharacteristic(const std::vector<uint8_t>& value,
+                                        base::OnceClosure callback,
+                                        ErrorCallback error_callback) override;
 #endif
 
  protected:
@@ -72,17 +71,17 @@
       device::BluetoothRemoteGattDescriptor* ccc_descriptor,
       NotificationType notification_type,
       const base::Closure& callback,
-      const ErrorCallback& error_callback) override;
+      ErrorCallback error_callback) override;
 #else
   void SubscribeToNotifications(
       device::BluetoothRemoteGattDescriptor* ccc_descriptor,
       const base::Closure& callback,
-      const ErrorCallback& error_callback) override;
+      ErrorCallback error_callback) override;
 #endif
   void UnsubscribeFromNotifications(
       device::BluetoothRemoteGattDescriptor* ccc_descriptor,
       const base::Closure& callback,
-      const ErrorCallback& error_callback) override;
+      ErrorCallback error_callback) override;
 
  private:
   friend class BluetoothRemoteGattServiceBlueZ;
@@ -103,7 +102,7 @@
 
   // Called by dbus:: on unsuccessful completion of a request to start
   // notifications.
-  void OnStartNotifyError(const ErrorCallback& error_callback,
+  void OnStartNotifyError(ErrorCallback error_callback,
                           const std::string& error_name,
                           const std::string& error_message);
 
@@ -119,13 +118,13 @@
 
   // Called by dbus:: on unsuccessful completion of a request to read
   // the characteristic value.
-  void OnReadError(const ErrorCallback& error_callback,
+  void OnReadError(ErrorCallback error_callback,
                    const std::string& error_name,
                    const std::string& error_message);
 
   // Called by dbus:: on unsuccessful completion of a request to write
   // the characteristic value.
-  void OnWriteError(const ErrorCallback& error_callback,
+  void OnWriteError(ErrorCallback error_callback,
                     const std::string& error_name,
                     const std::string& error_message);
 
diff --git a/device/bluetooth/cast/bluetooth_remote_gatt_characteristic_cast.cc b/device/bluetooth/cast/bluetooth_remote_gatt_characteristic_cast.cc
index 616d39b..b8f5d19 100644
--- a/device/bluetooth/cast/bluetooth_remote_gatt_characteristic_cast.cc
+++ b/device/bluetooth/cast/bluetooth_remote_gatt_characteristic_cast.cc
@@ -77,12 +77,12 @@
 // If |success| is true, run |callback|. Otherwise run |error_callback|.
 void OnSubscribeOrUnsubscribe(
     const base::Closure& callback,
-    const BluetoothGattCharacteristic::ErrorCallback& error_callback,
+    BluetoothGattCharacteristic::ErrorCallback error_callback,
     bool success) {
   if (success)
     callback.Run();
   else
-    error_callback.Run(BluetoothGattService::GATT_ERROR_FAILED);
+    std::move(error_callback).Run(BluetoothGattService::GATT_ERROR_FAILED);
 }
 
 }  // namespace
@@ -134,28 +134,29 @@
 
 void BluetoothRemoteGattCharacteristicCast::ReadRemoteCharacteristic(
     ValueCallback callback,
-    const ErrorCallback& error_callback) {
+    ErrorCallback error_callback) {
   remote_characteristic_->Read(base::BindOnce(
       &BluetoothRemoteGattCharacteristicCast::OnReadRemoteCharacteristic,
-      weak_factory_.GetWeakPtr(), std::move(callback), error_callback));
+      weak_factory_.GetWeakPtr(), std::move(callback),
+      std::move(error_callback)));
 }
 
 void BluetoothRemoteGattCharacteristicCast::WriteRemoteCharacteristic(
     const std::vector<uint8_t>& value,
     base::OnceClosure callback,
-    const ErrorCallback& error_callback) {
+    ErrorCallback error_callback) {
   remote_characteristic_->Write(
       value,
       base::BindOnce(
           &BluetoothRemoteGattCharacteristicCast::OnWriteRemoteCharacteristic,
           weak_factory_.GetWeakPtr(), value, std::move(callback),
-          error_callback));
+          std::move(error_callback)));
 }
 
 void BluetoothRemoteGattCharacteristicCast::SubscribeToNotifications(
     BluetoothRemoteGattDescriptor* ccc_descriptor,
     const base::Closure& callback,
-    const ErrorCallback& error_callback) {
+    ErrorCallback error_callback) {
   DVLOG(2) << __func__ << " " << GetIdentifier();
 
   // |remote_characteristic_| exposes a method which writes the CCCD after
@@ -164,14 +165,14 @@
   (void)ccc_descriptor;
 
   remote_characteristic_->SetRegisterNotification(
-      true,
-      base::BindOnce(&OnSubscribeOrUnsubscribe, callback, error_callback));
+      true, base::BindOnce(&OnSubscribeOrUnsubscribe, callback,
+                           std::move(error_callback)));
 }
 
 void BluetoothRemoteGattCharacteristicCast::UnsubscribeFromNotifications(
     BluetoothRemoteGattDescriptor* ccc_descriptor,
     const base::Closure& callback,
-    const ErrorCallback& error_callback) {
+    ErrorCallback error_callback) {
   DVLOG(2) << __func__ << " " << GetIdentifier();
 
   // |remote_characteristic_| exposes a method which writes the CCCD after
@@ -180,13 +181,13 @@
   (void)ccc_descriptor;
 
   remote_characteristic_->SetRegisterNotification(
-      false,
-      base::BindOnce(&OnSubscribeOrUnsubscribe, callback, error_callback));
+      false, base::BindOnce(&OnSubscribeOrUnsubscribe, callback,
+                            std::move(error_callback)));
 }
 
 void BluetoothRemoteGattCharacteristicCast::OnReadRemoteCharacteristic(
     ValueCallback callback,
-    const ErrorCallback& error_callback,
+    ErrorCallback error_callback,
     bool success,
     const std::vector<uint8_t>& result) {
   if (success) {
@@ -194,20 +195,20 @@
     std::move(callback).Run(result);
     return;
   }
-  error_callback.Run(BluetoothGattService::GATT_ERROR_FAILED);
+  std::move(error_callback).Run(BluetoothGattService::GATT_ERROR_FAILED);
 }
 
 void BluetoothRemoteGattCharacteristicCast::OnWriteRemoteCharacteristic(
     const std::vector<uint8_t>& written_value,
     base::OnceClosure callback,
-    const ErrorCallback& error_callback,
+    ErrorCallback error_callback,
     bool success) {
   if (success) {
     value_ = written_value;
     std::move(callback).Run();
     return;
   }
-  error_callback.Run(BluetoothGattService::GATT_ERROR_FAILED);
+  std::move(error_callback).Run(BluetoothGattService::GATT_ERROR_FAILED);
 }
 
 }  // namespace device
diff --git a/device/bluetooth/cast/bluetooth_remote_gatt_characteristic_cast.h b/device/bluetooth/cast/bluetooth_remote_gatt_characteristic_cast.h
index e585360..ff9d577 100644
--- a/device/bluetooth/cast/bluetooth_remote_gatt_characteristic_cast.h
+++ b/device/bluetooth/cast/bluetooth_remote_gatt_characteristic_cast.h
@@ -46,10 +46,10 @@
   const std::vector<uint8_t>& GetValue() const override;
   BluetoothRemoteGattService* GetService() const override;
   void ReadRemoteCharacteristic(ValueCallback callback,
-                                const ErrorCallback& error_callback) override;
+                                ErrorCallback error_callback) override;
   void WriteRemoteCharacteristic(const std::vector<uint8_t>& value,
                                  base::OnceClosure callback,
-                                 const ErrorCallback& error_callback) override;
+                                 ErrorCallback error_callback) override;
 
   // Called by BluetoothAdapterCast to set the value when a new notification
   // comes in.
@@ -59,11 +59,11 @@
   // BluetoothRemoteGattCharacteristic implementation:
   void SubscribeToNotifications(BluetoothRemoteGattDescriptor* ccc_descriptor,
                                 const base::Closure& callback,
-                                const ErrorCallback& error_callback) override;
+                                ErrorCallback error_callback) override;
   void UnsubscribeFromNotifications(
       BluetoothRemoteGattDescriptor* ccc_descriptor,
       const base::Closure& callback,
-      const ErrorCallback& error_callback) override;
+      ErrorCallback error_callback) override;
 
   // Called when the remote characteristic has been read or the operation has
   // failed. If the former, |success| will be true, and |result| will be
@@ -71,7 +71,7 @@
   // |result|. If |success| is false, |result| is ignored and |error_callback|
   // is run.
   void OnReadRemoteCharacteristic(ValueCallback callback,
-                                  const ErrorCallback& error_callback,
+                                  ErrorCallback error_callback,
                                   bool success,
                                   const std::vector<uint8_t>& result);
 
@@ -81,7 +81,7 @@
   // If successful, |value_| will be updated.
   void OnWriteRemoteCharacteristic(const std::vector<uint8_t>& written_value,
                                    base::OnceClosure callback,
-                                   const ErrorCallback& error_callback,
+                                   ErrorCallback error_callback,
                                    bool success);
 
   BluetoothRemoteGattServiceCast* const service_;
diff --git a/device/bluetooth/dbus/bluetooth_gatt_characteristic_client.cc b/device/bluetooth/dbus/bluetooth_gatt_characteristic_client.cc
index 7ea7163..55cea8a 100644
--- a/device/bluetooth/dbus/bluetooth_gatt_characteristic_client.cc
+++ b/device/bluetooth/dbus/bluetooth_gatt_characteristic_client.cc
@@ -85,11 +85,11 @@
   // BluetoothGattCharacteristicClient override.
   void ReadValue(const dbus::ObjectPath& object_path,
                  ValueCallback callback,
-                 const ErrorCallback& error_callback) override {
+                 ErrorCallback error_callback) override {
     dbus::ObjectProxy* object_proxy =
         object_manager_->GetObjectProxy(object_path);
     if (!object_proxy) {
-      error_callback.Run(kUnknownCharacteristicError, "");
+      std::move(error_callback).Run(kUnknownCharacteristicError, "");
       return;
     }
 
@@ -107,18 +107,19 @@
         base::BindOnce(&BluetoothGattCharacteristicClientImpl::OnValueSuccess,
                        weak_ptr_factory_.GetWeakPtr(), std::move(callback)),
         base::BindOnce(&BluetoothGattCharacteristicClientImpl::OnError,
-                       weak_ptr_factory_.GetWeakPtr(), error_callback));
+                       weak_ptr_factory_.GetWeakPtr(),
+                       std::move(error_callback)));
   }
 
   // BluetoothGattCharacteristicClient override.
   void WriteValue(const dbus::ObjectPath& object_path,
                   const std::vector<uint8_t>& value,
                   base::OnceClosure callback,
-                  const ErrorCallback& error_callback) override {
+                  ErrorCallback error_callback) override {
     dbus::ObjectProxy* object_proxy =
         object_manager_->GetObjectProxy(object_path);
     if (!object_proxy) {
-      error_callback.Run(kUnknownCharacteristicError, "");
+      std::move(error_callback).Run(kUnknownCharacteristicError, "");
       return;
     }
 
@@ -137,17 +138,18 @@
         base::BindOnce(&BluetoothGattCharacteristicClientImpl::OnSuccess,
                        weak_ptr_factory_.GetWeakPtr(), std::move(callback)),
         base::BindOnce(&BluetoothGattCharacteristicClientImpl::OnError,
-                       weak_ptr_factory_.GetWeakPtr(), error_callback));
+                       weak_ptr_factory_.GetWeakPtr(),
+                       std::move(error_callback)));
   }
 
   void PrepareWriteValue(const dbus::ObjectPath& object_path,
                          const std::vector<uint8_t>& value,
                          base::OnceClosure callback,
-                         const ErrorCallback& error_callback) override {
+                         ErrorCallback error_callback) override {
     dbus::ObjectProxy* object_proxy =
         object_manager_->GetObjectProxy(object_path);
     if (!object_proxy) {
-      error_callback.Run(kUnknownCharacteristicError, "");
+      std::move(error_callback).Run(kUnknownCharacteristicError, "");
       return;
     }
 
@@ -165,7 +167,8 @@
         base::BindOnce(&BluetoothGattCharacteristicClientImpl::OnSuccess,
                        weak_ptr_factory_.GetWeakPtr(), std::move(callback)),
         base::BindOnce(&BluetoothGattCharacteristicClientImpl::OnError,
-                       weak_ptr_factory_.GetWeakPtr(), error_callback));
+                       weak_ptr_factory_.GetWeakPtr(),
+                       std::move(error_callback)));
   }
 
   // BluetoothGattCharacteristicClient override.
@@ -175,11 +178,11 @@
       device::BluetoothGattCharacteristic::NotificationType notification_type,
 #endif
       const base::Closure& callback,
-      const ErrorCallback& error_callback) override {
+      ErrorCallback error_callback) override {
     dbus::ObjectProxy* object_proxy =
         object_manager_->GetObjectProxy(object_path);
     if (!object_proxy) {
-      error_callback.Run(kUnknownCharacteristicError, "");
+      std::move(error_callback).Run(kUnknownCharacteristicError, "");
       return;
     }
 
@@ -196,17 +199,18 @@
         base::BindOnce(&BluetoothGattCharacteristicClientImpl::OnSuccess,
                        weak_ptr_factory_.GetWeakPtr(), callback),
         base::BindOnce(&BluetoothGattCharacteristicClientImpl::OnError,
-                       weak_ptr_factory_.GetWeakPtr(), error_callback));
+                       weak_ptr_factory_.GetWeakPtr(),
+                       std::move(error_callback)));
   }
 
   // BluetoothGattCharacteristicClient override.
   void StopNotify(const dbus::ObjectPath& object_path,
                   const base::Closure& callback,
-                  const ErrorCallback& error_callback) override {
+                  ErrorCallback error_callback) override {
     dbus::ObjectProxy* object_proxy =
         object_manager_->GetObjectProxy(object_path);
     if (!object_proxy) {
-      error_callback.Run(kUnknownCharacteristicError, "");
+      std::move(error_callback).Run(kUnknownCharacteristicError, "");
       return;
     }
 
@@ -219,7 +223,8 @@
         base::BindOnce(&BluetoothGattCharacteristicClientImpl::OnSuccess,
                        weak_ptr_factory_.GetWeakPtr(), callback),
         base::BindOnce(&BluetoothGattCharacteristicClientImpl::OnError,
-                       weak_ptr_factory_.GetWeakPtr(), error_callback));
+                       weak_ptr_factory_.GetWeakPtr(),
+                       std::move(error_callback)));
   }
 
   // dbus::ObjectManager::Interface override.
@@ -302,8 +307,7 @@
   }
 
   // Called when a response for a failed method call is received.
-  void OnError(const ErrorCallback& error_callback,
-               dbus::ErrorResponse* response) {
+  void OnError(ErrorCallback error_callback, dbus::ErrorResponse* response) {
     // Error response has optional error message argument.
     std::string error_name;
     std::string error_message;
@@ -315,7 +319,7 @@
       error_name = kNoResponseError;
       error_message = "";
     }
-    error_callback.Run(error_name, error_message);
+    std::move(error_callback).Run(error_name, error_message);
   }
 
   dbus::ObjectManager* object_manager_;
diff --git a/device/bluetooth/dbus/bluetooth_gatt_characteristic_client.h b/device/bluetooth/dbus/bluetooth_gatt_characteristic_client.h
index 43f2234..1f1a46c 100644
--- a/device/bluetooth/dbus/bluetooth_gatt_characteristic_client.h
+++ b/device/bluetooth/dbus/bluetooth_gatt_characteristic_client.h
@@ -76,8 +76,9 @@
   };
 
   // Callbacks used to report the result of asynchronous methods.
-  typedef base::Callback<void(const std::string& error_name,
-                              const std::string& error_message)> ErrorCallback;
+  using ErrorCallback =
+      base::OnceCallback<void(const std::string& error_name,
+                              const std::string& error_message)>;
   using ValueCallback =
       base::OnceCallback<void(const std::vector<uint8_t>& value)>;
 
@@ -101,7 +102,7 @@
   // invokes |error_callback|.
   virtual void ReadValue(const dbus::ObjectPath& object_path,
                          ValueCallback callback,
-                         const ErrorCallback& error_callback) = 0;
+                         ErrorCallback error_callback) = 0;
 
   // Issues a request to write the value of GATT characteristic with object path
   // |object_path| with value |value|. Invokes |callback| on success and
@@ -109,7 +110,7 @@
   virtual void WriteValue(const dbus::ObjectPath& object_path,
                           const std::vector<uint8_t>& value,
                           base::OnceClosure callback,
-                          const ErrorCallback& error_callback) = 0;
+                          ErrorCallback error_callback) = 0;
 
   // Issues a request to prepare write the value of GATT characteristic with
   // object path |object_path| with value |value|.
@@ -117,7 +118,7 @@
   virtual void PrepareWriteValue(const dbus::ObjectPath& object_path,
                                  const std::vector<uint8_t>& value,
                                  base::OnceClosure callback,
-                                 const ErrorCallback& error_callback) = 0;
+                                 ErrorCallback error_callback) = 0;
 
   // Starts a notification session from this characteristic with object path
   // |object_path| if it supports value notifications or indications. Invokes
@@ -127,11 +128,11 @@
       const dbus::ObjectPath& object_path,
       device::BluetoothGattCharacteristic::NotificationType notification_type,
       const base::Closure& callback,
-      const ErrorCallback& error_callback) = 0;
+      ErrorCallback error_callback) = 0;
 #else
   virtual void StartNotify(const dbus::ObjectPath& object_path,
                            const base::Closure& callback,
-                           const ErrorCallback& error_callback) = 0;
+                           ErrorCallback error_callback) = 0;
 #endif
 
   // Cancels any previous StartNotify transaction for characteristic with
@@ -139,7 +140,7 @@
   // |error_callback| on failure.
   virtual void StopNotify(const dbus::ObjectPath& object_path,
                           const base::Closure& callback,
-                          const ErrorCallback& error_callback) = 0;
+                          ErrorCallback error_callback) = 0;
 
   // Creates the instance.
   static BluetoothGattCharacteristicClient* Create();
diff --git a/device/bluetooth/dbus/fake_bluetooth_gatt_characteristic_client.cc b/device/bluetooth/dbus/fake_bluetooth_gatt_characteristic_client.cc
index 52e9a36..0b99f643 100644
--- a/device/bluetooth/dbus/fake_bluetooth_gatt_characteristic_client.cc
+++ b/device/bluetooth/dbus/fake_bluetooth_gatt_characteristic_client.cc
@@ -136,32 +136,35 @@
 void FakeBluetoothGattCharacteristicClient::ReadValue(
     const dbus::ObjectPath& object_path,
     ValueCallback callback,
-    const ErrorCallback& error_callback) {
+    ErrorCallback error_callback) {
   if (!authenticated_) {
-    error_callback.Run(bluetooth_gatt_service::kErrorNotPaired, "Please login");
+    std::move(error_callback)
+        .Run(bluetooth_gatt_service::kErrorNotPaired, "Please login");
     return;
   }
 
   if (!authorized_) {
-    error_callback.Run(bluetooth_gatt_service::kErrorNotAuthorized,
-                       "Authorize first");
+    std::move(error_callback)
+        .Run(bluetooth_gatt_service::kErrorNotAuthorized, "Authorize first");
     return;
   }
 
   if (object_path.value() == heart_rate_control_point_path_) {
-    error_callback.Run(bluetooth_gatt_service::kErrorNotPermitted,
-                       "Reads of this value are not allowed");
+    std::move(error_callback)
+        .Run(bluetooth_gatt_service::kErrorNotPermitted,
+             "Reads of this value are not allowed");
     return;
   }
 
   if (object_path.value() == heart_rate_measurement_path_) {
-    error_callback.Run(bluetooth_gatt_service::kErrorNotSupported,
-                       "Action not supported on this characteristic");
+    std::move(error_callback)
+        .Run(bluetooth_gatt_service::kErrorNotSupported,
+             "Action not supported on this characteristic");
     return;
   }
 
   if (object_path.value() != body_sensor_location_path_) {
-    error_callback.Run(kUnknownCharacteristicError, "");
+    std::move(error_callback).Run(kUnknownCharacteristicError, "");
     return;
   }
 
@@ -169,8 +172,9 @@
       action_extra_requests_.end()) {
     DelayedCallback* delayed = action_extra_requests_["ReadValue"];
     delayed->delay_--;
-    error_callback.Run(bluetooth_gatt_service::kErrorInProgress,
-                       "Another read is currenty in progress");
+    std::move(error_callback)
+        .Run(bluetooth_gatt_service::kErrorInProgress,
+             "Another read is currenty in progress");
     if (delayed->delay_ == 0) {
       std::move(delayed->callback_).Run();
       action_extra_requests_.erase("ReadValue");
@@ -181,8 +185,8 @@
 
   base::OnceClosure completed_callback;
   if (!IsHeartRateVisible()) {
-    completed_callback =
-        base::Bind(error_callback, kUnknownCharacteristicError, "");
+    completed_callback = base::BindOnce(std::move(error_callback),
+                                        kUnknownCharacteristicError, "");
   } else {
     std::vector<uint8_t> value = {0x06};  // Location is "foot".
     completed_callback = base::BindOnce(
@@ -204,32 +208,35 @@
     const dbus::ObjectPath& object_path,
     const std::vector<uint8_t>& value,
     base::OnceClosure callback,
-    const ErrorCallback& error_callback) {
+    ErrorCallback error_callback) {
   if (!authenticated_) {
-    error_callback.Run(bluetooth_gatt_service::kErrorNotPaired, "Please login");
+    std::move(error_callback)
+        .Run(bluetooth_gatt_service::kErrorNotPaired, "Please login");
     return;
   }
 
   if (!authorized_) {
-    error_callback.Run(bluetooth_gatt_service::kErrorNotAuthorized,
-                       "Authorize first");
+    std::move(error_callback)
+        .Run(bluetooth_gatt_service::kErrorNotAuthorized, "Authorize first");
     return;
   }
 
   if (!IsHeartRateVisible()) {
-    error_callback.Run(kUnknownCharacteristicError, "");
+    std::move(error_callback).Run(kUnknownCharacteristicError, "");
     return;
   }
 
   if (object_path.value() == heart_rate_measurement_path_) {
-    error_callback.Run(bluetooth_gatt_service::kErrorNotSupported,
-                       "Action not supported on this characteristic");
+    std::move(error_callback)
+        .Run(bluetooth_gatt_service::kErrorNotSupported,
+             "Action not supported on this characteristic");
     return;
   }
 
   if (object_path.value() != heart_rate_control_point_path_) {
-    error_callback.Run(bluetooth_gatt_service::kErrorNotPermitted,
-                       "Writes of this value are not allowed");
+    std::move(error_callback)
+        .Run(bluetooth_gatt_service::kErrorNotPermitted,
+             "Writes of this value are not allowed");
     return;
   }
 
@@ -238,8 +245,9 @@
       action_extra_requests_.end()) {
     DelayedCallback* delayed = action_extra_requests_["WriteValue"];
     delayed->delay_--;
-    error_callback.Run(bluetooth_gatt_service::kErrorInProgress,
-                       "Another write is in progress");
+    std::move(error_callback)
+        .Run(bluetooth_gatt_service::kErrorInProgress,
+             "Another write is in progress");
     if (delayed->delay_ == 0) {
       std::move(delayed->callback_).Run();
       action_extra_requests_.erase("WriteValue");
@@ -249,13 +257,14 @@
   }
   base::OnceClosure completed_callback;
   if (value.size() != 1) {
-    completed_callback = base::Bind(
-        error_callback, bluetooth_gatt_service::kErrorInvalidValueLength,
-        "Invalid length for write");
-  } else if (value[0] > 1) {
     completed_callback =
-        base::Bind(error_callback, bluetooth_gatt_service::kErrorFailed,
-                   "Invalid value given for write");
+        base::BindOnce(std::move(error_callback),
+                       bluetooth_gatt_service::kErrorInvalidValueLength,
+                       "Invalid length for write");
+  } else if (value[0] > 1) {
+    completed_callback = base::BindOnce(std::move(error_callback),
+                                        bluetooth_gatt_service::kErrorFailed,
+                                        "Invalid value given for write");
   } else if (value[0] == 1) {
     // TODO(jamuraa): make this happen when the callback happens
     calories_burned_ = 0;
@@ -275,32 +284,35 @@
     const dbus::ObjectPath& object_path,
     const std::vector<uint8_t>& value,
     base::OnceClosure callback,
-    const ErrorCallback& error_callback) {
+    ErrorCallback error_callback) {
   if (!authenticated_) {
-    error_callback.Run(bluetooth_gatt_service::kErrorNotPaired, "Please login");
+    std::move(error_callback)
+        .Run(bluetooth_gatt_service::kErrorNotPaired, "Please login");
     return;
   }
 
   if (!authorized_) {
-    error_callback.Run(bluetooth_gatt_service::kErrorNotAuthorized,
-                       "Authorize first");
+    std::move(error_callback)
+        .Run(bluetooth_gatt_service::kErrorNotAuthorized, "Authorize first");
     return;
   }
 
   if (!IsHeartRateVisible()) {
-    error_callback.Run(kUnknownCharacteristicError, "");
+    std::move(error_callback).Run(kUnknownCharacteristicError, "");
     return;
   }
 
   if (object_path.value() == heart_rate_measurement_path_) {
-    error_callback.Run(bluetooth_gatt_service::kErrorNotSupported,
-                       "Action not supported on this characteristic");
+    std::move(error_callback)
+        .Run(bluetooth_gatt_service::kErrorNotSupported,
+             "Action not supported on this characteristic");
     return;
   }
 
   if (object_path.value() != heart_rate_control_point_path_) {
-    error_callback.Run(bluetooth_gatt_service::kErrorNotPermitted,
-                       "Writes of this value are not allowed");
+    std::move(error_callback)
+        .Run(bluetooth_gatt_service::kErrorNotPermitted,
+             "Writes of this value are not allowed");
     return;
   }
 
@@ -317,21 +329,23 @@
     device::BluetoothGattCharacteristic::NotificationType notification_type,
 #endif
     const base::Closure& callback,
-    const ErrorCallback& error_callback) {
+    ErrorCallback error_callback) {
   if (!IsHeartRateVisible()) {
-    error_callback.Run(kUnknownCharacteristicError, "");
+    std::move(error_callback).Run(kUnknownCharacteristicError, "");
     return;
   }
 
   if (object_path.value() != heart_rate_measurement_path_) {
-    error_callback.Run(bluetooth_gatt_service::kErrorNotSupported,
-                       "This characteristic does not support notifications");
+    std::move(error_callback)
+        .Run(bluetooth_gatt_service::kErrorNotSupported,
+             "This characteristic does not support notifications");
     return;
   }
 
   if (heart_rate_measurement_properties_->notifying.value()) {
-    error_callback.Run(bluetooth_gatt_service::kErrorInProgress,
-                       "Characteristic already notifying");
+    std::move(error_callback)
+        .Run(bluetooth_gatt_service::kErrorInProgress,
+             "Characteristic already notifying");
     return;
   }
 
@@ -347,20 +361,22 @@
 void FakeBluetoothGattCharacteristicClient::StopNotify(
     const dbus::ObjectPath& object_path,
     const base::Closure& callback,
-    const ErrorCallback& error_callback) {
+    ErrorCallback error_callback) {
   if (!IsHeartRateVisible()) {
-    error_callback.Run(kUnknownCharacteristicError, "");
+    std::move(error_callback).Run(kUnknownCharacteristicError, "");
     return;
   }
 
   if (object_path.value() != heart_rate_measurement_path_) {
-    error_callback.Run(bluetooth_gatt_service::kErrorNotSupported,
-                       "This characteristic does not support notifications");
+    std::move(error_callback)
+        .Run(bluetooth_gatt_service::kErrorNotSupported,
+             "This characteristic does not support notifications");
     return;
   }
 
   if (!heart_rate_measurement_properties_->notifying.value()) {
-    error_callback.Run(bluetooth_gatt_service::kErrorFailed, "Not notifying");
+    std::move(error_callback)
+        .Run(bluetooth_gatt_service::kErrorFailed, "Not notifying");
     return;
   }
 
diff --git a/device/bluetooth/dbus/fake_bluetooth_gatt_characteristic_client.h b/device/bluetooth/dbus/fake_bluetooth_gatt_characteristic_client.h
index b126d40..a5c21c59 100644
--- a/device/bluetooth/dbus/fake_bluetooth_gatt_characteristic_client.h
+++ b/device/bluetooth/dbus/fake_bluetooth_gatt_characteristic_client.h
@@ -54,30 +54,30 @@
   Properties* GetProperties(const dbus::ObjectPath& object_path) override;
   void ReadValue(const dbus::ObjectPath& object_path,
                  ValueCallback callback,
-                 const ErrorCallback& error_callback) override;
+                 ErrorCallback error_callback) override;
   void WriteValue(const dbus::ObjectPath& object_path,
                   const std::vector<uint8_t>& value,
                   base::OnceClosure callback,
-                  const ErrorCallback& error_callback) override;
+                  ErrorCallback error_callback) override;
   void PrepareWriteValue(const dbus::ObjectPath& object_path,
                          const std::vector<uint8_t>& value,
                          base::OnceClosure callback,
-                         const ErrorCallback& error_callback) override;
+                         ErrorCallback error_callback) override;
 #if defined(OS_CHROMEOS)
   void StartNotify(
       const dbus::ObjectPath& object_path,
       device::BluetoothGattCharacteristic::NotificationType notification_type,
       const base::Closure& callback,
-      const ErrorCallback& error_callback) override;
+      ErrorCallback error_callback) override;
 #else
   void StartNotify(const dbus::ObjectPath& object_path,
                    const base::Closure& callback,
-                   const ErrorCallback& error_callback) override;
+                   ErrorCallback error_callback) override;
 #endif
 
   void StopNotify(const dbus::ObjectPath& object_path,
                   const base::Closure& callback,
-                  const ErrorCallback& error_callback) override;
+                  ErrorCallback error_callback) override;
 
   // Makes the group of characteristics belonging to a particular GATT based
   // profile available under the GATT service with object path |service_path|.
diff --git a/device/bluetooth/test/fake_remote_gatt_characteristic.cc b/device/bluetooth/test/fake_remote_gatt_characteristic.cc
index d352484..21945dd 100644
--- a/device/bluetooth/test/fake_remote_gatt_characteristic.cc
+++ b/device/bluetooth/test/fake_remote_gatt_characteristic.cc
@@ -131,18 +131,18 @@
 
 void FakeRemoteGattCharacteristic::ReadRemoteCharacteristic(
     ValueCallback callback,
-    const ErrorCallback& error_callback) {
+    ErrorCallback error_callback) {
   base::ThreadTaskRunnerHandle::Get()->PostTask(
       FROM_HERE,
       base::BindOnce(&FakeRemoteGattCharacteristic::DispatchReadResponse,
                      weak_ptr_factory_.GetWeakPtr(), std::move(callback),
-                     error_callback));
+                     std::move(error_callback)));
 }
 
 void FakeRemoteGattCharacteristic::WriteRemoteCharacteristic(
     const std::vector<uint8_t>& value,
     base::OnceClosure callback,
-    const ErrorCallback& error_callback) {
+    ErrorCallback error_callback) {
   // It doesn't make sense to dispatch a custom write response if the
   // characteristic only supports write without response but we still need to
   // run the callback because that's the guarantee the API makes.
@@ -157,14 +157,14 @@
       FROM_HERE,
       base::BindOnce(&FakeRemoteGattCharacteristic::DispatchWriteResponse,
                      weak_ptr_factory_.GetWeakPtr(), std::move(callback),
-                     error_callback, value));
+                     std::move(error_callback), value));
 }
 
 #if defined(OS_CHROMEOS)
 void FakeRemoteGattCharacteristic::PrepareWriteRemoteCharacteristic(
     const std::vector<uint8_t>& value,
     base::OnceClosure callback,
-    const ErrorCallback& error_callback) {
+    ErrorCallback error_callback) {
   NOTIMPLEMENTED();
 }
 #endif
@@ -185,28 +185,29 @@
     NotificationType notification_type,
 #endif
     const base::Closure& callback,
-    const ErrorCallback& error_callback) {
+    ErrorCallback error_callback) {
   base::ThreadTaskRunnerHandle::Get()->PostTask(
-      FROM_HERE,
-      base::BindOnce(&FakeRemoteGattCharacteristic::
-                         DispatchSubscribeToNotificationsResponse,
-                     weak_ptr_factory_.GetWeakPtr(), callback, error_callback));
+      FROM_HERE, base::BindOnce(&FakeRemoteGattCharacteristic::
+                                    DispatchSubscribeToNotificationsResponse,
+                                weak_ptr_factory_.GetWeakPtr(), callback,
+                                std::move(error_callback)));
 }
 
 void FakeRemoteGattCharacteristic::UnsubscribeFromNotifications(
     device::BluetoothRemoteGattDescriptor* ccc_descriptor,
     const base::Closure& callback,
-    const ErrorCallback& error_callback) {
+    ErrorCallback error_callback) {
   base::ThreadTaskRunnerHandle::Get()->PostTask(
       FROM_HERE,
       base::BindOnce(&FakeRemoteGattCharacteristic::
                          DispatchUnsubscribeFromNotificationsResponse,
-                     weak_ptr_factory_.GetWeakPtr(), callback, error_callback));
+                     weak_ptr_factory_.GetWeakPtr(), callback,
+                     std::move(error_callback)));
 }
 
 void FakeRemoteGattCharacteristic::DispatchReadResponse(
     ValueCallback callback,
-    const ErrorCallback& error_callback) {
+    ErrorCallback error_callback) {
   DCHECK(next_read_response_);
   uint16_t gatt_code = next_read_response_->gatt_code();
   base::Optional<std::vector<uint8_t>> value = next_read_response_->value();
@@ -220,7 +221,8 @@
       break;
     case mojom::kGATTInvalidHandle:
       DCHECK(!value);
-      error_callback.Run(device::BluetoothGattService::GATT_ERROR_FAILED);
+      std::move(error_callback)
+          .Run(device::BluetoothGattService::GATT_ERROR_FAILED);
       break;
     default:
       NOTREACHED();
@@ -229,7 +231,7 @@
 
 void FakeRemoteGattCharacteristic::DispatchWriteResponse(
     base::OnceClosure callback,
-    const ErrorCallback& error_callback,
+    ErrorCallback error_callback,
     const std::vector<uint8_t>& value) {
   DCHECK(next_write_response_);
   uint16_t gatt_code = next_write_response_.value();
@@ -241,7 +243,8 @@
       std::move(callback).Run();
       break;
     case mojom::kGATTInvalidHandle:
-      error_callback.Run(device::BluetoothGattService::GATT_ERROR_FAILED);
+      std::move(error_callback)
+          .Run(device::BluetoothGattService::GATT_ERROR_FAILED);
       break;
     default:
       NOTREACHED();
@@ -250,7 +253,7 @@
 
 void FakeRemoteGattCharacteristic::DispatchSubscribeToNotificationsResponse(
     const base::Closure& callback,
-    const ErrorCallback& error_callback) {
+    ErrorCallback error_callback) {
   DCHECK(next_subscribe_to_notifications_response_);
   uint16_t gatt_code = next_subscribe_to_notifications_response_.value();
   next_subscribe_to_notifications_response_.reset();
@@ -260,7 +263,8 @@
       callback.Run();
       break;
     case mojom::kGATTInvalidHandle:
-      error_callback.Run(device::BluetoothGattService::GATT_ERROR_FAILED);
+      std::move(error_callback)
+          .Run(device::BluetoothGattService::GATT_ERROR_FAILED);
       break;
     default:
       NOTREACHED();
@@ -269,7 +273,7 @@
 
 void FakeRemoteGattCharacteristic::DispatchUnsubscribeFromNotificationsResponse(
     const base::Closure& callback,
-    const ErrorCallback& error_callback) {
+    ErrorCallback error_callback) {
   DCHECK(next_unsubscribe_from_notifications_response_);
   uint16_t gatt_code = next_unsubscribe_from_notifications_response_.value();
   next_unsubscribe_from_notifications_response_.reset();
@@ -279,7 +283,8 @@
       callback.Run();
       break;
     case mojom::kGATTInvalidHandle:
-      error_callback.Run(device::BluetoothGattService::GATT_ERROR_FAILED);
+      std::move(error_callback)
+          .Run(device::BluetoothGattService::GATT_ERROR_FAILED);
       break;
     default:
       NOTREACHED();
diff --git a/device/bluetooth/test/fake_remote_gatt_characteristic.h b/device/bluetooth/test/fake_remote_gatt_characteristic.h
index 3f8ae84a..7a36031 100644
--- a/device/bluetooth/test/fake_remote_gatt_characteristic.h
+++ b/device/bluetooth/test/fake_remote_gatt_characteristic.h
@@ -84,15 +84,14 @@
   const std::vector<uint8_t>& GetValue() const override;
   device::BluetoothRemoteGattService* GetService() const override;
   void ReadRemoteCharacteristic(ValueCallback callback,
-                                const ErrorCallback& error_callback) override;
+                                ErrorCallback error_callback) override;
   void WriteRemoteCharacteristic(const std::vector<uint8_t>& value,
                                  base::OnceClosure callback,
-                                 const ErrorCallback& error_callback) override;
+                                 ErrorCallback error_callback) override;
 #if defined(OS_CHROMEOS)
-  void PrepareWriteRemoteCharacteristic(
-      const std::vector<uint8_t>& value,
-      base::OnceClosure callback,
-      const ErrorCallback& error_callback) override;
+  void PrepareWriteRemoteCharacteristic(const std::vector<uint8_t>& value,
+                                        base::OnceClosure callback,
+                                        ErrorCallback error_callback) override;
 #endif
   bool WriteWithoutResponse(base::span<const uint8_t> value) override;
 
@@ -103,31 +102,30 @@
       device::BluetoothRemoteGattDescriptor* ccc_descriptor,
       NotificationType notification_type,
       const base::Closure& callback,
-      const ErrorCallback& error_callback) override;
+      ErrorCallback error_callback) override;
 #else
   // device::BluetoothRemoteGattCharacteristic overrides:
   void SubscribeToNotifications(
       device::BluetoothRemoteGattDescriptor* ccc_descriptor,
       const base::Closure& callback,
-      const ErrorCallback& error_callback) override;
+      ErrorCallback error_callback) override;
 #endif
   void UnsubscribeFromNotifications(
       device::BluetoothRemoteGattDescriptor* ccc_descriptor,
       const base::Closure& callback,
-      const ErrorCallback& error_callback) override;
+      ErrorCallback error_callback) override;
 
  private:
   void DispatchReadResponse(ValueCallback callback,
-                            const ErrorCallback& error_callback);
+                            ErrorCallback error_callback);
   void DispatchWriteResponse(base::OnceClosure callback,
-                             const ErrorCallback& error_callback,
+                             ErrorCallback error_callback,
                              const std::vector<uint8_t>& value);
-  void DispatchSubscribeToNotificationsResponse(
-      const base::Closure& callback,
-      const ErrorCallback& error_callback);
+  void DispatchSubscribeToNotificationsResponse(const base::Closure& callback,
+                                                ErrorCallback error_callback);
   void DispatchUnsubscribeFromNotificationsResponse(
       const base::Closure& callback,
-      const ErrorCallback& error_callback);
+      ErrorCallback error_callback);
 
   const std::string characteristic_id_;
   const device::BluetoothUUID characteristic_uuid_;
diff --git a/device/bluetooth/test/mock_bluetooth_gatt_characteristic.h b/device/bluetooth/test/mock_bluetooth_gatt_characteristic.h
index d8afc77..c88da93 100644
--- a/device/bluetooth/test/mock_bluetooth_gatt_characteristic.h
+++ b/device/bluetooth/test/mock_bluetooth_gatt_characteristic.h
@@ -51,40 +51,47 @@
                      BluetoothRemoteGattDescriptor*(const std::string&));
   MOCK_METHOD1(UpdateValue, bool(const std::vector<uint8_t>&));
 #if defined(OS_CHROMEOS)
-  MOCK_METHOD3(StartNotifySession,
+  void StartNotifySession(NotificationType t,
+                          const NotifySessionCallback& c,
+                          ErrorCallback ec) override {
+    StartNotifySession_(t, c, ec);
+  }
+  MOCK_METHOD3(StartNotifySession_,
                void(NotificationType,
                     const NotifySessionCallback&,
-                    const ErrorCallback&));
+                    ErrorCallback&));
 #endif
-  MOCK_METHOD2(StartNotifySession,
-               void(const NotifySessionCallback&, const ErrorCallback&));
+  void StartNotifySession(const NotifySessionCallback& c,
+                          ErrorCallback ec) override {
+    StartNotifySession_(c, ec);
+  }
+  MOCK_METHOD2(StartNotifySession_,
+               void(const NotifySessionCallback&, ErrorCallback&));
   MOCK_METHOD2(StopNotifySession,
                void(BluetoothGattNotifySession*, const base::Closure&));
-  void ReadRemoteCharacteristic(ValueCallback c,
-                                const ErrorCallback& ec) override {
+  void ReadRemoteCharacteristic(ValueCallback c, ErrorCallback ec) override {
     ReadRemoteCharacteristic_(c, ec);
   }
-  MOCK_METHOD2(ReadRemoteCharacteristic_,
-               void(ValueCallback&, const ErrorCallback&));
+  MOCK_METHOD2(ReadRemoteCharacteristic_, void(ValueCallback&, ErrorCallback&));
   void WriteRemoteCharacteristic(const std::vector<uint8_t>& v,
                                  base::OnceClosure c,
-                                 const ErrorCallback& ec) override {
+                                 ErrorCallback ec) override {
     WriteRemoteCharacteristic_(v, c, ec);
   }
   MOCK_METHOD3(WriteRemoteCharacteristic_,
                void(const std::vector<uint8_t>&,
                     base::OnceClosure&,
-                    const ErrorCallback&));
+                    ErrorCallback&));
 #if defined(OS_CHROMEOS)
   void PrepareWriteRemoteCharacteristic(const std::vector<uint8_t>& v,
                                         base::OnceClosure c,
-                                        const ErrorCallback& ec) override {
+                                        ErrorCallback ec) override {
     PrepareWriteRemoteCharacteristic_(v, c, ec);
   }
   MOCK_METHOD3(PrepareWriteRemoteCharacteristic_,
                void(const std::vector<uint8_t>&,
                     base::OnceClosure&,
-                    const ErrorCallback&));
+                    ErrorCallback&));
 #endif
   MOCK_METHOD1(WriteWithoutResponse, bool(base::span<const uint8_t>));
 
@@ -93,21 +100,37 @@
 
  protected:
 #if defined(OS_CHROMEOS)
-  MOCK_METHOD4(SubscribeToNotifications,
+  void SubscribeToNotifications(BluetoothRemoteGattDescriptor* d,
+                                NotificationType t,
+                                const base::Closure& c,
+                                ErrorCallback ec) override {
+    SubscribeToNotifications_(d, t, c, ec);
+  }
+  MOCK_METHOD4(SubscribeToNotifications_,
                void(BluetoothRemoteGattDescriptor*,
                     NotificationType,
                     const base::Closure&,
-                    const ErrorCallback&));
+                    ErrorCallback&));
 #else
-  MOCK_METHOD3(SubscribeToNotifications,
+  void SubscribeToNotifications(BluetoothRemoteGattDescriptor* d,
+                                const base::Closure& c,
+                                ErrorCallback ec) override {
+    SubscribeToNotifications_(d, c, ec);
+  }
+  MOCK_METHOD3(SubscribeToNotifications_,
                void(BluetoothRemoteGattDescriptor*,
                     const base::Closure&,
-                    const ErrorCallback&));
+                    ErrorCallback&));
 #endif
-  MOCK_METHOD3(UnsubscribeFromNotifications,
+  void UnsubscribeFromNotifications(BluetoothRemoteGattDescriptor* d,
+                                    const base::Closure& c,
+                                    ErrorCallback ec) override {
+    UnsubscribeFromNotifications_(d, c, ec);
+  }
+  MOCK_METHOD3(UnsubscribeFromNotifications_,
                void(BluetoothRemoteGattDescriptor*,
                     const base::Closure&,
-                    const ErrorCallback&));
+                    ErrorCallback&));
 
  private:
   DISALLOW_COPY_AND_ASSIGN(MockBluetoothGattCharacteristic);
diff --git a/device/fido/ble/fido_ble_connection_unittest.cc b/device/fido/ble/fido_ble_connection_unittest.cc
index 221a63c..275bbc7 100644
--- a/device/fido/ble/fido_ble_connection_unittest.cc
+++ b/device/fido/ble/fido_ble_connection_unittest.cc
@@ -159,7 +159,7 @@
     ON_CALL(*fido_service_revision_bitfield_, ReadRemoteCharacteristic_)
         .WillByDefault(Invoke(
             [=](BluetoothRemoteGattCharacteristic::ValueCallback& callback,
-                const BluetoothRemoteGattCharacteristic::ErrorCallback&) {
+                BluetoothRemoteGattCharacteristic::ErrorCallback&) {
               base::ThreadTaskRunnerHandle::Get()->PostTask(
                   FROM_HERE, base::BindOnce(std::move(callback),
                                             std::vector<uint8_t>(
@@ -174,8 +174,10 @@
                   FROM_HERE, std::move(callback));
             }));
 
-    ON_CALL(*fido_status_, StartNotifySession(_, _))
-        .WillByDefault(Invoke([this](const auto& callback, auto&&) {
+    ON_CALL(*fido_status_, StartNotifySession_(_, _))
+        .WillByDefault(Invoke([this](
+                                  const auto& callback,
+                                  BluetoothGattCharacteristic::ErrorCallback&) {
           notify_session_ = new NiceMockBluetoothGattNotifySession(
               fido_status_->GetWeakPtr());
           callback.Run(base::WrapUnique(notify_session_));
@@ -197,13 +199,15 @@
   }
 
   void SimulateGattNotifySessionStartError() {
-    EXPECT_CALL(*fido_status_, StartNotifySession(_, _))
-        .WillOnce(Invoke([](auto&&, auto&& error_callback) {
-          base::ThreadTaskRunnerHandle::Get()->PostTask(
-              FROM_HERE,
-              base::BindOnce(error_callback,
-                             BluetoothGattService::GATT_ERROR_FAILED));
-        }));
+    EXPECT_CALL(*fido_status_, StartNotifySession_(_, _))
+        .WillOnce(Invoke(
+            [](auto&&,
+               BluetoothGattCharacteristic::ErrorCallback& error_callback) {
+              base::ThreadTaskRunnerHandle::Get()->PostTask(
+                  FROM_HERE,
+                  base::BindOnce(std::move(error_callback),
+                                 BluetoothGattService::GATT_ERROR_FAILED));
+            }));
   }
 
   void NotifyStatusChanged(const std::vector<uint8_t>& value) {
@@ -231,12 +235,13 @@
         .WillOnce(Invoke(
             [success, value](
                 BluetoothRemoteGattCharacteristic::ValueCallback& callback,
-                const auto& error_callback) {
+                BluetoothRemoteGattCharacteristic::ErrorCallback&
+                    error_callback) {
               base::ThreadTaskRunnerHandle::Get()->PostTask(
                   FROM_HERE,
                   success ? base::BindOnce(std::move(callback), value)
                           : base::BindOnce(
-                                error_callback,
+                                std::move(error_callback),
                                 BluetoothGattService::GATT_ERROR_FAILED));
             }));
   }
@@ -247,12 +252,13 @@
         .WillOnce(Invoke(
             [success, value](
                 BluetoothRemoteGattCharacteristic::ValueCallback& callback,
-                const auto& error_callback) {
+                BluetoothRemoteGattCharacteristic::ErrorCallback&
+                    error_callback) {
               base::ThreadTaskRunnerHandle::Get()->PostTask(
                   FROM_HERE,
                   success ? base::BindOnce(std::move(callback), value)
                           : base::BindOnce(
-                                error_callback,
+                                std::move(error_callback),
                                 BluetoothGattService::GATT_ERROR_FAILED));
             }));
   }
@@ -265,12 +271,13 @@
         .WillOnce(Invoke(
             [success, value](
                 BluetoothRemoteGattCharacteristic::ValueCallback& callback,
-                const auto& error_callback) {
+                BluetoothRemoteGattCharacteristic::ErrorCallback&
+                    error_callback) {
               base::ThreadTaskRunnerHandle::Get()->PostTask(
                   FROM_HERE,
                   success ? base::BindOnce(std::move(callback), value)
                           : base::BindOnce(
-                                error_callback,
+                                std::move(error_callback),
                                 BluetoothGattService::GATT_ERROR_FAILED));
             }));
   }
@@ -287,14 +294,15 @@
 #endif  // defined(OS_MACOSX)
 
     EXPECT_CALL(*fido_control_point_, WriteRemoteCharacteristic_(_, _, _))
-        .WillOnce(Invoke([success](const auto& data,
-                                   base::OnceClosure& callback,
-                                   const auto& error_callback) {
+        .WillOnce(Invoke([success](
+                             const auto& data, base::OnceClosure& callback,
+                             BluetoothRemoteGattCharacteristic::ErrorCallback&
+                                 error_callback) {
           base::ThreadTaskRunnerHandle::Get()->PostTask(
               FROM_HERE,
               success
                   ? std::move(callback)
-                  : base::BindOnce(error_callback,
+                  : base::BindOnce(std::move(error_callback),
                                    BluetoothGattService::GATT_ERROR_FAILED));
         }));
   }
@@ -303,14 +311,15 @@
                                            bool success) {
     EXPECT_CALL(*fido_service_revision_bitfield_,
                 WriteRemoteCharacteristic_(expected_data, _, _))
-        .WillOnce(Invoke([success](const auto& data,
-                                   base::OnceClosure& callback,
-                                   const auto& error_callback) {
+        .WillOnce(Invoke([success](
+                             const auto& data, base::OnceClosure& callback,
+                             BluetoothRemoteGattCharacteristic::ErrorCallback&
+                                 error_callback) {
           base::ThreadTaskRunnerHandle::Get()->PostTask(
               FROM_HERE,
               success
                   ? std::move(callback)
-                  : base::BindOnce(error_callback,
+                  : base::BindOnce(std::move(error_callback),
                                    BluetoothGattService::GATT_ERROR_FAILED));
         }));
   }