diff --git a/atom/browser/net/js_asker.cc b/atom/browser/net/js_asker.cc index 7b5e20631aaf..daf978082f10 100644 --- a/atom/browser/net/js_asker.cc +++ b/atom/browser/net/js_asker.cc @@ -57,11 +57,11 @@ void AskForOptions(v8::Isolate* isolate, } bool IsErrorOptions(base::Value* value, int* error) { - if (value->IsType(base::Value::Type::DICTIONARY)) { + if (value->is_dict()) { base::DictionaryValue* dict = static_cast(value); if (dict->GetInteger("error", error)) return true; - } else if (value->IsType(base::Value::Type::INTEGER)) { + } else if (value->is_int()) { if (value->GetAsInteger(error)) return true; } diff --git a/atom/browser/net/url_request_async_asar_job.cc b/atom/browser/net/url_request_async_asar_job.cc index a51e08e486bf..06959032411d 100644 --- a/atom/browser/net/url_request_async_asar_job.cc +++ b/atom/browser/net/url_request_async_asar_job.cc @@ -18,10 +18,10 @@ URLRequestAsyncAsarJob::URLRequestAsyncAsarJob( void URLRequestAsyncAsarJob::StartAsync(std::unique_ptr options) { base::FilePath::StringType file_path; - if (options->IsType(base::Value::Type::DICTIONARY)) { + if (options->is_dict()) { static_cast(options.get()) ->GetString("path", &file_path); - } else if (options->IsType(base::Value::Type::STRING)) { + } else if (options->is_string()) { options->GetAsString(&file_path); } diff --git a/atom/browser/net/url_request_buffer_job.cc b/atom/browser/net/url_request_buffer_job.cc index 18fd4e5e822c..750099c99a76 100644 --- a/atom/browser/net/url_request_buffer_job.cc +++ b/atom/browser/net/url_request_buffer_job.cc @@ -35,13 +35,13 @@ URLRequestBufferJob::~URLRequestBufferJob() = default; void URLRequestBufferJob::StartAsync(std::unique_ptr options) { const base::Value* binary = nullptr; - if (options->IsType(base::Value::Type::DICTIONARY)) { + if (options->is_dict()) { base::DictionaryValue* dict = static_cast(options.get()); dict->GetString("mimeType", &mime_type_); dict->GetString("charset", &charset_); dict->GetBinary("data", &binary); - } else if (options->IsType(base::Value::Type::BINARY)) { + } else if (options->is_blob()) { binary = options.get(); } diff --git a/atom/browser/net/url_request_fetch_job.cc b/atom/browser/net/url_request_fetch_job.cc index 5d3be1e455c3..09f7277ab659 100644 --- a/atom/browser/net/url_request_fetch_job.cc +++ b/atom/browser/net/url_request_fetch_job.cc @@ -109,7 +109,7 @@ void URLRequestFetchJob::BeforeStartInUI(v8::Isolate* isolate, } void URLRequestFetchJob::StartAsync(std::unique_ptr options) { - if (!options->IsType(base::Value::Type::DICTIONARY)) { + if (!options->is_dict()) { NotifyStartError(net::URLRequestStatus(net::URLRequestStatus::FAILED, net::ERR_NOT_IMPLEMENTED)); return; diff --git a/atom/browser/net/url_request_string_job.cc b/atom/browser/net/url_request_string_job.cc index 82d76d2854a2..453dd0bb6615 100644 --- a/atom/browser/net/url_request_string_job.cc +++ b/atom/browser/net/url_request_string_job.cc @@ -18,13 +18,13 @@ URLRequestStringJob::URLRequestStringJob(net::URLRequest* request, URLRequestStringJob::~URLRequestStringJob() = default; void URLRequestStringJob::StartAsync(std::unique_ptr options) { - if (options->IsType(base::Value::Type::DICTIONARY)) { + if (options->is_dict()) { base::DictionaryValue* dict = static_cast(options.get()); dict->GetString("mimeType", &mime_type_); dict->GetString("charset", &charset_); dict->GetString("data", &data_); - } else if (options->IsType(base::Value::Type::STRING)) { + } else if (options->is_string()) { options->GetAsString(&data_); } net::URLRequestSimpleJob::Start(); diff --git a/atom/common/asar/archive.cc b/atom/common/asar/archive.cc index d46537c05695..769efec0a2b0 100644 --- a/atom/common/asar/archive.cc +++ b/atom/common/asar/archive.cc @@ -188,7 +188,7 @@ bool Archive::Init() { std::string error; base::JSONReader reader; std::unique_ptr value(reader.ReadToValue(header)); - if (!value || !value->IsType(base::Value::Type::DICTIONARY)) { + if (!value || !value->is_dict()) { LOG(ERROR) << "Failed to parse header: " << error; return false; } diff --git a/atom/common/native_mate_converters/v8_value_converter.cc b/atom/common/native_mate_converters/v8_value_converter.cc index 9253896fec51..929f3328e9c8 100644 --- a/atom/common/native_mate_converters/v8_value_converter.cc +++ b/atom/common/native_mate_converters/v8_value_converter.cc @@ -481,7 +481,7 @@ base::Value* V8ValueConverter::FromV8Object(v8::Local val, // there *is* a "windowId" property, but since it should be an int, code // on the browser which doesn't additionally check for null will fail. // We can avoid all bugs related to this by stripping null. - if (strip_null_from_objects_ && child->IsType(base::Value::Type::NONE)) + if (strip_null_from_objects_ && child->is_none()) continue; result->SetWithoutPathExpansion(std::string(*name_utf8, name_utf8.length()), diff --git a/atom/common/native_mate_converters/value_converter.cc b/atom/common/native_mate_converters/value_converter.cc index 552c598b24ca..0412a0118f2b 100644 --- a/atom/common/native_mate_converters/value_converter.cc +++ b/atom/common/native_mate_converters/value_converter.cc @@ -15,7 +15,7 @@ bool Converter::FromV8(v8::Isolate* isolate, atom::V8ValueConverter converter; std::unique_ptr value( converter.FromV8Value(val, isolate->GetCurrentContext())); - if (value && value->IsType(base::Value::Type::DICTIONARY)) { + if (value && value->is_dict()) { out->Swap(static_cast(value.get())); return true; } else { @@ -36,7 +36,7 @@ bool Converter::FromV8(v8::Isolate* isolate, atom::V8ValueConverter converter; std::unique_ptr value( converter.FromV8Value(val, isolate->GetCurrentContext())); - if (value->IsType(base::Value::Type::LIST)) { + if (value->is_list()) { out->Swap(static_cast(value.get())); return true; } else {