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

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

Issue 10389088: BinaryValue does not support NULL buffer. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Explicit out-of-line destructor. Take 2. Created 8 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
« no previous file with comments | « base/values_unittest.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 98fa6f29841c1bbda492a78be1e28da8e5e5f001..122f2bccf323287cc133e06f27bd959cf95b5971 100644
--- a/chrome/browser/extensions/api/socket/socket_api.cc
+++ b/chrome/browser/extensions/api/socket/socket_api.cc
@@ -173,9 +173,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());
}
result_.reset(result);
@@ -256,9 +254,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 | « base/values_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698