Bug 1834874 - P2: Remove DocAccessiblePlatformExt. r=Jamie,ipc-reviewers,mccr8

Since we removed the last dependency on this subprotocol, we can now
remove it.

Differential Revision: https://phabricator.services.mozilla.com/D181321
This commit is contained in:
Eitan Isaacson 2023-06-20 18:15:43 +00:00
parent 85a5ad4790
commit b3cea24dfd
23 changed files with 1 additions and 327 deletions

View File

@ -17,7 +17,6 @@
#include "SessionAccessibility.h"
#include "TraversalRule.h"
#include "mozilla/PresShell.h"
#include "mozilla/a11y/DocAccessiblePlatformExtChild.h"
using namespace mozilla;
using namespace mozilla::a11y;

View File

@ -25,7 +25,6 @@
#include "mozilla/dom/DocumentInlines.h"
#include "mozilla/a11y/Accessible.h"
#include "mozilla/a11y/DocAccessibleParent.h"
#include "mozilla/a11y/DocAccessiblePlatformExtParent.h"
#include "mozilla/a11y/DocManager.h"
#include "mozilla/a11y/HyperTextAccessibleBase.h"
#include "mozilla/jni/GeckoBundleUtils.h"
@ -55,18 +54,6 @@
} \
}
#define FORWARD_EXT_ACTION_TO_ACCESSIBLE(funcname, ...) \
MOZ_ASSERT(NS_IsMainThread()); \
MonitorAutoLock mal(nsAccessibilityService::GetAndroidMonitor()); \
if (Accessible* acc = GetAccessibleByID(aID)) { \
if (RemoteAccessible* remote = acc->AsRemote()) { \
Unused << remote->Document()->GetPlatformExtension()->Send##funcname( \
remote->ID(), ##__VA_ARGS__); \
} else { \
static_cast<AccessibleWrap*>(acc->AsLocal())->funcname(__VA_ARGS__); \
} \
}
using namespace mozilla::a11y;
// IDs should be a positive 32bit integer.
@ -354,7 +341,6 @@ void SessionAccessibility::Paste(int32_t aID) {
}
#undef FORWARD_ACTION_TO_ACCESSIBLE
#undef FORWARD_EXT_ACTION_TO_ACCESSIBLE
RefPtr<SessionAccessibility> SessionAccessibility::GetInstanceFor(
Accessible* aAccessible) {

View File

@ -991,9 +991,6 @@ void NotificationController::WillRefresh(mozilla::TimeStamp aTime) {
->SendPDocAccessibleConstructor(
ipcDoc, parentIPCDoc, id,
childDoc->DocumentNode()->GetBrowsingContext());
#ifndef XP_WIN
ipcDoc->SendPDocAccessiblePlatformExtConstructor();
#endif
}
}
}

View File

@ -1627,9 +1627,6 @@ void DocAccessible::DoInitialUpdate() {
browserChild->SendPDocAccessibleConstructor(
ipcDoc, nullptr, 0, mDocumentNode->GetBrowsingContext());
#if !defined(XP_WIN)
ipcDoc->SendPDocAccessiblePlatformExtConstructor();
#endif
}
}
}

View File

