зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1310833: Modify PContentParent::SendActivateA11y to accept the content process's MSAA ID as a parameter; r=tbsaunde
MozReview-Commit-ID: 9OIpO0G0Q7j
This commit is contained in:
Родитель
710cd95c09
Коммит
40b7b97fd0
|
@ -85,16 +85,14 @@ private:
|
||||||
|
|
||||||
constexpr MsaaIdGenerator::MsaaIdGenerator()
|
constexpr MsaaIdGenerator::MsaaIdGenerator()
|
||||||
: mIDSet(kNumUniqueIDBits)
|
: mIDSet(kNumUniqueIDBits)
|
||||||
, mContentProcessID(0)
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
uint32_t
|
uint32_t
|
||||||
MsaaIdGenerator::GetID()
|
MsaaIdGenerator::GetID()
|
||||||
{
|
{
|
||||||
static const uint32_t kContentProcessId = ResolveContentProcessID();
|
|
||||||
uint32_t id = mIDSet.GetID();
|
uint32_t id = mIDSet.GetID();
|
||||||
MOZ_ASSERT(id <= ((1UL << kNumUniqueIDBits) - 1UL));
|
MOZ_ASSERT(id <= ((1UL << kNumUniqueIDBits) - 1UL));
|
||||||
return detail::BuildMsaaID(id, kContentProcessId);
|
return detail::BuildMsaaID(id, ResolveContentProcessID());
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -104,7 +102,7 @@ MsaaIdGenerator::ReleaseID(AccessibleWrap* aAccWrap)
|
||||||
uint32_t id = aAccWrap->GetExistingID();
|
uint32_t id = aAccWrap->GetExistingID();
|
||||||
MOZ_ASSERT(id != AccessibleWrap::kNoID);
|
MOZ_ASSERT(id != AccessibleWrap::kNoID);
|
||||||
detail::MsaaIDCracker cracked(id);
|
detail::MsaaIDCracker cracked(id);
|
||||||
if (cracked.GetContentProcessId() != mContentProcessID) {
|
if (cracked.GetContentProcessId() != ResolveContentProcessID()) {
|
||||||
// This may happen if chrome holds a proxy whose ID was originally generated
|
// This may happen if chrome holds a proxy whose ID was originally generated
|
||||||
// by a content process. Since ReleaseID only has meaning in the process
|
// by a content process. Since ReleaseID only has meaning in the process
|
||||||
// that originally generated that ID, we ignore ReleaseID calls for any ID
|
// that originally generated that ID, we ignore ReleaseID calls for any ID
|
||||||
|
@ -126,9 +124,8 @@ bool
|
||||||
MsaaIdGenerator::IsIDForThisContentProcess(uint32_t aID)
|
MsaaIdGenerator::IsIDForThisContentProcess(uint32_t aID)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(XRE_IsContentProcess());
|
MOZ_ASSERT(XRE_IsContentProcess());
|
||||||
static const uint32_t kContentProcessId = ResolveContentProcessID();
|
|
||||||
detail::MsaaIDCracker cracked(aID);
|
detail::MsaaIDCracker cracked(aID);
|
||||||
return cracked.GetContentProcessId() == kContentProcessId;
|
return cracked.GetContentProcessId() == ResolveContentProcessID();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
@ -158,10 +155,10 @@ MsaaIdGenerator::ResolveContentProcessID()
|
||||||
}
|
}
|
||||||
|
|
||||||
dom::ContentChild* contentChild = dom::ContentChild::GetSingleton();
|
dom::ContentChild* contentChild = dom::ContentChild::GetSingleton();
|
||||||
Unused << contentChild->SendGetA11yContentId(&mContentProcessID);
|
uint32_t result = contentChild->GetMsaaID();
|
||||||
|
|
||||||
MOZ_ASSERT(mContentProcessID);
|
MOZ_ASSERT(result);
|
||||||
return mContentProcessID;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -48,7 +48,6 @@ private:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
IDSet mIDSet;
|
IDSet mIDSet;
|
||||||
uint32_t mContentProcessID;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace a11y
|
} // namespace a11y
|
||||||
|
|
|
@ -507,6 +507,9 @@ ContentChild* ContentChild::sSingleton;
|
||||||
|
|
||||||
ContentChild::ContentChild()
|
ContentChild::ContentChild()
|
||||||
: mID(uint64_t(-1))
|
: mID(uint64_t(-1))
|
||||||
|
#if defined(XP_WIN) && defined(ACCESSIBILITY)
|
||||||
|
, mMsaaID(0)
|
||||||
|
#endif
|
||||||
, mCanOverrideProcessName(true)
|
, mCanOverrideProcessName(true)
|
||||||
, mIsAlive(true)
|
, mIsAlive(true)
|
||||||
, mShuttingDown(false)
|
, mShuttingDown(false)
|
||||||
|
@ -2445,13 +2448,18 @@ ContentChild::RecvFlushMemory(const nsString& reason)
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
ContentChild::RecvActivateA11y()
|
ContentChild::RecvActivateA11y(const uint32_t& aMsaaID)
|
||||||
{
|
{
|
||||||
#ifdef ACCESSIBILITY
|
#ifdef ACCESSIBILITY
|
||||||
|
#ifdef XP_WIN
|
||||||
|
MOZ_ASSERT(aMsaaID != 0);
|
||||||
|
mMsaaID = aMsaaID;
|
||||||
|
#endif // XP_WIN
|
||||||
|
|
||||||
// Start accessibility in content process if it's running in chrome
|
// Start accessibility in content process if it's running in chrome
|
||||||
// process.
|
// process.
|
||||||
GetOrCreateAccService(nsAccessibilityService::eMainProcess);
|
GetOrCreateAccService(nsAccessibilityService::eMainProcess);
|
||||||
#endif
|
#endif // ACCESSIBILITY
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -446,7 +446,7 @@ public:
|
||||||
|
|
||||||
virtual bool RecvFlushMemory(const nsString& reason) override;
|
virtual bool RecvFlushMemory(const nsString& reason) override;
|
||||||
|
|
||||||
virtual bool RecvActivateA11y() override;
|
virtual bool RecvActivateA11y(const uint32_t& aMsaaID) override;
|
||||||
virtual bool RecvShutdownA11y() override;
|
virtual bool RecvShutdownA11y() override;
|
||||||
|
|
||||||
virtual bool RecvGarbageCollect() override;
|
virtual bool RecvGarbageCollect() override;
|
||||||
|
@ -567,6 +567,10 @@ public:
|
||||||
|
|
||||||
ContentParentId GetID() const { return mID; }
|
ContentParentId GetID() const { return mID; }
|
||||||
|
|
||||||
|
#if defined(XP_WIN) && defined(ACCESSIBILITY)
|
||||||
|
uint32_t GetMsaaID() const { return mMsaaID; }
|
||||||
|
#endif
|
||||||
|
|
||||||
bool IsForApp() const { return mIsForApp; }
|
bool IsForApp() const { return mIsForApp; }
|
||||||
bool IsForBrowser() const { return mIsForBrowser; }
|
bool IsForBrowser() const { return mIsForBrowser; }
|
||||||
|
|
||||||
|
@ -687,6 +691,14 @@ private:
|
||||||
*/
|
*/
|
||||||
ContentParentId mID;
|
ContentParentId mID;
|
||||||
|
|
||||||
|
#if defined(XP_WIN) && defined(ACCESSIBILITY)
|
||||||
|
/**
|
||||||
|
* This is an a11y-specific unique id for the content process that is
|
||||||
|
* generated by the chrome process.
|
||||||
|
*/
|
||||||
|
uint32_t mMsaaID;
|
||||||
|
#endif
|
||||||
|
|
||||||
AppInfo mAppInfo;
|
AppInfo mAppInfo;
|
||||||
|
|
||||||
bool mIsForApp;
|
bool mIsForApp;
|
||||||
|
|
|
@ -1361,10 +1361,11 @@ ContentParent::Init()
|
||||||
if (nsIPresShell::IsAccessibilityActive()) {
|
if (nsIPresShell::IsAccessibilityActive()) {
|
||||||
#if defined(XP_WIN)
|
#if defined(XP_WIN)
|
||||||
if (IsVistaOrLater()) {
|
if (IsVistaOrLater()) {
|
||||||
Unused << SendActivateA11y();
|
Unused <<
|
||||||
|
SendActivateA11y(a11y::AccessibleWrap::GetContentProcessIdFor(ChildID()));
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
Unused << SendActivateA11y();
|
Unused << SendActivateA11y(0);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -2790,10 +2791,11 @@ ContentParent::Observe(nsISupports* aSubject,
|
||||||
// accessibility gets initiated in chrome process.
|
// accessibility gets initiated in chrome process.
|
||||||
#if defined(XP_WIN)
|
#if defined(XP_WIN)
|
||||||
if (IsVistaOrLater()) {
|
if (IsVistaOrLater()) {
|
||||||
Unused << SendActivateA11y();
|
Unused <<
|
||||||
|
SendActivateA11y(a11y::AccessibleWrap::GetContentProcessIdFor(ChildID()));
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
Unused << SendActivateA11y();
|
Unused << SendActivateA11y(0);
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
// If possible, shut down accessibility in content process when
|
// If possible, shut down accessibility in content process when
|
||||||
|
@ -5198,18 +5200,6 @@ ContentParent::RecvUnstoreAndBroadcastBlobURLUnregistration(const nsCString& aUR
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
|
||||||
ContentParent::RecvGetA11yContentId(uint32_t* aContentId)
|
|
||||||
{
|
|
||||||
#if defined(XP_WIN32) && defined(ACCESSIBILITY)
|
|
||||||
*aContentId = a11y::AccessibleWrap::GetContentProcessIdFor(ChildID());
|
|
||||||
MOZ_ASSERT(*aContentId);
|
|
||||||
return true;
|
|
||||||
#else
|
|
||||||
return false;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace dom
|
} // namespace dom
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
|
||||||
|
|
|
@ -553,9 +553,6 @@ public:
|
||||||
virtual bool
|
virtual bool
|
||||||
RecvUnstoreAndBroadcastBlobURLUnregistration(const nsCString& aURI) override;
|
RecvUnstoreAndBroadcastBlobURLUnregistration(const nsCString& aURI) override;
|
||||||
|
|
||||||
virtual bool
|
|
||||||
RecvGetA11yContentId(uint32_t* aContentId) override;
|
|
||||||
|
|
||||||
virtual int32_t Pid() const override;
|
virtual int32_t Pid() const override;
|
||||||
|
|
||||||
// Use the PHangMonitor channel to ask the child to repaint a tab.
|
// Use the PHangMonitor channel to ask the child to repaint a tab.
|
||||||
|
|
|
@ -511,8 +511,11 @@ child:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Start accessibility engine in content process.
|
* Start accessibility engine in content process.
|
||||||
|
* @param aMsaaID is an a11y-specific unique id for the content process
|
||||||
|
* that is generated by the chrome process. Only used on
|
||||||
|
* Windows; pass 0 on other platforms.
|
||||||
*/
|
*/
|
||||||
async ActivateA11y();
|
async ActivateA11y(uint32_t aMsaaID);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shutdown accessibility engine in content process (if not in use).
|
* Shutdown accessibility engine in content process (if not in use).
|
||||||
|
@ -1185,8 +1188,6 @@ parent:
|
||||||
async AccumulateChildHistogram(Accumulation[] accumulations);
|
async AccumulateChildHistogram(Accumulation[] accumulations);
|
||||||
async AccumulateChildKeyedHistogram(KeyedAccumulation[] accumulations);
|
async AccumulateChildKeyedHistogram(KeyedAccumulation[] accumulations);
|
||||||
|
|
||||||
sync GetA11yContentId() returns (uint32_t aContentId);
|
|
||||||
|
|
||||||
both:
|
both:
|
||||||
async AsyncMessage(nsString aMessage, CpowEntry[] aCpows,
|
async AsyncMessage(nsString aMessage, CpowEntry[] aCpows,
|
||||||
Principal aPrincipal, ClonedMessageData aData);
|
Principal aPrincipal, ClonedMessageData aData);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче