Commit 3939b423 authored by Dan Elphick's avatar Dan Elphick Committed by Commit Bot

[cleanup] fix ChromeOs uses of ToBoolean/ToObject

Remove uses of deprecated functions in
file_browser_handler_custom_bindings.cc, replacing ToObject() on a
known Object with .As<v8::Object>() and use the Context form of
ToBoolean along with FromMaybe(false)

Bug: v8:7786
Change-Id: Ib4726f5ae77797c736e35d36ae0ca25f50808a0a
Reviewed-on: https://chromium-review.googlesource.com/1172436Reviewed-by: default avatarDevlin <rdevlin.cronin@chromium.org>
Commit-Queue: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#582864}
parent d9c598b7
......@@ -35,7 +35,7 @@ void FileBrowserHandlerCustomBindings::GetExternalFileEntry(
#if defined(OS_CHROMEOS)
CHECK(args.Length() == 1);
CHECK(args[0]->IsObject());
v8::Local<v8::Object> file_def = args[0]->ToObject();
v8::Local<v8::Object> file_def = args[0].As<v8::Object>();
v8::Isolate* isolate = args.GetIsolate();
std::string file_system_name(*v8::String::Utf8Value(
isolate,
......@@ -48,8 +48,8 @@ void FileBrowserHandlerCustomBindings::GetExternalFileEntry(
file_def->Get(v8::String::NewFromUtf8(isolate, "fileFullPath"))));
bool is_directory =
file_def->Get(v8::String::NewFromUtf8(isolate, "fileIsDirectory"))
->ToBoolean()
->Value();
->BooleanValue(context->v8_context())
.FromMaybe(false);
blink::WebDOMFileSystem::EntryType entry_type =
is_directory ? blink::WebDOMFileSystem::kEntryTypeDirectory
: blink::WebDOMFileSystem::kEntryTypeFile;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment