parent
b2d53f1e1e
commit
6310d6c699
1 changed files with 4 additions and 1 deletions
|
@ -10,6 +10,7 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "atom/common/native_mate_converters/value_converter.h"
|
#include "atom/common/native_mate_converters/value_converter.h"
|
||||||
|
#include "base/numerics/safe_conversions.h"
|
||||||
#include "native_mate/dictionary.h"
|
#include "native_mate/dictionary.h"
|
||||||
#include "services/network/public/cpp/resource_request_body.h"
|
#include "services/network/public/cpp/resource_request_body.h"
|
||||||
|
|
||||||
|
@ -66,7 +67,9 @@ bool Converter<scoped_refptr<network::ResourceRequestBody>>::FromV8(
|
||||||
if (type == "rawData") {
|
if (type == "rawData") {
|
||||||
base::Value* bytes = nullptr;
|
base::Value* bytes = nullptr;
|
||||||
dict->GetBinary("bytes", &bytes);
|
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") {
|
} else if (type == "file") {
|
||||||
std::string file;
|
std::string file;
|
||||||
int offset = 0, length = -1;
|
int offset = 0, length = -1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue