refactor: remove deprecated GetAs methods (#13425)

* refactor: remove deprecated GetAs methods

* restructure URLRequestAsyncAsarJob on win

* fix: add string conversion header
This commit is contained in:
Shelley Vohr 2018-06-27 14:52:48 -07:00 committed by GitHub
parent fa0704665f
commit 003a92e099
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 22 additions and 20 deletions

View file

@ -163,26 +163,22 @@ v8::Local<v8::Value> V8ValueConverter::ToV8ValueImpl(
return v8::Null(isolate);
case base::Value::Type::BOOLEAN: {
bool val = false;
value->GetAsBoolean(&val);
bool val = value->GetBool();
return v8::Boolean::New(isolate, val);
}
case base::Value::Type::INTEGER: {
int val = 0;
value->GetAsInteger(&val);
int val = value->GetInt();
return v8::Integer::New(isolate, val);
}
case base::Value::Type::DOUBLE: {
double val = 0.0;
value->GetAsDouble(&val);
double val = value->GetDouble();
return v8::Number::New(isolate, val);
}
case base::Value::Type::STRING: {
std::string val;
value->GetAsString(&val);
std::string val = value->GetString();
return v8::String::NewFromUtf8(isolate, val.c_str(),
v8::String::kNormalString, val.length());
}