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

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

Issue 10388207: Reverting due to memory waterfall failures. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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
===================================================================
--- chrome/browser/extensions/api/socket/socket_api.cc (revision 138049)
+++ chrome/browser/extensions/api/socket/socket_api.cc (working copy)
@@ -173,7 +173,9 @@
base::BinaryValue::CreateWithCopiedBuffer(io_buffer->data(),
bytes_read));
} else {
- result->Set(kDataKey, new base::BinaryValue());
+ // 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_.reset(result);
@@ -254,7 +256,9 @@
base::BinaryValue::CreateWithCopiedBuffer(io_buffer->data(),
bytes_read));
} else {
- result->Set(kDataKey, new base::BinaryValue());
+ // 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->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