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

Unified Diff: extensions/browser/api/usb/usb_api.cc

Issue 2899743002: Remove raw base::DictionaryValue::Set in //extensions (Closed)
Patch Set: Addressed nit Created 3 years, 6 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
« no previous file with comments | « extensions/browser/api/socket/socket_api.cc ('k') | extensions/browser/api/web_request/web_request_api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/api/usb/usb_api.cc
diff --git a/extensions/browser/api/usb/usb_api.cc b/extensions/browser/api/usb/usb_api.cc
index 8280a63ae18618764fbeae4d55af963b94da986b..c82956549ea1b502b683eceb3d117c2899232b1b 100644
--- a/extensions/browser/api/usb/usb_api.cc
+++ b/extensions/browser/api/usb/usb_api.cc
@@ -471,7 +471,8 @@ void UsbTransferFunction::OnCompleted(UsbTransferStatus status,
transfer_info->Set(
kDataKey, base::Value::CreateWithCopiedBuffer(data->data(), length));
} else {
- transfer_info->Set(kDataKey, new base::Value(base::Value::Type::BINARY));
+ transfer_info->Set(
+ kDataKey, base::MakeUnique<base::Value>(base::Value::Type::BINARY));
}
if (status == UsbTransferStatus::COMPLETED) {
@@ -1242,7 +1243,8 @@ void UsbIsochronousTransferFunction::OnCompleted(
std::unique_ptr<base::DictionaryValue> transfer_info(
new base::DictionaryValue());
transfer_info->SetInteger(kResultCodeKey, static_cast<int>(status));
- transfer_info->Set(kDataKey, new base::Value(std::move(buffer)));
+ transfer_info->Set(kDataKey,
+ base::MakeUnique<base::Value>(std::move(buffer)));
if (status == UsbTransferStatus::COMPLETED) {
Respond(OneArgument(std::move(transfer_info)));
} else {
« no previous file with comments | « extensions/browser/api/socket/socket_api.cc ('k') | extensions/browser/api/web_request/web_request_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698