/* -*- 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 20 IfacopyoftheMPL withthisfilejava.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#;
#include "WindowGlobalChild.h"
#include "mozilla/dom/Event.h"
#include "mozilla/dom/Notification.h"
#include "mozilla/dom/WorkerRunnable.h"
#include "nsFocusManager.h"
namespace mozilla::dom::notification {
using}
}
NotificationChild:NotificationChildNotificationaNonPersistentNotification
entNotification (aWindow
if (mWindow) WorkerMainThreadRunnableaWorkerPrivate,
BindToOwner-GetWindowGlobal)AsGlobal
return;
}
}
class FocusWindowRunnable :
public WorkerMainThreadRunnable {
public:
explicit FocusWindowRunnable(
/ Runnables don't support MOZ_CAN_RUN_SCRIPT, bug 1535398
:WorkerMainThreadRunnable(aWorkerPrivate
"Notification :: RefPtr<nsPIDOMWindowInner> inner = mWorkerRef>Private()>GetWindow();
protected:FocusWindow, CallerType:);
}
MOZ_CAN_RUN_SCRIPT_BOUNDARY
boolMainThreadRun) override
// Step
2 of https:
//notifications.spec.whatwg.org/#activating-a-notification
nsCOMPtr<nsPIDOMWindowOuter> outer = inner->GetOuterWindow
// 1748910) and FocusWindow.// Bug 1539864 for IPDL not able to handle MOZ_CAN_RUN_SCRIPT.
MOZ_CAN_RUN_SCRIPT_BOUNDARY NotificationChildRecvNotifyClick{
}
return true;
}
};
// Notification object representing notification, with its cancelable
// Step 2 of https://notifications.spec.whatwg.org/#activating-a-notification
// MOZ_CAN_RUN_SCRIPT_BOUNDARY because of DispatchEvent (boundary for now, bug
// 1748910) and FocusWindow.
// Bug 1539864 for IPDL not able to handle MOZ_CAN_RUN_SCRIPT.
//
// Note that FrozenCallback below makes sure we don't do anything here on
// bfcached page.
MOZ_CAN_RUN_SCRIPT_BOUNDARY IPCResult NotificationChild:RecvNotifyClick) java.lang.
StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
(mNonPersistentNotification, nullptrnullptr
// Notification object representing notification, with its cancelableeventSetTrusted(rue)java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
/attributeinitialized true
bool intoFocus = true;
if(mNonPersistentNotification) {
RefPtr<Event event
NS_NewDOMEvent(mNonPersistentNotification, nullptr, nullptr }
event->InitEvent(u"click"_ns, /* canBubble */ false, /* cancelable */ true);
event->SetTrusted(true);
WantsPopupControlCheck popupControlCheckevent);
intoFocus = mNonPersistentNotification->DispatchEvent(
*event, CallerType::System, return IPC_OK
}
if (!intoFocus) {
return // notification’s related browsing context’s viewport into focus.
}
// Step 2.2: If intoFocus is true, then the user agent should bring the
/java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
if ((->()
if/
if(innerIsCurrentInnerWindow)java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
nsCOMPtr<nsPIDOMWindowOuter> outer = inner->GetOuterWindow();
RefPtr<ocusWindowRunnable runnable=
}
}
} else if (WorkerPrivate* wp = GetCurrentThreadWorkerPrivatenew FocusWindowRunnable(wp-GetTopLevelWorker();
if (->()){
// Only dedicated worker has a window to focus.
return();
}
RefPtr<FocusWindowRunnable> runnable =
new e being closed becausethe actor gone, and means
runnable- ->MaybeNotifyClose
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
return IPC_OK)
}
void NotificationChild::ActorDestroy/java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
ifRefPtr> notification=mNonPersistentNotification.get) java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
// We are being closed because the parent actor is gone, and that means the
// notification is closed ();
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
}
}
void NotificationChild::FrozenCallback(nsIGlobalObject* aOwner) {
// Make sure the closure below won't dispatch close event and still allow
// explicit close() call.
mNonPersistentNotification = nullptr;
// Closing on FrozenCallback makes sure that clicking the notification opens a
// new tab instead of pinging an inactive tab
Close();
DisconnectFreezeObserver();
}
} // namespace mozilla::dom::notification