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

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

Issue 2689673002: Inline base::BinaryValue into base::Value (Closed)
Patch Set: Rebase Created 3 years, 10 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/renderer/argument_spec_unittest.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 d0373f9de5073aa25e86f2628435d2d9accd3289..e8f0a8a2885c49269a24848c607db3ba701f3bb4 100644
--- a/extensions/browser/api/usb/usb_api.cc
+++ b/extensions/browser/api/usb/usb_api.cc
@@ -468,7 +468,7 @@ void UsbTransferFunction::OnCompleted(UsbTransferStatus status,
transfer_info->Set(kDataKey, base::BinaryValue::CreateWithCopiedBuffer(
data->data(), length));
} else {
- transfer_info->Set(kDataKey, new base::BinaryValue());
+ transfer_info->Set(kDataKey, new base::Value(base::Value::Type::BINARY));
}
if (status == device::USB_TRANSFER_COMPLETED) {
@@ -1241,8 +1241,8 @@ void UsbIsochronousTransferFunction::OnCompleted(
std::unique_ptr<base::DictionaryValue> transfer_info(
new base::DictionaryValue());
transfer_info->SetInteger(kResultCodeKey, status);
- transfer_info->Set(kDataKey,
- new base::BinaryValue(std::move(buffer), length));
+ transfer_info->Set(kDataKey, new base::BinaryValue(std::vector<char>(
+ buffer.get(), buffer.get() + length)));
if (status == device::USB_TRANSFER_COMPLETED) {
Respond(OneArgument(std::move(transfer_info)));
} else {
« no previous file with comments | « extensions/browser/api/socket/socket_api.cc ('k') | extensions/renderer/argument_spec_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698