fix: properly pass openExternal activate option (#18657)

* fix: properly pass openExternal activate option

A reference to an OpenExternalOptions structure was being captured by an Objective-C block that
outlived the object that was being referenced.

* Fix test in CI

* Don't check for activate on linux

* Close BrowserWindow
This commit is contained in:
Jeremy Spiegel 2019-06-10 07:40:05 -07:00 committed by Shelley Vohr
parent 605cd9bec9
commit 64f7974252
2 changed files with 34 additions and 10 deletions

View file

@ -104,14 +104,15 @@ void OpenExternal(const GURL& url,
return;
}
bool activate = options.activate;
__block OpenExternalCallback c = std::move(callback);
dispatch_async(
dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
__block std::string error = OpenURL(ns_url, options.activate);
dispatch_async(dispatch_get_main_queue(), ^{
std::move(c).Run(error);
});
});
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0),
^{
__block std::string error = OpenURL(ns_url, activate);
dispatch_async(dispatch_get_main_queue(), ^{
std::move(c).Run(error);
});
});
}
bool MoveItemToTrash(const base::FilePath& full_path) {