Flatten ResourceRequestBody data
https://chromium-review.googlesource.com/c/chromium/src/+/1114258
This commit is contained in:
parent
b2d53f1e1e
commit
6310d6c699
1 changed files with 4 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue