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

Unified Diff: chrome/browser/extensions/api/socket/socket_api.cc

Issue 11745016: BinaryValue support for NULL buffer. (Closed) Base URL: https://git.chromium.org/chromium/src.git@master
Patch Set: BinaryValue support for NULL buffer. Created 7 years, 11 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 | « chrome/browser/extensions/api/bluetooth/bluetooth_api.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/socket/socket_api.cc
diff --git a/chrome/browser/extensions/api/socket/socket_api.cc b/chrome/browser/extensions/api/socket/socket_api.cc
index 3afcee4c060e5fc4cad125c0a94660e554200b04..d0ae519c7b8c50ea8450de113b7b50063cfac00a 100644
--- a/chrome/browser/extensions/api/socket/socket_api.cc
+++ b/chrome/browser/extensions/api/socket/socket_api.cc
@@ -382,9 +382,7 @@ void SocketReadFunction::OnCompleted(int bytes_read,
base::BinaryValue::CreateWithCopiedBuffer(io_buffer->data(),
bytes_read));
} else {
- // BinaryValue does not support NULL buffer. Workaround it with new char[1].
- // http://crbug.com/127630
- result->Set(kDataKey, base::BinaryValue::Create(new char[1], 0));
+ result->Set(kDataKey, new base::BinaryValue());
}
SetResult(result);
@@ -465,9 +463,7 @@ void SocketRecvFromFunction::OnCompleted(int bytes_read,
base::BinaryValue::CreateWithCopiedBuffer(io_buffer->data(),
bytes_read));
} else {
- // BinaryValue does not support NULL buffer. Workaround it with new char[1].
- // http://crbug.com/127630
- result->Set(kDataKey, base::BinaryValue::Create(new char[1], 0));
+ result->Set(kDataKey, new base::BinaryValue());
}
result->SetString(kAddressKey, address);
result->SetInteger(kPortKey, port);
« no previous file with comments | « chrome/browser/extensions/api/bluetooth/bluetooth_api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698