parent
49fbb52b01
commit
cc350efbd8
5 changed files with 8 additions and 9 deletions
|
@ -33,7 +33,7 @@ URLRequestBufferJob::URLRequestBufferJob(
|
|||
}
|
||||
|
||||
void URLRequestBufferJob::StartAsync(std::unique_ptr<base::Value> options) {
|
||||
const base::BinaryValue* binary = nullptr;
|
||||
const base::Value* binary = nullptr;
|
||||
if (options->IsType(base::Value::Type::DICTIONARY)) {
|
||||
base::DictionaryValue* dict =
|
||||
static_cast<base::DictionaryValue*>(options.get());
|
||||
|
|
|
@ -215,7 +215,7 @@ Converter<scoped_refptr<ResourceRequestBodyImpl>>::ToV8(
|
|||
auto type = element.type();
|
||||
if (type == ResourceRequestBodyImpl::Element::TYPE_BYTES) {
|
||||
std::unique_ptr<base::Value> bytes(
|
||||
base::BinaryValue::CreateWithCopiedBuffer(
|
||||
base::Value::CreateWithCopiedBuffer(
|
||||
element.bytes(), static_cast<size_t>(element.length())));
|
||||
post_data_dict->SetString("type", "rawData");
|
||||
post_data_dict->Set("bytes", std::move(bytes));
|
||||
|
@ -260,7 +260,7 @@ bool Converter<scoped_refptr<ResourceRequestBodyImpl>>::FromV8(
|
|||
return false;
|
||||
dict->GetString("type", &type);
|
||||
if (type == "rawData") {
|
||||
base::BinaryValue* bytes = nullptr;
|
||||
base::Value* bytes = nullptr;
|
||||
dict->GetBinary("bytes", &bytes);
|
||||
(*out)->AppendBytes(bytes->GetBuffer(), bytes->GetSize());
|
||||
} else if (type == "file") {
|
||||
|
|
|
@ -196,7 +196,7 @@ void GetUploadData(base::ListValue* upload_data_list,
|
|||
const net::UploadBytesElementReader* bytes_reader =
|
||||
reader->AsBytesReader();
|
||||
std::unique_ptr<base::Value> bytes(
|
||||
base::BinaryValue::CreateWithCopiedBuffer(bytes_reader->bytes(),
|
||||
base::Value::CreateWithCopiedBuffer(bytes_reader->bytes(),
|
||||
bytes_reader->length()));
|
||||
upload_data_dict->Set("bytes", std::move(bytes));
|
||||
} else if (reader->AsFileReader()) {
|
||||
|
|
|
@ -205,7 +205,7 @@ v8::Local<v8::Value> V8ValueConverter::ToV8ValueImpl(
|
|||
|
||||
case base::Value::Type::BINARY:
|
||||
return ToArrayBuffer(isolate,
|
||||
static_cast<const base::BinaryValue*>(value));
|
||||
static_cast<const base::Value*>(value));
|
||||
|
||||
default:
|
||||
LOG(ERROR) << "Unexpected value type: " << value->GetType();
|
||||
|
@ -254,7 +254,7 @@ v8::Local<v8::Value> V8ValueConverter::ToV8Object(
|
|||
}
|
||||
|
||||
v8::Local<v8::Value> V8ValueConverter::ToArrayBuffer(
|
||||
v8::Isolate* isolate, const base::BinaryValue* value) const {
|
||||
v8::Isolate* isolate, const base::Value* value) const {
|
||||
const char* data = value->GetBuffer();
|
||||
size_t length = value->GetSize();
|
||||
|
||||
|
@ -420,7 +420,7 @@ base::Value* V8ValueConverter::FromNodeBuffer(
|
|||
v8::Local<v8::Value> value,
|
||||
FromV8ValueState* state,
|
||||
v8::Isolate* isolate) const {
|
||||
return base::BinaryValue::CreateWithCopiedBuffer(
|
||||
return base::Value::CreateWithCopiedBuffer(
|
||||
node::Buffer::Data(value), node::Buffer::Length(value)).release();
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,6 @@ namespace base {
|
|||
class DictionaryValue;
|
||||
class ListValue;
|
||||
class Value;
|
||||
using BinaryValue = Value;
|
||||
}
|
||||
|
||||
namespace atom {
|
||||
|
@ -44,7 +43,7 @@ class V8ValueConverter {
|
|||
const base::DictionaryValue* dictionary) const;
|
||||
v8::Local<v8::Value> ToArrayBuffer(
|
||||
v8::Isolate* isolate,
|
||||
const base::BinaryValue* value) const;
|
||||
const base::Value* value) const;
|
||||
|
||||
base::Value* FromV8ValueImpl(FromV8ValueState* state,
|
||||
v8::Local<v8::Value> value,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue