bug 1214864 - make SetCarretOffset() async r=davidb

It calls TakeFocus() which needs to be async to avoid deadlocks, so it needs to
be async as well.
This commit is contained in:
Trevor Saunders 2015-10-14 16:36:52 -04:00
parent e1504edae4
commit 9eef2078ad
6 changed files with 9 additions and 15 deletions

View File

@ -586,9 +586,8 @@ setCaretOffsetCB(AtkText *aText, gint aOffset)
}
if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aText))) {
if (proxy->SetCaretOffset(aOffset)) {
return TRUE;
}
proxy->SetCaretOffset(aOffset);
return TRUE;
}
return FALSE;

View File

@ -390,13 +390,10 @@ DocAccessibleChild::RecvCaretOffset(const uint64_t& aID, int32_t* aOffset)
bool
DocAccessibleChild::RecvSetCaretOffset(const uint64_t& aID,
const int32_t& aOffset,
bool* aRetVal)
const int32_t& aOffset)
{
HyperTextAccessible* acc = IdToHyperTextAccessible(aID);
*aRetVal = false;
if (acc && acc->IsTextRole() && acc->IsValidOffset(aOffset)) {
*aRetVal = true;
acc->SetCaretOffset(aOffset);
}
return true;

View File

@ -103,8 +103,8 @@ public:
override;
virtual bool RecvCaretOffset(const uint64_t& aID, int32_t* aOffset)
override;
virtual bool RecvSetCaretOffset(const uint64_t& aID, const int32_t& aOffset,
bool* aValid) override;
virtual bool RecvSetCaretOffset(const uint64_t& aID, const int32_t& aOffset)
override;
virtual bool RecvCharacterCount(const uint64_t& aID, int32_t* aCount)
override;

View File

@ -92,7 +92,7 @@ child:
// TextSubstring is getText in IDL.
prio(high) sync CaretLineNumber(uint64_t aID) returns(int32_t aLineNumber);
prio(high) sync CaretOffset(uint64_t aID) returns(int32_t aOffset);
prio(high) sync SetCaretOffset(uint64_t aID, int32_t aOffset) returns (bool aValid);
async SetCaretOffset(uint64_t aID, int32_t aOffset);
prio(high) sync CharacterCount(uint64_t aID) returns(int32_t aCount);
prio(high) sync SelectionCount(uint64_t aID) returns(int32_t aCount);
prio(high) sync TextSubstring(uint64_t aID, int32_t aStartOffset, int32_t

View File

@ -216,12 +216,10 @@ ProxyAccessible::CaretOffset()
return offset;
}
bool
void
ProxyAccessible::SetCaretOffset(int32_t aOffset)
{
bool valid = false;
unused << mDoc->SendSetCaretOffset(mID, aOffset, &valid);
return valid;
unused << mDoc->SendSetCaretOffset(mID, aOffset);
}
int32_t

View File

@ -132,7 +132,7 @@ public:
int32_t CaretLineNumber();
int32_t CaretOffset();
bool SetCaretOffset(int32_t aOffset);
void SetCaretOffset(int32_t aOffset);
int32_t CharacterCount();
int32_t SelectionCount();