Bug 1789636 - Remove unused ContentListener class, Send/RecvEvent and RemoteDOMEvent, r=aiunusov

Differential Revision: https://phabricator.services.mozilla.com/D156687
This commit is contained in:
Olli Pettay 2022-09-07 20:17:49 +00:00
parent 663d7bf785
commit 4a178ce537
9 changed files with 0 additions and 103 deletions

View File

@ -166,8 +166,6 @@ using namespace mozilla::layout;
using namespace mozilla::widget;
using mozilla::layers::GeckoContentController;
NS_IMPL_ISUPPORTS(ContentListener, nsIDOMEventListener)
static const char BEFORE_FIRST_PAINT[] = "before-first-paint";
static uint32_t sConsecutiveTouchMoveCount = 0;
@ -210,15 +208,6 @@ bool BrowserChild::UpdateFrame(const RepaintRequest& aRequest) {
return true;
}
NS_IMETHODIMP
ContentListener::HandleEvent(Event* aEvent) {
RemoteDOMEvent remoteEvent;
remoteEvent.mEvent = aEvent;
NS_ENSURE_STATE(remoteEvent.mEvent);
mBrowserChild->SendEvent(remoteEvent);
return NS_OK;
}
class BrowserChild::DelayedDeleteRunnable final : public Runnable,
public nsIRunnablePriority {
RefPtr<BrowserChild> mBrowserChild;

View File

@ -133,17 +133,6 @@ class BrowserChildMessageManager : public ContentFrameMessageManager,
~BrowserChildMessageManager();
};
class ContentListener final : public nsIDOMEventListener {
public:
explicit ContentListener(BrowserChild* aBrowserChild)
: mBrowserChild(aBrowserChild) {}
NS_DECL_ISUPPORTS
NS_DECL_NSIDOMEVENTLISTENER
protected:
~ContentListener() = default;
BrowserChild* mBrowserChild;
};
/**
* BrowserChild implements the child actor part of the PBrowser protocol. See
* PBrowser for more information.

View File

@ -868,21 +868,6 @@ mozilla::ipc::IPCResult BrowserParent::RecvDropLinks(
return IPC_OK();
}
mozilla::ipc::IPCResult BrowserParent::RecvEvent(const RemoteDOMEvent& aEvent) {
NS_ENSURE_TRUE(xpc::IsInAutomation(), IPC_FAIL(this, "Unexpected event"));
RefPtr<Event> event = aEvent.mEvent;
NS_ENSURE_TRUE(event, IPC_OK());
RefPtr<EventTarget> target = mFrameElement;
NS_ENSURE_TRUE(target, IPC_OK());
event->SetOwner(target);
target->DispatchEvent(*event);
return IPC_OK();
}
bool BrowserParent::SendLoadRemoteScript(const nsAString& aURL,
const bool& aRunInGlobalScope) {
if (mCreatingWindow) {

View File

@ -273,8 +273,6 @@ class BrowserParent final : public PBrowserParent,
mozilla::ipc::IPCResult RecvDropLinks(nsTArray<nsString>&& aLinks);
mozilla::ipc::IPCResult RecvEvent(const RemoteDOMEvent& aEvent);
// TODO: Use MOZ_CAN_RUN_SCRIPT when it gains IPDL support (bug 1539864)
MOZ_CAN_RUN_SCRIPT_BOUNDARY mozilla::ipc::IPCResult RecvReplyKeyEvent(
const WidgetKeyboardEvent& aEvent, const nsID& aUUID);

View File

@ -265,8 +265,6 @@ parent:
*/
async DropLinks(nsString[] aLinks);
async Event(RemoteDOMEvent aEvent);
sync SyncMessage(nsString aMessage, ClonedMessageData aData)
returns (StructuredCloneData[] retval);

View File

@ -10,12 +10,6 @@
#include "mozilla/RefPtr.h"
namespace mozilla::dom {
class Event;
struct RemoteDOMEvent {
// Make sure to set the owner after deserializing.
RefPtr<Event> mEvent;
};
enum class EmbedderElementEventType {
NoEvent,

View File

@ -1,33 +0,0 @@
/* -*- 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 "mozilla/Assertions.h"
#include "mozilla/EventDispatcher.h"
#include "mozilla/dom/Event.h"
#include "mozilla/dom/TabMessageUtils.h"
#include "nsCOMPtr.h"
namespace mozilla::dom {
bool ReadRemoteEvent(IPC::MessageReader* aReader, RemoteDOMEvent* aResult) {
aResult->mEvent = nullptr;
nsString type;
NS_ENSURE_TRUE(ReadParam(aReader, &type), false);
aResult->mEvent =
EventDispatcher::CreateEvent(nullptr, nullptr, nullptr, type);
// In a controlled environment, we should always have a valid event.
bool ret = false;
if (aResult->mEvent) {
ret = aResult->mEvent->Deserialize(aReader);
}
MOZ_ASSERT_UNLESS_FUZZING(ret);
return ret;
}
} // namespace mozilla::dom

View File

@ -18,30 +18,8 @@
#include "TabMessageTypes.h"
#include "X11UndefineNone.h"
namespace mozilla::dom {
bool ReadRemoteEvent(IPC::MessageReader* aReader,
mozilla::dom::RemoteDOMEvent* aResult);
} // namespace mozilla::dom
namespace IPC {
template <>
struct ParamTraits<mozilla::dom::RemoteDOMEvent> {
typedef mozilla::dom::RemoteDOMEvent paramType;
static void Write(MessageWriter* aWriter, const paramType& aParam) {
aParam.mEvent->Serialize(aWriter, true);
}
static bool Read(MessageReader* aReader, paramType* aResult) {
return mozilla::dom::ReadRemoteEvent(aReader, aResult);
}
static void Log(const paramType& aParam, std::wstring* aLog) {}
};
template <>
struct ParamTraits<nsSizeMode>
: public ContiguousEnumSerializer<nsSizeMode, nsSizeMode_Normal,

View File

@ -133,7 +133,6 @@ UNIFIED_SOURCES += [
"SharedStringMap.cpp",
"StructuredCloneData.cpp",
"TabContext.cpp",
"TabMessageUtils.cpp",
"URLClassifierParent.cpp",
"WindowGlobalActor.cpp",
"WindowGlobalChild.cpp",