chore: clean up promise resoution with helpers (#17268)

This commit is contained in:
Shelley Vohr 2019-03-13 14:30:21 -07:00 committed by GitHub
parent 3e5a98b5f4
commit d9234798d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 26 additions and 52 deletions

View file

@ -1300,11 +1300,12 @@ v8::Local<v8::Promise> WebContents::SavePage(
const base::FilePath& full_file_path,
const content::SavePageType& save_type) {
util::Promise promise(isolate());
v8::Local<v8::Promise> ret = promise.GetHandle();
v8::Local<v8::Promise> handle = promise.GetHandle();
auto* handler = new SavePageHandler(web_contents(), std::move(promise));
handler->Handle(full_file_path, save_type);
return ret;
return handle;
}
void WebContents::OpenDevTools(mate::Arguments* args) {