diff --git a/atom/browser/browser_mac.mm b/atom/browser/browser_mac.mm index 19b27416a16d..27e347eccebf 100644 --- a/atom/browser/browser_mac.mm +++ b/atom/browser/browser_mac.mm @@ -336,10 +336,9 @@ void Browser::SetAboutPanelOptions(const base::DictionaryValue& options) { for (base::DictionaryValue::Iterator iter(options); !iter.IsAtEnd(); iter.Advance()) { std::string key = iter.key(); - std::string value; - if (!key.empty() && iter.value().GetAsString(&value)) { + if (!key.empty() && iter.value().is_string()) { key[0] = base::ToUpperASCII(key[0]); - about_panel_options_.SetString(key, value); + about_panel_options_.SetString(key, iter.value().GetString()); } } } diff --git a/atom/browser/net/atom_network_delegate.cc b/atom/browser/net/atom_network_delegate.cc index 10bb5d648291..c142f87c1f5e 100644 --- a/atom/browser/net/atom_network_delegate.cc +++ b/atom/browser/net/atom_network_delegate.cc @@ -183,9 +183,10 @@ void ReadFromResponseObject(const base::DictionaryValue& response, headers->Clear(); for (base::DictionaryValue::Iterator it(*dict); !it.IsAtEnd(); it.Advance()) { - std::string value; - if (it.value().GetAsString(&value)) + if (it.value().is_string()) { + std::string value = it.value().GetString(); headers->SetHeader(it.key(), value); + } } } } diff --git a/atom/browser/net/js_asker.cc b/atom/browser/net/js_asker.cc index daf978082f10..59e3ab881c23 100644 --- a/atom/browser/net/js_asker.cc +++ b/atom/browser/net/js_asker.cc @@ -62,8 +62,8 @@ bool IsErrorOptions(base::Value* value, int* error) { if (dict->GetInteger("error", error)) return true; } else if (value->is_int()) { - if (value->GetAsInteger(error)) - return true; + *error = value->GetInt(); + return true; } return false; } diff --git a/atom/browser/net/url_request_async_asar_job.cc b/atom/browser/net/url_request_async_asar_job.cc index 06959032411d..07962f44f918 100644 --- a/atom/browser/net/url_request_async_asar_job.cc +++ b/atom/browser/net/url_request_async_asar_job.cc @@ -7,6 +7,7 @@ #include #include "atom/common/atom_constants.h" +#include "base/strings/utf_string_conversions.h" #include "base/task_scheduler/post_task.h" namespace atom { @@ -17,12 +18,13 @@ URLRequestAsyncAsarJob::URLRequestAsyncAsarJob( : JsAsker(request, network_delegate) {} void URLRequestAsyncAsarJob::StartAsync(std::unique_ptr options) { - base::FilePath::StringType file_path; + std::string file_path; if (options->is_dict()) { - static_cast(options.get()) - ->GetString("path", &file_path); + auto path_value = options->FindKeyOfType("path", base::Value::Type::STRING); + if (path_value) + file_path = path_value->GetString(); } else if (options->is_string()) { - options->GetAsString(&file_path); + file_path = options->GetString(); } if (file_path.empty()) { @@ -33,7 +35,11 @@ void URLRequestAsyncAsarJob::StartAsync(std::unique_ptr options) { base::CreateSequencedTaskRunnerWithTraits( {base::MayBlock(), base::TaskPriority::USER_VISIBLE, base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}), +#if defined(OS_WIN) + base::FilePath(base::UTF8ToWide(file_path))); +#else base::FilePath(file_path)); +#endif asar::URLRequestAsarJob::Start(); } } diff --git a/atom/browser/net/url_request_string_job.cc b/atom/browser/net/url_request_string_job.cc index 453dd0bb6615..31381ff11866 100644 --- a/atom/browser/net/url_request_string_job.cc +++ b/atom/browser/net/url_request_string_job.cc @@ -25,7 +25,7 @@ void URLRequestStringJob::StartAsync(std::unique_ptr options) { dict->GetString("charset", &charset_); dict->GetString("data", &data_); } else if (options->is_string()) { - options->GetAsString(&data_); + data_ = options->GetString(); } net::URLRequestSimpleJob::Start(); } diff --git a/atom/common/native_mate_converters/v8_value_converter.cc b/atom/common/native_mate_converters/v8_value_converter.cc index 029742316ce9..3fa070771d68 100644 --- a/atom/common/native_mate_converters/v8_value_converter.cc +++ b/atom/common/native_mate_converters/v8_value_converter.cc @@ -163,26 +163,22 @@ v8::Local 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()); }