From 5232a68708857e8d3262747a765ef19a082572ad Mon Sep 17 00:00:00 2001 From: Ivan Efremov Date: Mon, 28 Oct 2024 18:40:40 +0700 Subject: [PATCH] Backport an upstream fix for geolocation crash. Backport of https://chromium-review.googlesource.com/c/chromium/src/+/5840695 Fixes https://github.com/brave/brave-browser/issues/41859 --- ...r-modules-geolocation-geolocation.cc.patch | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 patches/third_party-blink-renderer-modules-geolocation-geolocation.cc.patch diff --git a/patches/third_party-blink-renderer-modules-geolocation-geolocation.cc.patch b/patches/third_party-blink-renderer-modules-geolocation-geolocation.cc.patch new file mode 100644 index 000000000000..f210b5587e37 --- /dev/null +++ b/patches/third_party-blink-renderer-modules-geolocation-geolocation.cc.patch @@ -0,0 +1,21 @@ +diff --git a/third_party/blink/renderer/modules/geolocation/geolocation.cc b/third_party/blink/renderer/modules/geolocation/geolocation.cc +index 223049e27395830a64f80ac67ccf435793e3f1e3..c7d247a700167f8215648bcb4fd43836f8507b40 100644 +--- a/third_party/blink/renderer/modules/geolocation/geolocation.cc ++++ b/third_party/blink/renderer/modules/geolocation/geolocation.cc +@@ -90,10 +90,12 @@ GeolocationPositionError* CreatePositionError( + error_code = GeolocationPositionError::kPositionUnavailable; + break; + default: +- // On Blink side, it should only handles W3C defined error codes. +- // If it reaches here that means an unexpected error type being propagated +- // to Blink. This should never happen. +- NOTREACHED_NORETURN(); ++ // On the Blink side, it should only handle W3C-defined error codes. If it ++ // reaches here, that means a platform-specific error type is being ++ // propagated to Blink. We will now just use kPositionUnavailable until ++ // more explicit error codes are defined in the W3C spec. ++ error_code = GeolocationPositionError::kPositionUnavailable; ++ break; + } + return MakeGarbageCollected(error_code, + error.error_message);