Flatten ResourceRequestBody data

https://chromium-review.googlesource.com/c/chromium/src/+/1114258
This commit is contained in:
deepak1556 2018-10-25 21:35:07 +05:30
parent b2d53f1e1e
commit 6310d6c699

View file

@ -10,6 +10,7 @@
#include <vector>
#include "atom/common/native_mate_converters/value_converter.h"
#include "base/numerics/safe_conversions.h"
#include "native_mate/dictionary.h"
#include "services/network/public/cpp/resource_request_body.h"
@ -66,7 +67,9 @@ bool Converter<scoped_refptr<network::ResourceRequestBody>>::FromV8(
if (type == "rawData") {
base::Value* bytes = nullptr;
dict->GetBinary("bytes", &bytes);
(*out)->AppendBytes(bytes->GetBlob().data(), bytes->GetBlob().size());
(*out)->AppendBytes(
reinterpret_cast<const char*>(bytes->GetBlob().data()),
base::checked_cast<int>(bytes->GetBlob().size()));
} else if (type == "file") {
std::string file;
int offset = 0, length = -1;