Remove base::Value::Get{Buffer,Size}

https://codereview.chromium.org/2841623003
This commit is contained in:
Aleksei Kuzmin 2017-08-04 12:12:54 +03:00 committed by Cheng Zhao
parent 132029ea32
commit 58e0771e47
3 changed files with 5 additions and 5 deletions

View file

@ -60,8 +60,8 @@ void URLRequestBufferJob::StartAsync(std::unique_ptr<base::Value> options) {
} }
data_ = new base::RefCountedBytes( data_ = new base::RefCountedBytes(
reinterpret_cast<const unsigned char*>(binary->GetBuffer()), reinterpret_cast<const unsigned char*>(binary->GetBlob().data()),
binary->GetSize()); binary->GetBlob().size());
status_code_ = net::HTTP_OK; status_code_ = net::HTTP_OK;
net::URLRequestSimpleJob::Start(); net::URLRequestSimpleJob::Start();
} }

View file

@ -262,7 +262,7 @@ bool Converter<scoped_refptr<ResourceRequestBodyImpl>>::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->GetBuffer(), bytes->GetSize()); (*out)->AppendBytes(bytes->GetBlob().data(), 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;

View file

@ -255,8 +255,8 @@ v8::Local<v8::Value> V8ValueConverter::ToV8Object(
v8::Local<v8::Value> V8ValueConverter::ToArrayBuffer( v8::Local<v8::Value> V8ValueConverter::ToArrayBuffer(
v8::Isolate* isolate, const base::Value* value) const { v8::Isolate* isolate, const base::Value* value) const {
const char* data = value->GetBuffer(); const char* data = value->GetBlob().data();
size_t length = value->GetSize(); size_t length = value->GetBlob().size();
if (!disable_node_) { if (!disable_node_) {
return node::Buffer::Copy(isolate, data, length).ToLocalChecked(); return node::Buffer::Copy(isolate, data, length).ToLocalChecked();