Bug 1930676 - Part 3: Add skeleton PNotification functions r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D228681
This commit is contained in:
17
dom/notification/NotificationChild.cpp
Normal file
17
dom/notification/NotificationChild.cpp
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||||
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||||
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||||
|
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
|
#include "NotificationChild.h"
|
||||||
|
|
||||||
|
namespace mozilla::dom::notification {
|
||||||
|
|
||||||
|
using IPCResult = mozilla::ipc::IPCResult;
|
||||||
|
|
||||||
|
NotificationChild::NotificationChild() = default;
|
||||||
|
|
||||||
|
IPCResult NotificationChild::RecvNotifyClick() { return IPC_OK(); }
|
||||||
|
|
||||||
|
} // namespace mozilla::dom::notification
|
||||||
@@ -14,8 +14,15 @@ namespace mozilla::dom::notification {
|
|||||||
|
|
||||||
class NotificationChild final : public PNotificationChild,
|
class NotificationChild final : public PNotificationChild,
|
||||||
public SupportsWeakPtr {
|
public SupportsWeakPtr {
|
||||||
|
using IPCResult = mozilla::ipc::IPCResult;
|
||||||
|
|
||||||
NS_INLINE_DECL_REFCOUNTING(NotificationChild)
|
NS_INLINE_DECL_REFCOUNTING(NotificationChild)
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit NotificationChild();
|
||||||
|
|
||||||
|
IPCResult RecvNotifyClick();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
~NotificationChild() = default;
|
~NotificationChild() = default;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -208,6 +208,8 @@ nsresult NotificationParent::Show() {
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mozilla::ipc::IPCResult NotificationParent::RecvClose() { return IPC_OK(); }
|
||||||
|
|
||||||
nsresult NotificationParent::BindToMainThread(
|
nsresult NotificationParent::BindToMainThread(
|
||||||
Endpoint<PNotificationParent>&& aParentEndpoint,
|
Endpoint<PNotificationParent>&& aParentEndpoint,
|
||||||
PBackgroundParent::CreateNotificationParentResolver&& aResolver) {
|
PBackgroundParent::CreateNotificationParentResolver&& aResolver) {
|
||||||
|
|||||||
@@ -32,11 +32,10 @@ class NotificationParent final : public PNotificationParent,
|
|||||||
mIsSecureContext(aIsSecureContext),
|
mIsSecureContext(aIsSecureContext),
|
||||||
mId(aId),
|
mId(aId),
|
||||||
mScope(aScope),
|
mScope(aScope),
|
||||||
mOptions(aOptions) {
|
mOptions(aOptions) {};
|
||||||
MOZ_ASSERT(!mScope.IsEmpty(), "Only for persistent notifications for now");
|
|
||||||
};
|
|
||||||
|
|
||||||
IPCResult RecvShow(ShowResolver&& aResolver);
|
IPCResult RecvShow(ShowResolver&& aResolver);
|
||||||
|
IPCResult RecvClose();
|
||||||
|
|
||||||
nsresult BindToMainThread(
|
nsresult BindToMainThread(
|
||||||
Endpoint<PNotificationParent>&& aParentEndpoint,
|
Endpoint<PNotificationParent>&& aParentEndpoint,
|
||||||
|
|||||||
@@ -16,6 +16,10 @@ namespace notification {
|
|||||||
async protocol PNotification {
|
async protocol PNotification {
|
||||||
parent:
|
parent:
|
||||||
async Show() returns (CopyableErrorResult rv);
|
async Show() returns (CopyableErrorResult rv);
|
||||||
|
async Close();
|
||||||
|
|
||||||
|
child:
|
||||||
|
async NotifyClick();
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace notification
|
} // namespace notification
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ EXPORTS.mozilla.dom.notification += [
|
|||||||
|
|
||||||
UNIFIED_SOURCES += [
|
UNIFIED_SOURCES += [
|
||||||
"Notification.cpp",
|
"Notification.cpp",
|
||||||
|
"NotificationChild.cpp",
|
||||||
"NotificationEvent.cpp",
|
"NotificationEvent.cpp",
|
||||||
"NotificationParent.cpp",
|
"NotificationParent.cpp",
|
||||||
"NotificationUtils.cpp",
|
"NotificationUtils.cpp",
|
||||||
|
|||||||
Reference in New Issue
Block a user