@ -24,8 +24,6 @@
#if defined(XP_WIN)
# include "Compatibility.h"
# include "nsWinUtils.h"
#else
# include "mozilla/a11y/DocAccessiblePlatformExtParent.h"
#endif
#if defined(ANDROID)
@ -1108,25 +1106,6 @@ mozilla::ipc::IPCResult DocAccessibleParent::RecvFocusEvent(
#endif // defined(XP_WIN)
#if !defined(XP_WIN)
bool DocAccessibleParent::DeallocPDocAccessiblePlatformExtParent(
PDocAccessiblePlatformExtParent* aActor) {
delete aActor;
return true;
}
PDocAccessiblePlatformExtParent*
DocAccessibleParent::AllocPDocAccessiblePlatformExtParent() {
return new DocAccessiblePlatformExtParent();
}
DocAccessiblePlatformExtParent* DocAccessibleParent::GetPlatformExtension() {
return static_cast<DocAccessiblePlatformExtParent*>(
SingleManagedOrNull(ManagedPDocAccessiblePlatformExtParent()));
}
#endif // !defined(XP_WIN)
void DocAccessibleParent::SelectionRanges(nsTArray<TextRange>* aRanges) const {
for (const auto& data : mTextSelections) {
// Selection ranges should usually be in sync with the tree. However, tree

View File

@ -25,10 +25,6 @@ namespace a11y {
class TextRange;
class xpcAccessibleGeneric;
#if !defined(XP_WIN)
class DocAccessiblePlatformExtParent;
#endif
/*
* These objects live in the main process and comunicate with and represent
* an accessible document in a content process.
@ -267,16 +263,6 @@ class DocAccessibleParent : public RemoteAccessible,
HWND GetEmulatedWindowHandle() const { return mEmulatedWindowHandle; }
#endif
#if !defined(XP_WIN)
virtual bool DeallocPDocAccessiblePlatformExtParent(
PDocAccessiblePlatformExtParent* aActor) override;
virtual PDocAccessiblePlatformExtParent*
AllocPDocAccessiblePlatformExtParent() override;
DocAccessiblePlatformExtParent* GetPlatformExtension();
#endif
// Accessible
virtual Accessible* Parent() const override {
if (IsTopLevel()) {

View File

@ -1,33 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=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 "DocAccessiblePlatformExtChild.h"
#include "DocAccessibleChild.h"
#include "AccessibleWrap.h"
namespace mozilla {
namespace a11y {
mozilla::ipc::IPCResult DocAccessiblePlatformExtChild::RecvNavigateText(
uint64_t aID, int32_t aGranularity, int32_t aStartOffset,
int32_t aEndOffset, bool aForward, bool aSelect) {
if (auto acc = IdToAccessibleWrap(aID)) {
acc->NavigateText(aGranularity, aStartOffset, aEndOffset, aForward,
aSelect);
}
return IPC_OK();
}
AccessibleWrap* DocAccessiblePlatformExtChild::IdToAccessibleWrap(
const uint64_t& aID) const {
return static_cast<AccessibleWrap*>(
static_cast<DocAccessibleChild*>(Manager())->IdToAccessible(aID));
}
} // namespace a11y
} // namespace mozilla

View File

@ -1,30 +0,0 @@
/* vim: set ts=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/. */
#ifndef mozilla_a11y_DocAccessiblePlatformExtChild_h
#define mozilla_a11y_DocAccessiblePlatformExtChild_h
#include "mozilla/a11y/PDocAccessiblePlatformExtChild.h"
namespace mozilla {
namespace a11y {
class AccessibleWrap;
class DocAccessibleChild;
class DocAccessiblePlatformExtChild : public PDocAccessiblePlatformExtChild {
public:
mozilla::ipc::IPCResult RecvNavigateText(uint64_t aID, int32_t aGranularity,
int32_t aStartOffset,
int32_t aEndOffset, bool aForward,
bool aSelect);
private:
AccessibleWrap* IdToAccessibleWrap(const uint64_t& aID) const;
};
} // namespace a11y
} // namespace mozilla
#endif

View File

@ -1,16 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=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 "DocAccessiblePlatformExtParent.h"
#include "AccessibleWrap.h"
#include "SessionAccessibility.h"
#include "mozilla/a11y/DocAccessibleParent.h"
namespace mozilla {
namespace a11y {} // namespace a11y
} // namespace mozilla

View File

@ -1,18 +0,0 @@
/* vim: set ts=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/. */
#ifndef mozilla_a11y_DocAccessiblePlatformExtParent_h
#define mozilla_a11y_DocAccessiblePlatformExtParent_h
#include "mozilla/a11y/PDocAccessiblePlatformExtParent.h"
namespace mozilla {
namespace a11y {
class DocAccessiblePlatformExtParent : public PDocAccessiblePlatformExtParent {
};
} // namespace a11y
} // namespace mozilla
#endif

View File

@ -1,22 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=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 protocol PDocAccessible;
namespace mozilla {
namespace a11y {
[ManualDealloc]
protocol PDocAccessiblePlatformExt {
manager PDocAccessible;
child:
async __delete__();
async NavigateText(uint64_t aID, int32_t aGranularity, int32_t aStartOffset, int32_t aEndOffset, bool aForward, bool aSelect);
};
}
}

View File

@ -1,28 +0,0 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# 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/.
if CONFIG["ACCESSIBILITY"]:
IPDL_SOURCES += ["PDocAccessiblePlatformExt.ipdl"]
EXPORTS.mozilla.a11y += [
"DocAccessiblePlatformExtChild.h",
"DocAccessiblePlatformExtParent.h",
]
SOURCES += [
"DocAccessiblePlatformExtChild.cpp",
]
LOCAL_INCLUDES += [
"/accessible/android",
"/accessible/generic",
"/accessible/ipc/other",
"/widget/android",
]
include("/ipc/chromium/chromium-config.mozbuild")
FINAL_LIBRARY = "xul"

View File

@ -1,12 +0,0 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# 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/.
toolkit = CONFIG["MOZ_WIDGET_TOOLKIT"]
if toolkit == "android":
DIRS += ["android"]
else:
DIRS += ["other"]

View File

@ -1,20 +0,0 @@
/* vim: set ts=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/. */
#ifndef mozilla_a11y_DocAccessiblePlatformExtChild_h
#define mozilla_a11y_DocAccessiblePlatformExtChild_h
#include "mozilla/a11y/PDocAccessiblePlatformExtChild.h"
namespace mozilla {
namespace a11y {
class DocAccessibleChild;
class DocAccessiblePlatformExtChild : public PDocAccessiblePlatformExtChild {};
} // namespace a11y
} // namespace mozilla
#endif

View File

@ -1,18 +0,0 @@
/* vim: set ts=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/. */
#ifndef mozilla_a11y_DocAccessiblePlatformExtParent_h
#define mozilla_a11y_DocAccessiblePlatformExtParent_h
#include "mozilla/a11y/PDocAccessiblePlatformExtParent.h"
namespace mozilla {
namespace a11y {
class DocAccessiblePlatformExtParent : public PDocAccessiblePlatformExtParent {
};
} // namespace a11y
} // namespace mozilla
#endif

View File

@ -1,20 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=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 protocol PDocAccessible;
namespace mozilla {
namespace a11y {
[ManualDealloc]
protocol PDocAccessiblePlatformExt {
manager PDocAccessible;
child:
async __delete__();
};
}}

View File

@ -1,17 +0,0 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# 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/.
if CONFIG["ACCESSIBILITY"]:
IPDL_SOURCES += ["PDocAccessiblePlatformExt.ipdl"]
EXPORTS.mozilla.a11y += [
"DocAccessiblePlatformExtChild.h",
"DocAccessiblePlatformExtParent.h",
]
include("/ipc/chromium/chromium-config.mozbuild")
FINAL_LIBRARY = "xul"

View File

@ -12,7 +12,7 @@ if CONFIG["OS_ARCH"] == "WINNT":
"/accessible/windows/msaa",
]
else:
DIRS += ["other", "extension"]
DIRS += ["other"]
LOCAL_INCLUDES += [
"/accessible/ipc/other",
]

View File

@ -9,7 +9,6 @@
#include "LocalAccessible-inl.h"
#include "RemoteAccessible.h"
#include "HyperTextAccessible-inl.h"
#include "mozilla/a11y/DocAccessiblePlatformExtChild.h"
namespace mozilla {
namespace a11y {
@ -67,21 +66,5 @@ mozilla::ipc::IPCResult DocAccessibleChild::RecvRestoreFocus() {
return IPC_OK();
}
bool DocAccessibleChild::DeallocPDocAccessiblePlatformExtChild(
PDocAccessiblePlatformExtChild* aActor) {
delete aActor;
return true;
}
PDocAccessiblePlatformExtChild*
DocAccessibleChild::AllocPDocAccessiblePlatformExtChild() {
return new DocAccessiblePlatformExtChild();
}
DocAccessiblePlatformExtChild* DocAccessibleChild::GetPlatformExtension() {
return static_cast<DocAccessiblePlatformExtChild*>(
SingleManagedOrNull(ManagedPDocAccessiblePlatformExtChild()));
}
} // namespace a11y
} // namespace mozilla

View File

@ -13,15 +13,12 @@ namespace mozilla {
namespace a11y {
class LocalAccessible;
class DocAccessiblePlatformExtChild;
/*
* These objects handle content side communication for an accessible document,
* and their lifetime is the same as the document they represent.
*/
class DocAccessibleChild : public DocAccessibleChildBase {
friend DocAccessiblePlatformExtChild;
public:
DocAccessibleChild(DocAccessible* aDoc, IProtocol* aManager)
: DocAccessibleChildBase(aDoc) {
@ -52,14 +49,6 @@ class DocAccessibleChild : public DocAccessibleChildBase {
const uint64_t& aID, const int32_t& aStartOffset,
const int32_t& aEndOffset, const uint32_t& aCoordinateType,
const int32_t& aX, const int32_t& aY) override;
virtual bool DeallocPDocAccessiblePlatformExtChild(
PDocAccessiblePlatformExtChild* aActor) override;
virtual PDocAccessiblePlatformExtChild* AllocPDocAccessiblePlatformExtChild()
override;
DocAccessiblePlatformExtChild* GetPlatformExtension();
};
} // namespace a11y

View File

@ -5,7 +5,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
include protocol PBrowser;
include protocol PDocAccessiblePlatformExt;
include DocAccessibleTypes;
@ -66,10 +65,8 @@ struct TextRangeData
sync protocol PDocAccessible
{
manager PBrowser;
manages PDocAccessiblePlatformExt;
parent:
async PDocAccessiblePlatformExt();
async Shutdown();
/*

View File

@ -12,7 +12,6 @@
#include "nsCocoaUtils.h"
#include "DocAccessibleParent.h"
#include "nsAccessibilityService.h"
#include "mozilla/a11y/DocAccessiblePlatformExtParent.h"
using namespace mozilla::a11y;

View File

@ -27,10 +27,6 @@ platform = notwin
description = Legacy a11y IPC
platform = win
[PDocAccessiblePlatformExt::ApplyPostSearchFilter]
description = Filter a preliminary list of accessibles that match a predicate. Platform API is synchronous, so this needs to be too.
platform = mac
# The rest
[PHeapSnapshotTempFileHelper::OpenHeapSnapshotTempFile]
description = legacy sync IPC - please add detailed description