Chromium Code Reviews| Index: content/browser/dom_storage/local_storage_context_mojo.cc |
| diff --git a/content/browser/dom_storage/local_storage_context_mojo.cc b/content/browser/dom_storage/local_storage_context_mojo.cc |
| index 6cc0c76f6b6e2d9ff749ead7c50cbf3e5b2092b0..44a8873178cb7e70a89ab85bdfd5bd772a68ca5b 100644 |
| --- a/content/browser/dom_storage/local_storage_context_mojo.cc |
| +++ b/content/browser/dom_storage/local_storage_context_mojo.cc |
| @@ -70,7 +70,11 @@ void NoOpSuccess(bool success) {} |
| std::vector<uint8_t> String16ToUint8Vector(const base::string16& input) { |
| const uint8_t* data = reinterpret_cast<const uint8_t*>(input.data()); |
| - return std::vector<uint8_t>(data, data + input.size() * sizeof(base::char16)); |
| + std::vector<uint8_t> result; |
| + result.reserve(input.size() * sizeof(base::char16) + 1); |
| + result.push_back(0); |
|
michaeln
2017/03/22 23:49:51
The magic "0" value here is pretty magical, it mig
Marijn Kruisselbrink
2017/03/31 23:06:14
Yeah, I agree that this isn't very nice. I changed
|
| + result.insert(result.end(), data, data + input.size() * sizeof(base::char16)); |
| + return result; |
| } |
| void MigrateStorageHelper( |