Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(595)

Unified Diff: chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_api.cc

Issue 1991083002: Remove ExtensionFunction::SetResult(T*) overload. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: IWYU Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_api.cc
diff --git a/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_api.cc b/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_api.cc
index 5aa5fbfe7d195b419a3f91364e9657cea7f14e37..d465d093824e53df43e43503fad1745cfec9bc4b 100644
--- a/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_api.cc
+++ b/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_api.cc
@@ -7,6 +7,7 @@
#include <stdint.h>
#include <algorithm>
#include <iterator>
+#include <utility>
#include <vector>
#include "base/bind.h"
@@ -623,7 +624,7 @@ bool BluetoothLowEnergyGetCharacteristicFunction::DoWork() {
// Manually construct the result instead of using
// apibtle::GetCharacteristic::Result::Create as it doesn't convert lists of
// enums correctly.
- SetResult(apibtle::CharacteristicToValue(&characteristic).release());
+ SetResult(apibtle::CharacteristicToValue(&characteristic));
SendResponse(true);
return true;
@@ -664,7 +665,7 @@ bool BluetoothLowEnergyGetCharacteristicsFunction::DoWork() {
for (apibtle::Characteristic& characteristic : characteristic_list)
result->Append(apibtle::CharacteristicToValue(&characteristic));
- SetResult(result.release());
+ SetResult(std::move(result));
SendResponse(true);
return true;
@@ -733,7 +734,7 @@ bool BluetoothLowEnergyGetDescriptorFunction::DoWork() {
// Manually construct the result instead of using
// apibtle::GetDescriptor::Result::Create as it doesn't convert lists of enums
// correctly.
- SetResult(apibtle::DescriptorToValue(&descriptor).release());
+ SetResult(apibtle::DescriptorToValue(&descriptor));
SendResponse(true);
return true;
@@ -773,7 +774,7 @@ bool BluetoothLowEnergyGetDescriptorsFunction::DoWork() {
for (apibtle::Descriptor& descriptor : descriptor_list)
result->Append(apibtle::DescriptorToValue(&descriptor));
- SetResult(result.release());
+ SetResult(std::move(result));
SendResponse(true);
return true;
@@ -827,7 +828,7 @@ void BluetoothLowEnergyReadCharacteristicValueFunction::SuccessCallback() {
// Manually construct the result instead of using
// apibtle::GetCharacteristic::Result::Create as it doesn't convert lists of
// enums correctly.
- SetResult(apibtle::CharacteristicToValue(&characteristic).release());
+ SetResult(apibtle::CharacteristicToValue(&characteristic));
SendResponse(true);
}
@@ -1018,7 +1019,7 @@ void BluetoothLowEnergyReadDescriptorValueFunction::SuccessCallback() {
// Manually construct the result instead of using
// apibtle::GetDescriptor::Results::Create as it doesn't convert lists of
// enums correctly.
- SetResult(apibtle::DescriptorToValue(&descriptor).release());
+ SetResult(apibtle::DescriptorToValue(&descriptor));
SendResponse(true);
}

Powered by Google App Engine
This is Rietveld 408576698