alloy: Fix renderer crashes related to BadgeService (fixes issue #3005)

This commit is contained in:
Marshall Greenblatt 2022-10-20 12:49:29 -04:00
parent 1e4e18240d
commit a046794e68
2 changed files with 24 additions and 0 deletions

View File

@ -140,6 +140,7 @@
#include "storage/browser/quota/quota_settings.h"
#include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h"
#include "third_party/blink/public/common/web_preferences/web_preferences.h"
#include "third_party/blink/public/mojom/badging/badging.mojom.h"
#include "third_party/blink/public/mojom/prerender/prerender.mojom.h"
#include "third_party/blink/public/web/web_window_features.h"
#include "ui/base/l10n/l10n_util.h"
@ -377,6 +378,14 @@ void BindPluginInfoHost(
std::move(receiver));
}
void BindBadgeService(
content::RenderFrameHost* frame_host,
mojo::PendingReceiver<blink::mojom::BadgeService> receiver) {}
void BindBadgeServiceForServiceWorker(
const content::ServiceWorkerVersionBaseInfo& info,
mojo::PendingReceiver<blink::mojom::BadgeService> receiver) {}
void BindMediaFoundationRendererNotifierHandler(
content::RenderFrameHost* frame_host,
mojo::PendingReceiver<media::mojom::MediaFoundationRendererNotifier>
@ -1329,6 +1338,7 @@ void AlloyContentBrowserClient::RegisterBrowserInterfaceBindersForFrame(
CefBrowserFrame::RegisterBrowserInterfaceBindersForFrame(render_frame_host,
map);
map->Add<blink::mojom::BadgeService>(base::BindRepeating(&BindBadgeService));
map->Add<media::mojom::MediaFoundationRendererNotifier>(
base::BindRepeating(&BindMediaFoundationRendererNotifierHandler));
map->Add<network_hints::mojom::NetworkHintsHandler>(
@ -1358,6 +1368,15 @@ void AlloyContentBrowserClient::RegisterBrowserInterfaceBindersForFrame(
extension);
}
void AlloyContentBrowserClient::RegisterBrowserInterfaceBindersForServiceWorker(
content::BrowserContext* browser_context,
const content::ServiceWorkerVersionBaseInfo& service_worker_version_info,
mojo::BinderMapWithContext<const content::ServiceWorkerVersionBaseInfo&>*
map) {
map->Add<blink::mojom::BadgeService>(
base::BindRepeating(&BindBadgeServiceForServiceWorker));
}
base::FilePath
AlloyContentBrowserClient::GetSandboxedStorageServiceDataDirectory() {
return GetRootCachePath();

View File

@ -227,6 +227,11 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
void RegisterBrowserInterfaceBindersForFrame(
content::RenderFrameHost* render_frame_host,
mojo::BinderMapWithContext<content::RenderFrameHost*>* map) override;
void RegisterBrowserInterfaceBindersForServiceWorker(
content::BrowserContext* browser_context,
const content::ServiceWorkerVersionBaseInfo& service_worker_version_info,
mojo::BinderMapWithContext<const content::ServiceWorkerVersionBaseInfo&>*
map) override;
base::FilePath GetSandboxedStorageServiceDataDirectory() override;
std::string GetProduct() override;
std::string GetChromeProduct() override;