fix: geolocation crashes electron on macOS (#29343) (#29913)

This commit is contained in:
Omar Kilani 2021-06-28 20:26:57 -07:00 committed by GitHub
parent 9142563748
commit 1b4ce6c69a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 44 additions and 1 deletions

View file

@ -7,6 +7,7 @@
#include "base/mac/bundle_locations.h"
#include "base/mac/foundation_util.h"
#include "base/path_service.h"
#include "services/device/public/cpp/geolocation/geolocation_manager_impl_mac.h"
#import "shell/browser/mac/electron_application.h"
#include "shell/browser/mac/electron_application_delegate.h"
#include "shell/common/electron_paths.h"
@ -27,6 +28,8 @@ void ElectronBrowserMainParts::PreCreateMainMessageLoop() {
[[NSUserDefaults standardUserDefaults]
setObject:@"NO"
forKey:@"NSTreatUnknownArgumentsAsOpen"];
geolocation_manager_ = device::GeolocationManagerImpl::Create();
}
void ElectronBrowserMainParts::FreeAppDelegate() {